openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
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).

     setTestsDisabled(!dictionarySupportsXMLColumn());
     if (isTestsDisabled()) {
         return;
     }

- 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 -

     setUnsupportedDatabases(
         org.apache.openjpa.jdbc.sql.MySQLDictionary.class,
         org.apache.openjpa.jdbc.sql.OracleDictionary.class,
         org.apache.openjpa.jdbc.sql.SQLServerDictionary.class);
     if (isTestsDisabled()) {
         return;
     }


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.



-Donald

Mime
View raw message