persistence@glassfish.java.net

Re: Proposal for enhancing EPT testing environment

From: Tom Ware <tom.ware_at_oracle.com>
Date: Mon, 18 Dec 2006 10:23:33 -0500

Hi Wonseok,

  I think both your proposal and your changes look good.

-Tom

Wonseok Kim wrote:

> Hi All,
> While I play with EPT(entity-persistence-tests), I found some ways to
> enhance it and I did some job.
>
> Please review my below enhancements with attached patch.
>
> * Run test with another DB properties without rebuilding
> Database properties are separated from build.properties and stored in
> test.properties file.
> We can modify the test.properties file directly or use another
> properties file by -Dtest.properties option for ant.
>
> This makes really easy to run test on different databases.
> For example if we would like to run test with another database
> properties, do as follows:
> $ ant -Dtest.properties=derby.properties test //test on Derby
> $ ant -Dtest.properties=oracle.properties test //test on Oracle
>
> To make this possible the properties file is read from testing
> framework(JUnitTestCase) in runtime and they override the properties
> which is passed to creatEntityManagerFactory(pu, properties).
> So we don't need to put these properties in persistence.xml files and
> replace it in build time, it is done now in runtime. "ant build" is
> not any more dependent on properties file, so it doesn't need to
> rebuild for another database properties.
>
> I put derby database properties in test.properties for default
> configuration.
> This makes beginners quick to run test out of the box with bundled
> JavaDB.
>
> * Run a single test class
> To run a single test class, -Dtest.class option can be used.
>
> For example,
> $ ant
> -Dtest.class=oracle.toplink.essentials.testing.tests.ejb.ejbqltesting.JUnitEJBQLDateTimeTestSuite
> test
>
> * Log level without modifying persistence.xml files
> test.properties file can contain toplink.logging.level property and
> this will override the persistence.xml property.
> This is handy in debugging case.
>
> The junit ant task in build.xml now contains maxmemory="256m" because
> it threw OutOfMemoryError if log level is FINEST.
>
> I think that this patch is useful for others as well as for me. What
> do you think?
>
> Regards,
> -Wonseok
>

-- 
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com