db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew McIntyre" <mcintyr...@gmail.com>
Subject Re: refs to org.apache.derby.jdbc in jdbc tests?
Date Thu, 06 Jul 2006 05:06:23 GMT
On 7/5/06, Ray Kiddy <kiddyr@apple.com> wrote:
> I was expecting that the tests for Derby's JDBC compliance (in java/
> testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/) would
> not need to have any references to any of the classes which actually
> implement Derby's version of the JDBC API.
> </snip>
> This seems to be as it should be. but I also see this in java/testing/
> org/apache/derbyTesting/functionTests/tests/jdbcapi/xaJNDI.java:
>         package org.apache.derbyTesting.functionTests.tests.jdbcapi;
>         import org.apache.derby.jdbc.EmbeddedDataSource;
>         import org.apache.derby.jdbc.EmbeddedXADataSource;
> I was wondering if this was deliberate, or if it is just something
> that crept into the code. It seems wrong.
> I have jdbc tests and I actually use them for multiple drivers. I
> just initialize the tests with different JDBC URLs and have
> properties for some constants that need to get checked.
> Even if this test suite is just for derby, being able to run against
> other drivers would validate the JDBC API conformance testing.
> Was there a reason for referring to the specific implementation
> classes in the tests?

In the test you mentioned, xaJNDI.java, the test verifies that the
specific DataSource instance returned from JNDI is the same instance
that was bound to (a fake) JNDI DN. It is necessary for the test to
hold a direct reference to the instance which was bound to the DN in
order to test for the equality of the reference that is returned from
JNDI. So yes, I think it was deliberate.

The other tests that directly reference Derby's DataSource
implementations bypass the JNDI lookup and just test the functionality
that a Derby DataSource object should have. Since we're only
interested in how Derby's DataSources behave, that seems reasonable to

I'm not especially familiar with these particular tests, so others may
have more insight into their design and behavior.


View raw message