gpt4 book ai didi

org.jboss.arquillian.persistence.dbunit.dataset.yaml.YamlDataSet类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 05:59:31 29 4
gpt4 key购买 nike

本文整理了Java中org.jboss.arquillian.persistence.dbunit.dataset.yaml.YamlDataSet类的一些代码示例,展示了YamlDataSet类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlDataSet类的具体详情如下:
包路径:org.jboss.arquillian.persistence.dbunit.dataset.yaml.YamlDataSet
类名称:YamlDataSet

YamlDataSet介绍

[英]DBUnit data set produced from YAML format. Each table has its own section in the YAML document, where its' name is the root element indicating that following entries are describing rows using column name : value pairs. Each new row is denoted by '-', as in following example:

useraccount: 
- id: 1 
firstname: Clark 
lastname: Kent 
username: superman 
password: kryptonite 
address: 
- id: 1 
streetname: "Kryptonite Street" 
houseNumber: 7 
city: Metropolis 
zipCode: 1234 
useraccount_address: 
- useraccount_id: 1 
addresses_id: 1

[中]从YAML格式生成的DBUnit数据集。每个表在YAML文档中都有自己的部分,其中的'name'是根元素,表示以下条目使用列名:值对来描述行。每一新行用“-”表示,如下例所示:

useraccount: 
- id: 1 
firstname: Clark 
lastname: Kent 
username: superman 
password: kryptonite 
address: 
- id: 1 
streetname: "Kryptonite Street" 
houseNumber: 7 
city: Metropolis 
zipCode: 1234 
useraccount_address: 
- useraccount_id: 1 
addresses_id: 1

代码示例

代码示例来源:origin: arquillian/arquillian-extension-persistence

private IDataSet loadYamlDataSet(final String file) throws IOException,
  DataSetException {
  IDataSet dataSet;
  if (isYamlEmpty(file)) {
    dataSet = new DefaultDataSet();
  } else {
    final InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
    dataSet = new YamlDataSet(inputStream);
    if (inputStream != null) {
      inputStream.close();
    }
  }
  return dataSet;
}

代码示例来源:origin: org.jboss.arquillian.extension/arquillian-persistence-impl

private IDataSet loadYamlDataSet(final String file) throws IOException,
   DataSetException
{
 IDataSet dataSet;
 if (isYamlEmpty(file))
 {
   dataSet = new DefaultDataSet();
 }
 else
 {
   final InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
   dataSet = new YamlDataSet(inputStream);
   if (inputStream != null)
   {
    inputStream.close();
   }
 }
 return dataSet;
}

代码示例来源:origin: org.jboss.arquillian.extension/arquillian-persistence-dbunit

private IDataSet loadYamlDataSet(final String file) throws IOException,
   DataSetException
{
 IDataSet dataSet;
 if (isYamlEmpty(file))
 {
   dataSet = new DefaultDataSet();
 }
 else
 {
   final InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
   dataSet = new YamlDataSet(inputStream);
   if (inputStream != null)
   {
    inputStream.close();
   }
 }
 return dataSet;
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com