openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <>
Subject New o-p-j TestCase methods
Date Thu, 10 Sep 2009 17:16:48 GMT
Some updates I just checked into trunk as r813506 and r813519 under 
openjpa-persistence-jdbc which should make writing and maintaining 
testcases easier...

For setUp() code (all can be used before super.setUp() is called):
- Added new protected methods of setTestsDisabled()/isTestsDisabled() in 
AbstractPersistenceTestCase which is used by runTest() to automatically 
skip all tests.  This keeps us from having to put our own if(skipTests) 
in each testXXX method for most cases (unless you need granular per test 
exclusion capabilities).

     if (isTestsDisabled()) {

- Added new setSupportedDatabases()/setUnsupportedDatabases() methods in 
SingleEMFTestCase to set the testsDisabled flag in 
AbstractPersistenceTestCase, which allows you to exclude all tests based 
on the DB platform being used -

     if (isTestsDisabled()) {

For general usage:
- Added a getLog() method in SingleEMFTestCase class for everyone to 
use, instead of having a copy in your own tests.  Also, you can now use 
logging before calling super.setUp(), as the getLog() will create a 
temporary EMF if needed.


View raw message