|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Stuck on problem trying to use DbUnitHello,
I am trying to use DbUnit to set up test data for a set of tests being run via JUnit 4. I am getting the following error when running the tests: org.dbunit.dataset.DataSetException: org.dbunit.dataset.NoSuchTableException: column at org.dbunit.dataset.xml.FlatXmlProducer.produce(FlatXmlProducer.java:197) at org.dbunit.dataset.CachedDataSet.<init>(CachedDataSet.java:80) at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:134) at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:110) at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:97) at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.getDataSet(DataImportIntegrationTest.java:941) at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.createTestData(DataImportIntegrationTest.java:967) at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.setUp(DataImportIntegrationTest.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74) at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) ... I have carefully checked the XML file and all table and column names are in the database schema being accessed. None of the tables is named 'column' or contains a column named 'column'. The only possible thing I can see is that one of the tables being inserted into is a synonym. I can execute both select and insert statements against the schema using a client like DbVisualizer on the synonyms. Using P6Spy as recommended on the DbUnit website I get: 1214817732756|23|2|statement||SELECT id FROM principal WHERE name='Gengis Khan' I see 14 of these statements in the log and I am running 14 junit tests. So for each test DbUnit runs to refresh the data, outputs this SQL statement and then the test fails with the exception shown above. Here principal is the synonym and user 'Gengis Khan' is the name of the user I am trying to insert. His XML entry is: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> <dataset> <!-- PRINCIPAL --> <table name="seqjunit.principal"> <column>id</column> <column>name</column> <column>password</column> <column>commonname</column> <column>location_id</column> <row> <value>666</value> <value>Gengis Khan</value> <null/> <null/> <null/> </row> <row> <value>667</value> <value>Julius Caesar</value> <null/> <null/> <null/> </row> </table> ... etc The corresponding DTD being used is: <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT dataset (table+)> <!ELEMENT table (column*, row*)> <!ATTLIST table name CDATA #REQUIRED> <!ELEMENT column (#PCDATA)> <!ELEMENT row (value | null | none)*> <!ELEMENT value (#PCDATA)> <!ELEMENT null EMPTY> I can find no examples of this problem via Google. Those reports of NoSuchTableException invariably arise because the schema is not generated. I have checked that the schema exists and it all looks fine. My conclusion is that the likely cause is the synonym into which I am trying to insert. The synonym has the same name as the table in the other schema to which it refers. But DbUnit docs don't mention anything specifically about use of synonyms. Anyone have any ideas please? Thanks. To the extent this electronic communication or any of its attachments contain information that is not in the public domain, such information is considered by MedImmune to be confidential and proprietary. This communication is expected to be read and/or used only by the individual(s) for whom it is intended. If you have received this electronic communication in error, please reply to the sender advising of the error in transmission and delete the original message and any accompanying documents from your system immediately, without copying, reviewing or otherwise using them for any purpose. Thank you for your cooperation. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
Re: Stuck on problem trying to use DbUnitHi Timothy,
I never used such dataset definition... I think if you use FlatXmlDataSet (as stated by your stacktrace) your XML should looks like <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> <dataset> <!-- PRINCIPAL --> <seqjunit.principal id="666" name="Gengis Khan"/> <seqjunit.principal id="667" name="Julius Caesar"> </dataset> I'm not an expert on datasets so I'll let others confirm or revert my statement 2008/6/30 Mowlem, Timothy <MowlemT@...>: > Hello, > > I am trying to use DbUnit to set up test data for a set of tests being run via JUnit 4. I am getting the following error when running the tests: > > org.dbunit.dataset.DataSetException: org.dbunit.dataset.NoSuchTableException: column > at org.dbunit.dataset.xml.FlatXmlProducer.produce(FlatXmlProducer.java:197) > at org.dbunit.dataset.CachedDataSet.<init>(CachedDataSet.java:80) > at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:134) > at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:110) > at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:97) > at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.getDataSet(DataImportIntegrationTest.java:941) > at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.createTestData(DataImportIntegrationTest.java:967) > at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.setUp(DataImportIntegrationTest.java:108) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74) > at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50) > at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33) > at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) > at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) > at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) > at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) > at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) > at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) > at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > ... > > I have carefully checked the XML file and all table and column names are in the database schema being accessed. None of the tables is named 'column' or contains a column named 'column'. > > The only possible thing I can see is that one of the tables being inserted into is a synonym. I can execute both select and insert statements against the schema using a client like DbVisualizer on the synonyms. Using P6Spy as recommended on the DbUnit website I get: > > 1214817732756|23|2|statement||SELECT id FROM principal WHERE name='Gengis Khan' > > I see 14 of these statements in the log and I am running 14 junit tests. So for each test DbUnit runs to refresh the data, outputs this SQL statement and then the test fails with the exception shown above. > > Here principal is the synonym and user 'Gengis Khan' is the name of the user I am trying to insert. His XML entry is: > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> > > > <dataset> > > <!-- PRINCIPAL --> > <table name="seqjunit.principal"> > <column>id</column> > <column>name</column> > <column>password</column> > <column>commonname</column> > <column>location_id</column> > <row> > <value>666</value> > <value>Gengis Khan</value> > <null/> > <null/> > <null/> > </row> > <row> > <value>667</value> > <value>Julius Caesar</value> > <null/> > <null/> > <null/> > </row> > </table> > ... etc > > The corresponding DTD being used is: > > <?xml version="1.0" encoding="UTF-8"?> > > <!ELEMENT dataset (table+)> > <!ELEMENT table (column*, row*)> > <!ATTLIST table name CDATA #REQUIRED> > <!ELEMENT column (#PCDATA)> > <!ELEMENT row (value | null | none)*> > <!ELEMENT value (#PCDATA)> > <!ELEMENT null EMPTY> > > > I can find no examples of this problem via Google. Those reports of NoSuchTableException invariably arise because the schema is not generated. I have checked that the schema exists and it all looks fine. > > My conclusion is that the likely cause is the synonym into which I am trying to insert. The synonym has the same name as the table in the other schema to which it refers. But DbUnit docs don't mention anything specifically about use of synonyms. > > Anyone have any ideas please? > > > Thanks. > > > > To the extent this electronic communication or any of its attachments contain information that is not in the public domain, such information is considered by MedImmune to be confidential and proprietary. This communication is expected to be read and/or used only by the individual(s) for whom it is intended. If you have received this electronic communication in error, please reply to the sender advising of the error in transmission and delete the original message and any accompanying documents from your system immediately, without copying, reviewing or otherwise using them for any purpose. Thank you for your cooperation. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > dbunit-user mailing list > dbunit-user@... > https://lists.sourceforge.net/lists/listinfo/dbunit-user > -- Roberto Lo Giacco ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
Re: Stuck on problem trying to use DbUnitOn Mon, Jun 30, 2008 at 2:42 PM, Roberto Lo Giacco
<rlogiacco@...> wrote: > Hi Timothy, > I never used such dataset definition... I think if you use > FlatXmlDataSet (as stated by your stacktrace) your XML should looks > like > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> > <dataset> > <!-- PRINCIPAL --> > <seqjunit.principal id="666" name="Gengis Khan"/> > <seqjunit.principal id="667" name="Julius Caesar"> > </dataset> > > I'm not an expert on datasets so I'll let others confirm or revert my statement > > 2008/6/30 Mowlem, Timothy <MowlemT@...>: >> Hello, >> >> I am trying to use DbUnit to set up test data for a set of tests being run via JUnit 4. I am getting the following error when running the tests: >> >> org.dbunit.dataset.DataSetException: org.dbunit.dataset.NoSuchTableException: column >> at org.dbunit.dataset.xml.FlatXmlProducer.produce(FlatXmlProducer.java:197) >> at org.dbunit.dataset.CachedDataSet.<init>(CachedDataSet.java:80) >> at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:134) >> at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:110) >> at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:97) >> at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.getDataSet(DataImportIntegrationTest.java:941) >> at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.createTestData(DataImportIntegrationTest.java:967) >> at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.setUp(DataImportIntegrationTest.java:108) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:585) >> at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74) >> at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50) >> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33) >> at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) >> at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) >> at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) >> at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) >> at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) >> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >> at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) >> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) >> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >> ... >> >> I have carefully checked the XML file and all table and column names are in the database schema being accessed. None of the tables is named 'column' or contains a column named 'column'. >> >> The only possible thing I can see is that one of the tables being inserted into is a synonym. I can execute both select and insert statements against the schema using a client like DbVisualizer on the synonyms. Using P6Spy as recommended on the DbUnit website I get: >> >> 1214817732756|23|2|statement||SELECT id FROM principal WHERE name='Gengis Khan' >> >> I see 14 of these statements in the log and I am running 14 junit tests. So for each test DbUnit runs to refresh the data, outputs this SQL statement and then the test fails with the exception shown above. >> >> Here principal is the synonym and user 'Gengis Khan' is the name of the user I am trying to insert. His XML entry is: >> >> <?xml version="1.0" encoding="utf-8"?> >> <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> >> >> >> <dataset> >> >> <!-- PRINCIPAL --> >> <table name="seqjunit.principal"> >> <column>id</column> >> <column>name</column> >> <column>password</column> >> <column>commonname</column> >> <column>location_id</column> >> <row> >> <value>666</value> >> <value>Gengis Khan</value> >> <null/> >> <null/> >> <null/> >> </row> >> <row> >> <value>667</value> >> <value>Julius Caesar</value> >> <null/> >> <null/> >> <null/> >> </row> >> </table> >> ... etc >> >> The corresponding DTD being used is: >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <!ELEMENT dataset (table+)> >> <!ELEMENT table (column*, row*)> >> <!ATTLIST table name CDATA #REQUIRED> >> <!ELEMENT column (#PCDATA)> >> <!ELEMENT row (value | null | none)*> >> <!ELEMENT value (#PCDATA)> >> <!ELEMENT null EMPTY> >> >> >> I can find no examples of this problem via Google. Those reports of NoSuchTableException invariably arise because the schema is not generated. I have checked that the schema exists and it all looks fine. >> >> My conclusion is that the likely cause is the synonym into which I am trying to insert. The synonym has the same name as the table in the other schema to which it refers. But DbUnit docs don't mention anything specifically about use of synonyms. >> >> Anyone have any ideas please? >> >> >> Thanks. >> >> >> >> To the extent this electronic communication or any of its attachments contain information that is not in the public domain, such information is considered by MedImmune to be confidential and proprietary. This communication is expected to be read and/or used only by the individual(s) for whom it is intended. If you have received this electronic communication in error, please reply to the sender advising of the error in transmission and delete the original message and any accompanying documents from your system immediately, without copying, reviewing or otherwise using them for any purpose. Thank you for your cooperation. >> > > -- > Roberto Lo Giacco > I'm not sure about this, but afaik there is no DTD for flat XML sets. Did you write that yourself? As for the original question: change your code to use XmlDataSet instead of FlatXmlDataSet and you should be set. Best regards Marcus ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
FW: Stuck on problem trying to use DbUnitAll,
Thank you Marcus and Roberto for your prompt help, it is now working okay for me. The problem is that I was using an XMLDataSet in my XML file but creating and returning a new FlatXMLDataSet in code. The two types of DataSet are described on the Core Components page. Marcus said: > I'm not sure about this, but afaik there is no DTD for flat XML sets. Did you write that yourself? The XMLDataSet requires a DTD as described on the DbUnit Core Components page at http://www.dbunit.org/components.html so I just copied and pasted the example into a DTD file. Thank you. Tim Mowlem -----Original Message----- From: dbunit-user-bounces@... on behalf of Marcus Ilgner Sent: Mon 6/30/2008 2:01 PM To: dbunit-user@... Subject: Re: [dbunit-user] Stuck on problem trying to use DbUnit On Mon, Jun 30, 2008 at 2:42 PM, Roberto Lo Giacco <rlogiacco@...> wrote: > Hi Timothy, > I never used such dataset definition... I think if you use > FlatXmlDataSet (as stated by your stacktrace) your XML should looks > like > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> > <dataset> > <!-- PRINCIPAL --> > <seqjunit.principal id="666" name="Gengis Khan"/> > <seqjunit.principal id="667" name="Julius Caesar"> > </dataset> > > I'm not an expert on datasets so I'll let others confirm or revert my statement > > 2008/6/30 Mowlem, Timothy <MowlemT@...>: >> Hello, >> >> I am trying to use DbUnit to set up test data for a set of tests being run via JUnit 4. I am getting the following error when running the tests: >> >> org.dbunit.dataset.DataSetException: org.dbunit.dataset.NoSuchTableException: column >> at org.dbunit.dataset.xml.FlatXmlProducer.produce(FlatXmlProducer.java:197) >> at org.dbunit.dataset.CachedDataSet.<init>(CachedDataSet.java:80) >> at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:134) >> at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:110) >> at org.dbunit.dataset.xml.FlatXmlDataSet.<init>(FlatXmlDataSet.java:97) >> at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.getDataSet(DataImportIntegrationTest.java:941) >> at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.createTestData(DataImportIntegrationTest.java:967) >> at uk.co.catplc.server.ddi.dataimport.DataImportIntegrationTest.setUp(DataImportIntegrationTest.java:108) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:585) >> at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74) >> at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50) >> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33) >> at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) >> at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) >> at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) >> at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) >> at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) >> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >> at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) >> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) >> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >> ... >> >> I have carefully checked the XML file and all table and column names are in the database schema being accessed. None of the tables is named 'column' or contains a column named 'column'. >> >> The only possible thing I can see is that one of the tables being inserted into is a synonym. I can execute both select and insert statements against the schema using a client like DbVisualizer on the synonyms. Using P6Spy as recommended on the DbUnit website I get: >> >> 1214817732756|23|2|statement||SELECT id FROM principal WHERE name='Gengis Khan' >> >> I see 14 of these statements in the log and I am running 14 junit tests. So for each test DbUnit runs to refresh the data, outputs this SQL statement and then the test fails with the exception shown above. >> >> Here principal is the synonym and user 'Gengis Khan' is the name of the user I am trying to insert. His XML entry is: >> >> <?xml version="1.0" encoding="utf-8"?> >> <!DOCTYPE dataset SYSTEM "DataImportIntegrationTest.dtd"> >> >> >> <dataset> >> >> <!-- PRINCIPAL --> >> <table name="seqjunit.principal"> >> <column>id</column> >> <column>name</column> >> <column>password</column> >> <column>commonname</column> >> <column>location_id</column> >> <row> >> <value>666</value> >> <value>Gengis Khan</value> >> <null/> >> <null/> >> <null/> >> </row> >> <row> >> <value>667</value> >> <value>Julius Caesar</value> >> <null/> >> <null/> >> <null/> >> </row> >> </table> >> ... etc >> >> The corresponding DTD being used is: >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <!ELEMENT dataset (table+)> >> <!ELEMENT table (column*, row*)> >> <!ATTLIST table name CDATA #REQUIRED> >> <!ELEMENT column (#PCDATA)> >> <!ELEMENT row (value | null | none)*> >> <!ELEMENT value (#PCDATA)> >> <!ELEMENT null EMPTY> >> >> >> I can find no examples of this problem via Google. Those reports of NoSuchTableException invariably arise because the schema is not generated. I have checked that the schema exists and it all looks fine. >> >> My conclusion is that the likely cause is the synonym into which I am trying to insert. The synonym has the same name as the table in the other schema to which it refers. But DbUnit docs don't mention anything specifically about use of synonyms. >> >> Anyone have any ideas please? >> >> >> Thanks. >> >> >> >> To the extent this electronic communication or any of its attachments contain information that is not in the public domain, such information is considered by MedImmune to be confidential and proprietary. This communication is expected to be read and/or used only by the individual(s) for whom it is intended. If you have received this electronic communication in error, please reply to the sender advising of the error in transmission and delete the original message and any accompanying documents from your system immediately, without copying, reviewing or otherwise using them for any purpose. Thank you for your cooperation. >> > > -- > Roberto Lo Giacco > I'm not sure about this, but afaik there is no DTD for flat XML sets. Did you write that yourself? As for the original question: change your code to use XmlDataSet instead of FlatXmlDataSet and you should be set. Best regards Marcus ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user To the extent this electronic communication or any of its attachments contain information that is not in the public domain, such information is considered by MedImmune to be confidential and proprietary. This communication is expected to be read and/or used only by the individual(s) for whom it is intended. If you have received this electronic communication in error, please reply to the sender advising of the error in transmission and delete the original message and any accompanying documents from your system immediately, without copying, reviewing or otherwise using them for any purpose. Thank you for your cooperation. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
| Free Forum Powered by Nabble | Forum Help |