Accessing multiple MySQL databases/schemas

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Accessing multiple MySQL databases/schemas

hordine
Hi everyone,

I'm using DBUnit 2.4.8 and when I try get it to insert data into 2 different schemas, I get the following error:

org.dbunit.dataset.NoSuchTableException: RegistrationTestDB.bank
at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:288)
at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:109)
at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79)
at org.dbunit.AbstractDatabaseTester.executeOperation(AbstractDatabaseTester.java:190)
at org.dbunit.AbstractDatabaseTester.onSetup(AbstractDatabaseTester.java:103)
at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:156)
at junit.framework.TestCase.runBare(TestCase.java:132)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


I've already tried all this:

public BaseTestCase(String name) {

        super(name);

        System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS"com.mysql.jdbc.Driver" );

        System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL"jdbc:mysql://localhost:3306" );

        //System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_SCHEMA, "OrderManagementTestDB" );

        System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME"EZswitch" );

        System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD"EZsw1tch" );

        System.setProperty("dbunit.qualified.table.names""true");

    }


And all these:


DatabaseConfig config = null;        

        try {

         config = getConnection().getConfig();

         //config.setFeature("http://www.dbunit.org/features/qualifiedTableNames", true);

         //config.setFeature(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true);

         config.setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMEStrue);

catch (Exception e) {

e.printStackTrace();

}


        return new CompositeDataSet(

                new IDataSet[] {

                        new XmlDataSet( this.getClass().getClassLoader().getResourceAsStream("datasets/staticData_dataset.xml")),

                        new XmlDataSet( this.getClass().getClassLoader().getResourceAsStream("datasets/blackLists_dataset.xml")),

                        rPurchaseOrderDataSet,

                        new XmlDataSet( this.getClass().getClassLoader().getResourceAsStream("datasets/mailOrder_dataset.xml")),

                        rPaymentDataSet,

                        new XmlDataSet( this.getClass().getClassLoader().getResourceAsStream("datasets/registration_dataset.xml")),

                        new XmlDataSet( this.getClass().getClassLoader().getResourceAsStream("datasets/registration_staticdata_dataset.xml"))

                });



I'd appreciate any help.


Kind regards, 


--
Henrique Ordine

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user