Re: DBUnit on Sybase Views

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: DBUnit on Sybase Views

MALou

I am having issues with using DBUnit to load data into a Sybase view.
I know my test works, it works great if the view is a table in the database.

When I run it against the view Sybase instance, I get"
 
org.dbunit.dataset.NoSuchTableException: cu02tb01
    at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:279)
    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 com.weenergies.cs.unittest.testcase.DbUnitTestCase.setUp(DbUnitTestCase.java:78)
    at com.weenergies.cs.unittest.testcase.PersistenceTestCase.setUpPersistence(PersistenceTestCase.java:131)
    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:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at com.weenergies.cs.unittest.testrunner.BaseTestRunner.runChild(BaseTestRunner.java:114)
    at com.weenergies.cs.unittest.testrunner.CsTestRunner.runChild(CsTestRunner.java:87)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at com.weenergies.cs.unittest.testrunner.BaseTestRunner.run(BaseTestRunner.java:46)
    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 know the table is there, I can query it, view , updated it from other tools.

Thanks


------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: DBUnit on Sybase Views

Matthias Gommeringer
Hi there,

if it is a db view try to configure dbunit as follows:

dbUnitConnection.getConfig().setProperty(DatabaseConfig.DEFAULT_TABLE_TYPE, {"TABLE","VIEW"});

then views should also be visible to dbunit.

regards,
matthias

> -----Ursprüngliche Nachricht-----
> Von: <[hidden email]>
> Gesendet: 26.06.09 18:58:15
> An: [hidden email]
> Betreff: Re: [dbunit-user] DBUnit on Sybase Views


> I am having issues with using DBUnit to load data into a Sybase view.
> I know my test works, it works great if the view is a table in the
> database.
>
> When I run it against the view Sybase instance, I get"
>
> org.dbunit.dataset.NoSuchTableException: cu02tb01
>  at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSe
> t.java:279)
>  at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.
> java:109)
>  at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.
> java:79)
>  at org.dbunit.AbstractDatabaseTester.executeOperation(AbstractDatabase
> Tester.java:190)
>  at org.dbunit.AbstractDatabaseTester.onSetup(AbstractDatabaseTester.
> java:103)
>  at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:156)
>  at com.weenergies.cs.unittest.testcase.DbUnitTestCase.setUp(
> DbUnitTestCase.java:78)
>  at com.weenergies.cs.unittest.testcase.PersistenceTestCase.
> setUpPersistence(PersistenceTestCase.java:131)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
> l.java:39)
>  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
> essorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:597)
>  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:44)
>  at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:15)
>  at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:41)
>  at org.junit.internal.runners.statements.RunBefores.evaluate(
> RunBefores.java:27)
>  at org.junit.internal.runners.statements.RunAfters.evaluate(
> RunAfters.java:31)
>  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassR
> unner.java:70)
>  at com.weenergies.cs.unittest.testrunner.BaseTestRunner.runChild(
> BaseTestRunner.java:114)
>  at com.weenergies.cs.unittest.testrunner.CsTestRunner.runChild(
> CsTestRunner.java:87)
>  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassR
> unner.java:44)
>  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
>  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
>  at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
>  at org.junit.internal.runners.statements.RunBefores.evaluate(
> RunBefores.java:28)
>  at org.junit.internal.runners.statements.RunAfters.evaluate(
> RunAfters.java:31)
>  at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>  at com.weenergies.cs.unittest.testrunner.BaseTestRunner.run(
> BaseTestRunner.java:46)
>  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 know the table is there, I can query it, view , updated it from
> other tools.
>
> Thanks
>
> ----------------------------------------------------------------------
> --------_______________________________________________ dbunit-user
> mailing list [hidden email] https://lists.
>
> sourceforge.net/lists/listinfo/dbunit-user


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user