mirror of
https://github.com/apache/openjpa.git
synced 2025-02-21 17:45:51 +00:00
updated getLog() methods and switched testcase to use setUnsupportedDatabases()
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@813519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8e96965225
commit
0d3179cef9
@ -43,24 +43,12 @@ public class TestMultipleSchemaNames extends SingleEMFTestCase {
|
||||
public void setUp() {
|
||||
// Need to skip tests on MySQL, Oracle and MS SQL Server
|
||||
// See createSchemas() comment at the bottom
|
||||
if (dict == null) {
|
||||
OpenJPAEntityManagerFactorySPI emf = createEMF();
|
||||
OpenJPAEntityManagerSPI em = emf.createEntityManager();
|
||||
JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
|
||||
dict = conf.getDBDictionaryInstance();
|
||||
|
||||
if ((dict instanceof MySQLDictionary) ||
|
||||
(dict instanceof OracleDictionary) ||
|
||||
(dict instanceof SQLServerDictionary)) {
|
||||
setTestsDisabled(true);
|
||||
// do some logging
|
||||
emf.getConfiguration().getLog("Tests").trace(
|
||||
"TestMultipleSchemaNames() - Skipping all tests - Not supported on this DB");
|
||||
}
|
||||
closeEMF(emf);
|
||||
}
|
||||
|
||||
setUnsupportedDatabases(
|
||||
org.apache.openjpa.jdbc.sql.MySQLDictionary.class,
|
||||
org.apache.openjpa.jdbc.sql.OracleDictionary.class,
|
||||
org.apache.openjpa.jdbc.sql.SQLServerDictionary.class);
|
||||
if (isTestsDisabled()) {
|
||||
getLog().trace("TestMultipleSchemaNames() - Skipping all tests - Not supported on this DB");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -206,6 +206,19 @@ public abstract class SingleEMFTestCase
|
||||
}
|
||||
|
||||
protected Log getLog() {
|
||||
return emf.getConfiguration().getLog("Tests");
|
||||
return getLog("Tests");
|
||||
}
|
||||
|
||||
protected Log getLog(String s) {
|
||||
OpenJPAEntityManagerFactorySPI tempEMF = emf;
|
||||
if (tempEMF == null) {
|
||||
tempEMF = createEMF();
|
||||
}
|
||||
Log log = emf.getConfiguration().getLog(s);
|
||||
if (emf == null) {
|
||||
closeEMF(tempEMF);
|
||||
}
|
||||
return log;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user