You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Knut Anders Hatlen <Kn...@Sun.COM> on 2006/03/27 08:40:32 UTC
JUnit tests and data sources
Hi,
I am writing a JUnit test and need to get access to DataSource,
XADataSource and ConnectionPoolDataSource. My plan is to add
get*DataSource() methods to BaseJDBCTestCase, for instance:
- getDataSource(Properties attrs) which just invokes
TestUtil.getDataSource(Properties)
- getDataSource() which returns a DataSource with host/port/database
set to default values specified by the test harness
- getXADataSource, getConnectionPoolDataSource following the same
pattern
Does this plan sound OK?
--
Knut Anders
Re: JUnit tests and data sources
Posted by Andreas Korneliussen <An...@Sun.COM>.
Knut Anders Hatlen wrote:
> Hi,
>
> I am writing a JUnit test and need to get access to DataSource,
> XADataSource and ConnectionPoolDataSource. My plan is to add
> get*DataSource() methods to BaseJDBCTestCase, for instance:
>
> - getDataSource(Properties attrs) which just invokes
> TestUtil.getDataSource(Properties)
>
> - getDataSource() which returns a DataSource with host/port/database
> set to default values specified by the test harness
>
> - getXADataSource, getConnectionPoolDataSource following the same
> pattern
>
> Does this plan sound OK?
>
I think this plan is OK, since you are adding methods which clearly
belong to the BaseJDBCTestCase class. How you implement these methods,
is not my main concern at this point, however I will review the changes
if you like.
-- Andreas