Myrna van Lunteren wrote:
Hi,

As I was poking at the DataSourceTest recently, I noticed it doesn't
run with JSR169.
I wondered if it would make sense to make a minimalized version -
either to be extended by the DataSourceTest or to be run with JSR169
only.
I played with the idea some and am attaching a patch that has the
tests that *can* run with JSR169. The tests left are:
 - testJira95ds
 - testBadConnectionAttributeSyntax
 - a minimalized version of testAllDataSources,
 - a minimalized version of testDSRequestAuthentication (so minimized
   it doesn't actually do authentication)
 - a minimalized version of testDescriptionProperty
The minimalizing meant removing any reference to DriverManager,
PooledConnectionDataSources, XADataSources, setTypeMap and
setAttributeAsPassword and (most references to) client/server.

I wonder if this test actually adds anything of value, or that we're
really testing this with other tests already run?

Since DataSource is the only connection mechanism for JSR169 it seems wise that as much testing as possible is performed for J2ME of data sources.

I think you are on the correct path, a data source test that runs as much as possible against J2ME and then additional testing in J2SE/J2EE.

For Junit tests having one test extend the other doesn't make much sense, instead I think three test classes could exist.

SimpleDataSourceTest - tests for functionality that EmbeddedSimpleDataSource and EmbeddedDataSource have in common.

DataSourceTest - tests specific to ClientDataSource and EmbeddedSimpleDataSource

J2EEDataSourceTest - Testing of XA and connection pooling

It's possible the DataSourceTest and J2EEDataSourceTest  could be combined.

J2ME would run SimpleDataSourecTest only
J2SE/J2EE platforms would run all three classes.

Dan.

Reply via email to