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 15:37:35 GMT
Just want to tell that I've solved 4.) so You do not have to spend time 
with it. I have not committed nor roll backed a transaction, thus the 
connection was not closed correctly when the test was run using the 
first test configuration.

Cheers

Julo

Julius Stroffek wrote:
> 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
> testMultipleConenctions(org.apache.derbyTesting.functionTests.tests.extra.DRDAProtocolTest)java.sql.SQLException:

> Invalid transaction state.
>        at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)

>
>        ...
> testMultipleConenctions(org.apache.derbyTesting.functionTests.tests.extra.DRDAProtocolTest)java.sql.SQLException:

> A lock could not be obtaine d within the time requested
>        at 
> org.apache.derby.client.am.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:46)

>
>        ...
> Caused by: org.apache.derby.client.am.SqlException: A lock could not 
> be obtained within the time requested
>        at 
> org.apache.derby.client.am.Statement.completeSqlca(Statement.java:1713)
>        ...
>        ... 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();
>        suite.addTestSuite(DRDAProtocolTest.class);
>        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.
>
> Cheers
>
> Julo

Mime
View raw message