mirror of https://github.com/apache/openjpa.git
Fix TestMultipleSchemaNames so that schemas are created on PostgreSQL
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@885965 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc7da97658
commit
583a6366fc
|
@ -38,15 +38,13 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase;
|
|||
|
||||
public class TestMultipleSchemaNames extends SingleEMFTestCase {
|
||||
|
||||
static private DBDictionary dict = null;
|
||||
|
||||
public void setUp() {
|
||||
// Need to skip tests on MySQL, Oracle and MS SQL Server
|
||||
// See createSchemas() comment at the bottom
|
||||
setUnsupportedDatabases(
|
||||
org.apache.openjpa.jdbc.sql.MySQLDictionary.class,
|
||||
org.apache.openjpa.jdbc.sql.OracleDictionary.class,
|
||||
org.apache.openjpa.jdbc.sql.SQLServerDictionary.class);
|
||||
MySQLDictionary.class,
|
||||
OracleDictionary.class,
|
||||
SQLServerDictionary.class);
|
||||
if (isTestsDisabled()) {
|
||||
// getLog().trace("TestMultipleSchemaNames() - Skipping all tests - Not supported on this DB");
|
||||
return;
|
||||
|
@ -419,13 +417,15 @@ public class TestMultipleSchemaNames extends SingleEMFTestCase {
|
|||
* we give up as they treat schemas in special ways.
|
||||
*/
|
||||
private void createSchemas() {
|
||||
OpenJPAEntityManagerFactorySPI tempEmf = createEMF();
|
||||
DBDictionary dict = ((JDBCConfiguration) tempEmf.getConfiguration()).getDBDictionaryInstance();
|
||||
|
||||
if (!(dict instanceof PostgresDictionary)) {
|
||||
closeEMF(tempEmf);
|
||||
return;
|
||||
}
|
||||
|
||||
OpenJPAEntityManagerFactorySPI emf = createEMF();
|
||||
OpenJPAEntityManagerSPI em = emf.createEntityManager();
|
||||
OpenJPAEntityManagerSPI em = tempEmf.createEntityManager();
|
||||
String[] schemas =
|
||||
{ "SCHEMA1", "SCHEMA2", "SCHEMA3", "SCHEMA3G", "SCHEMA4G" };
|
||||
for (String schema : schemas) {
|
||||
|
@ -438,7 +438,7 @@ public class TestMultipleSchemaNames extends SingleEMFTestCase {
|
|||
em.getTransaction().rollback();
|
||||
}
|
||||
}
|
||||
closeEMF(emf);
|
||||
closeEMF(tempEmf);
|
||||
}
|
||||
|
||||
} // end of TestMultipleSchemaNames
|
||||
|
|
Loading…
Reference in New Issue