Oracleでdbunitを使用しようとしており、以下のようなテストケースがあります。以下のコードを実行しようとすると、それが表示されます。ここでどこが間違っているのかわかりません。誰か助けてくれませんか
org.dbunit.dataset.NoSuchTableException: org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:278) の INVOICE_STATUS_TYPE org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:109) で org.dbunit.operation. CompositeOperation.execute(CompositeOperation.java:79)
import junit.framework.Assert;
import org.dbunit.DBTestCase;
import org.dbunit.PropertiesBasedJdbcDatabaseTester;
import org.dbunit.database.DatabaseConfig;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.FlatXmlDataSet;
import org.junit.Test;
public class MyTest extends DBTestCase{
private FlatXmlDataSet loadedDataSet;
public MyTest() {
super();
System.out.println("TEST TEST");
System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS, "oracle.jdbc.OracleDriver" );
System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL, "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=vp1.qa.nsc.com)(PORT=2186))(CONNECT_DATA=(SERVICE_NAME=FADBBD1E)))" );
System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME, "nscdba" );
System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD, "dscdbapwd" );
System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_SCHEMA, "INVOICE" );
}
@Override
protected IDataSet getDataSet() throws Exception {
//return new FlatXmlDataSetBuilder().build(new FileInputStream("dataset.xml"));
loadedDataSet = new FlatXmlDataSet(this.getClass().getClassLoader().getResourceAsStream("dataset.xml"));
System.out.println(loadedDataSet.getTableNames().length);
return loadedDataSet;
}
@Test
public void testStatus() {
System.out.println("Hey...");
Assert.assertTrue( true );
}
protected void setUpDatabaseConfig(DatabaseConfig config) {
config.setProperty( DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true );
}
}