db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: JUnit problem
Date Tue, 04 Dec 2007 20:15:08 GMT
Dyre.Tjeldvoll@Sun.COM wrote:
> Hi,
> 
> I'm trying to create some test cases that only will be run when using
> DerbyNetClient. This is what I do:
> 
>     private static Test baseSuite(String name) {
>         TestSuite suite = new TestSuite(name);
> 
>         suite.addTestSuite(StatementJdbc30Test.class);
> 
>         if  (usingDerbyNetClient()) {
>             // These test CAN be run in embedded mode as well, but
>             // they're only meaningful in c/s mode and also take quite
>             // a bit of time to run.
>             suite.addTest(new StatementJdbc30Test
>                           ("xtestMultiExecWithQueryTimeout"));
>             suite.addTest(new StatementJdbc30Test
>                           ("xtestMaxOpenStatementsWithQueryTimeout"));
>         }
> 
>         return new CleanDatabaseTestSetup(suite) { 
> 
> ...
> 
> But when I run StatementJdbc30Test I don't see the x-test cases being
> run. If comment out  "if  (usingDerbyNetClient()) {" the testcases run just
> fine (in both frameworks), so it would seem that the predicate is not
> doing what I expect. Does anyone know what I'm missing here?
> 

Does this help:

http://wiki.apache.org/db-derby/DerbyJunitTestConfiguration

Basically you need to define in the suite method how you want your test 
fixtures to be run. There is no outside agent at setup time saying it's 
running in "client" or "embedded" mode.

Once a fixture is running, then the usingDerbyNetClient() methods make 
sense, they indicate a fixture is running in that mode.

Dan.

Mime
View raw message