db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Korneliussen <Andreas.Kornelius...@Sun.COM>
Subject Re: junit tests; get*DataSource* methods in BaseJDBCTestCase causing trouble...
Date Fri, 26 May 2006 08:47:38 GMT
Myrna van Lunteren wrote:
> Hi,
> With revision 389780 some methods were added into BaseJDBCTestCase.java:
> "DERBY-1157: Helper methods in BaseJDBCTestCase for creating data sources
> 
> Adding getDataSource(), getConnectionPoolDataSource() and
> getXADataSource() to BaseJDBCTestCase. The new methods call various
> methods in TestUtil for creating the data sources. A minor adjustment
> had to be made to TestUtil.getDataSource() in order to make it return
> JDBC 4.0 DataSources."
> 
> However, this causes trouble with the j9 jvms. So, I need to move
> these methods back out of BaseJDBCTestCase.
> 
> I can see 3 choices for their new home:
> 
> - util/TestConfiguration.java

I think TestConfiguration should be a placeholder for configuration data 
of the test, and not contain utility methods to get connections / 
datasources.

> - util/TestUtil.java
> - util/<a new utility class specially for junit tests but I cannot
> think of a good name>
> 
> My personal preference goes to TestUtil.java, but that looks like it
> is at cross purposes with the contribution of 389780. Any input?
> 

If you put it into a new utility class, I would propose the name 
"DataSourceFactory" or "TestDataSourceFactory", since it lets you create 
different DataSource objects. It also limits the scope of that utility 
class (TestUtil seems to be very generic in terms of what it can be used 
for).

Andreas

> Thx,
> 
> Myrna


Mime
View raw message