mirror of https://github.com/apache/openjpa.git
OPENJPA-1374 The @DatabasePlatform no longer works, as Derby will always be on the classpath. Switching 3 junits over to use setSupportedDatabases() in their setUp() routines instead....
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@901419 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
acafc94a5e
commit
5a0b97302b
|
@ -27,6 +27,7 @@ import javax.persistence.Persistence;
|
||||||
import org.apache.openjpa.conf.OpenJPAConfiguration;
|
import org.apache.openjpa.conf.OpenJPAConfiguration;
|
||||||
import org.apache.openjpa.enhance.TestEnhancementWithMultiplePUs;
|
import org.apache.openjpa.enhance.TestEnhancementWithMultiplePUs;
|
||||||
import org.apache.openjpa.jdbc.schema.DataSourceFactory;
|
import org.apache.openjpa.jdbc.schema.DataSourceFactory;
|
||||||
|
import org.apache.openjpa.jdbc.sql.DerbyDictionary;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
|
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
|
||||||
import org.apache.openjpa.persistence.OpenJPAPersistence;
|
import org.apache.openjpa.persistence.OpenJPAPersistence;
|
||||||
import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
|
import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
|
||||||
|
@ -49,10 +50,7 @@ import junit.framework.TestCase;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Specifies that the test runs only if the driver is available in the
|
|
||||||
// execution classpath
|
|
||||||
@DatabasePlatform("org.apache.derby.jdbc.EmbeddedDriver")
|
@DatabasePlatform("org.apache.derby.jdbc.EmbeddedDriver")
|
||||||
|
|
||||||
public class TestEquivalentConfiguration extends SingleEMFTestCase {
|
public class TestEquivalentConfiguration extends SingleEMFTestCase {
|
||||||
private EntityManagerFactory emf;
|
private EntityManagerFactory emf;
|
||||||
|
|
||||||
|
@ -97,6 +95,13 @@ public class TestEquivalentConfiguration extends SingleEMFTestCase {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
// Only run on Derby
|
||||||
|
setSupportedDatabases(
|
||||||
|
org.apache.openjpa.jdbc.sql.DerbyDictionary.class);
|
||||||
|
if (isTestsDisabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_system = backup();
|
_system = backup();
|
||||||
clear(_system);
|
clear(_system);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
|
||||||
|
import org.apache.openjpa.jdbc.sql.DerbyDictionary;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
import org.apache.openjpa.persistence.OpenJPAPersistence;
|
import org.apache.openjpa.persistence.OpenJPAPersistence;
|
||||||
import org.apache.openjpa.persistence.test.AllowFailure;
|
import org.apache.openjpa.persistence.test.AllowFailure;
|
||||||
|
@ -43,19 +44,25 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase;
|
||||||
* @author Pinaki Poddar
|
* @author Pinaki Poddar
|
||||||
* @author Michael Vorburger
|
* @author Michael Vorburger
|
||||||
*/
|
*/
|
||||||
// Because we use DDL specific to Derby
|
|
||||||
@DatabasePlatform("org.apache.derby.jdbc.EmbeddedDriver")
|
|
||||||
|
|
||||||
|
@DatabasePlatform("org.apache.derby.jdbc.EmbeddedDriver")
|
||||||
public class TestCompundIdWithNull extends SingleEMFTestCase {
|
public class TestCompundIdWithNull extends SingleEMFTestCase {
|
||||||
private static boolean tablesCreated = false;
|
private static boolean tablesCreated = false;
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
// Only run on Derby because we use DDL specific to Derby
|
||||||
|
setSupportedDatabases(
|
||||||
|
org.apache.openjpa.jdbc.sql.DerbyDictionary.class);
|
||||||
|
if (isTestsDisabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// do not use CLEAR_TABLES or DROP_TABLES
|
// do not use CLEAR_TABLES or DROP_TABLES
|
||||||
super.setUp(SimpleCompoundIdTestEntity.class, ComplexCompoundIdTestEntity.class, TypeEntity.class);
|
super.setUp(SimpleCompoundIdTestEntity.class, ComplexCompoundIdTestEntity.class, TypeEntity.class);
|
||||||
if (!tablesCreated) {
|
if (!tablesCreated) {
|
||||||
createTables(emf.createEntityManager());
|
createTables(emf.createEntityManager());
|
||||||
tablesCreated = true;
|
tablesCreated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleCompoundIdTestEntity() throws Exception {
|
public void testSimpleCompoundIdTestEntity() throws Exception {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceException;
|
import javax.persistence.PersistenceException;
|
||||||
import javax.persistence.Query;
|
import javax.persistence.Query;
|
||||||
|
|
||||||
|
import org.apache.openjpa.jdbc.sql.OracleDictionary;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
|
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
|
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
|
||||||
import org.apache.openjpa.persistence.test.DatabasePlatform;
|
import org.apache.openjpa.persistence.test.DatabasePlatform;
|
||||||
|
@ -47,6 +48,13 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase;
|
||||||
public class TestAutoIncrement extends SingleEMFTestCase {
|
public class TestAutoIncrement extends SingleEMFTestCase {
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
// Only run on Oracle
|
||||||
|
setSupportedDatabases(
|
||||||
|
org.apache.openjpa.jdbc.sql.OracleDictionary.class);
|
||||||
|
if (isTestsDisabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ("testAutoIncrementIdentityWithNamedSequence".equals(getName())) {
|
if ("testAutoIncrementIdentityWithNamedSequence".equals(getName())) {
|
||||||
String sequence = "autoIncrementSequence";
|
String sequence = "autoIncrementSequence";
|
||||||
createSequence(sequence);
|
createSequence(sequence);
|
||||||
|
|
Loading…
Reference in New Issue