db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julius Stroffek <Julius.Strof...@Sun.COM>
Subject Re: Adding a new test
Date Fri, 03 Nov 2006 14:31:21 GMT
Hi All,

Daniel John Debrunner wrote:
> Sounds good, though if you have time looking at converting the 
> existing test to JUnit would be beneficial for the community. Then you 
> would be coming up to speed on the standard way rather than the old 
> testing mechanism.
Yes, I may do some work on converting tests to junit (also for DRDA 
protocol). However I'm new to derby testing and I am just exploring it. 
I have several questions related to tests. Sorrry, If some of those are 
stupid... ;-)

1.) The best way to run testing is to simply execute only one ant target 
like (or more target for each set of tests like regression tests, 
performance tests, etc.)
 > ant runtests

Are we going to reach this kind of test execution?

2.) As I understand it correctly the old harness tests and new junit 
tests are kept in same directories. It is a bit confusing to me, I think 
that it might be for other people as well. I down know what is a part of 
which testing framework, which files are obsoleted, etc. Yes, of course, 
it is possible to find it in a code but it takes much more time.

3.) How one can easily recognize that this and that test was already 
converted to junit? If I see a file currentSchema.sql, how could I 
recognize that it is used in junit or the old harness? Would it be 
possible to take out new junit tests to another package - something like 
"org.apache.derby.testing.junit" or similar? Does this make sense?

4.) I have written a test described in previous email (in the same 
thread) and I was trying to run it as part of 
org.apache.derbyTesting.functionTests.suites.All suite with the default 
TestConfiguration. The suite method of the DRDAProtocolTest class looks as

    public static Test suite() {
        return TestConfiguration.defaultSuite(DRDAProtocolTest.class);

And during execution the following exception is thrown

Invalid transaction state.

A lock could not be obtaine d within the time requested
Caused by: org.apache.derby.client.am.SqlException: A lock could not be 
obtained within the time requested
        ... 37 more

It is because the location of the databases for both embedded and 
derbynet test configurations are same.
I may use prefixes for tables and check 
usingEbedded/usingDerbyNet/usingDerbyNetClient and for each one choose a 
different prefix. Yes, this works but I don't like it.

If I will use (as I found in all other tests I went through)

    public static Test suite()
        TestSuite suite = new TestSuite();
        return suite;

The test is executed only in embedded test configuration.

How can I run a test easily in multiple test configurations?

Thank you very much for any response.



View raw message