本文整理汇总了Java中org.dbunit.DataSourceDatabaseTester.setDataSet方法的典型用法代码示例。如果您正苦于以下问题:Java DataSourceDatabaseTester.setDataSet方法的具体用法?Java DataSourceDatabaseTester.setDataSet怎么用?Java DataSourceDatabaseTester.setDataSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dbunit.DataSourceDatabaseTester
的用法示例。
在下文中一共展示了DataSourceDatabaseTester.setDataSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.dbunit.DataSourceDatabaseTester; //导入方法依赖的package包/类
private void initialize(DataSource dataSource) throws AmbiguousTableNameException {
databaseTester = new DataSourceDatabaseTester(dataSource);
databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT);
databaseTester.setTearDownOperation(DatabaseOperation.DELETE_ALL);
DefaultDataSet dataSet = new DefaultDataSet();
dataSet.addTable(new DefaultTable("agents"));
dataSet.addTable(new DefaultTable("pipelines"));
dataSet.addTable(new DefaultTable("pipelinestates"));
dataSet.addTable(new DefaultTable("materials"));
dataSet.addTable(new DefaultTable("modifications"));
dataSet.addTable(new DefaultTable("pipelineMaterialRevisions"));
dataSet.addTable(new DefaultTable("modifiedFiles"));
dataSet.addTable(new DefaultTable("notificationfilters"));
dataSet.addTable(new DefaultTable("users"));
dataSet.addTable(new DefaultTable("artifactPropertiesGenerator"));
dataSet.addTable(new DefaultTable("stages"));
dataSet.addTable(new DefaultTable("pipelineLabelCounts"));
dataSet.addTable(new DefaultTable("environmentVariables"));
dataSet.addTable(new DefaultTable("properties"));
dataSet.addTable(new DefaultTable("artifactPlans"));
dataSet.addTable(new DefaultTable("buildStateTransitions"));
dataSet.addTable(new DefaultTable("resources"));
dataSet.addTable(new DefaultTable("builds"));
dataSet.addTable(new DefaultTable("oauthclients"));
dataSet.addTable(new DefaultTable("oauthauthorizations"));
dataSet.addTable(new DefaultTable("oauthtokens"));
dataSet.addTable(new DefaultTable("stageArtifactCleanupProhibited"));
dataSet.addTable(new DefaultTable("serverBackups"));
dataSet.addTable(new DefaultTable("jobAgentMetadata"));
databaseTester.setDataSet(dataSet);
}
示例2: setUp
import org.dbunit.DataSourceDatabaseTester; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
dbTester = new DataSourceDatabaseTester(businessDataSource);
FlatXmlDataSetBuilder aBuilder = new FlatXmlDataSetBuilder();
FileInputStream aDTDStream = new FileInputStream("src/test/resources/db/dataset.dtd");
FileInputStream aDataStream = new FileInputStream("src/test/resources/db/dataset.xml");
aBuilder.setMetaDataSetFromDtd(aDTDStream);
IDataSet dataSet = aBuilder.build(aDataStream);
aDTDStream.close();
aDataStream.close();
dbTester.setDataSet(dataSet);
dbTester.onSetup();
}