From 103aa4ffc0ea149de21dbc13596e1ea31d3ff831 Mon Sep 17 00:00:00 2001 From: Jeremy Bauer Date: Wed, 22 Feb 2012 22:46:51 +0000 Subject: [PATCH] OPENJPA-2140 Update locking tests to use a unique pu name git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1292564 13f79535-47bb-0310-9956-ffa450edef68 --- .../persistence/lock/extended/LockScopeTestCase.java | 5 +++++ .../openjpa/persistence/lockmgr/SequencedActionsTest.java | 5 +++++ .../org/apache/openjpa/persistence/lockmgr/TestLocking.java | 5 +++++ .../persistence/lockmgr/TestMixedLockManagerLockBasic.java | 6 ++++++ .../lockmgr/TestMixedLockManagerLockPermutation.java | 6 ++++++ .../persistence/lockmgr/TestMixedLockManagerNonVersion.java | 5 +++++ .../openjpa/persistence/lockmgr/TestNamedQueryLockMode.java | 5 +++++ .../lockmgr/TestOptimisticNamedQueryLockMode.java | 5 +++++ .../openjpa/persistence/lockmgr/TestPessimisticLocks.java | 5 +++++ .../src/test/resources/META-INF/persistence.xml | 2 +- 10 files changed, 48 insertions(+), 1 deletion(-) diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java index 4e8cc9b51..40b01e530 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java @@ -86,6 +86,11 @@ public abstract class LockScopeTestCase extends SQLListenerTestCase { protected Map normalProps; protected Map extendedProps; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + protected void commonSetUp(Class... eClasses ) { normalProps = new HashMap(); extendedProps = new HashMap(); diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java index 7a8328fcc..227d05658 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java @@ -81,6 +81,11 @@ public abstract class SequencedActionsTest extends SQLListenerTestCase { private String empTableName; private List threads = null; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + @SuppressWarnings("deprecation") protected void commonSetUp() { empTableName = getMapping(LockEmployee.class).getTable().getFullName(); diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestLocking.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestLocking.java index 47812e9c1..a943613c3 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestLocking.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestLocking.java @@ -32,6 +32,11 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase; public class TestLocking extends SQLListenerTestCase { String _phone = "5075555555"; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { super.setUp(CLEAR_TABLES, Person.class, PhoneNumber.class // ,"openjpa.Log", "SQL=trace" diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockBasic.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockBasic.java index c4b7f3401..9e35176d4 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockBasic.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockBasic.java @@ -24,6 +24,12 @@ import javax.persistence.LockModeType; * Test JPA 2.0 em.lock(LockMode) basic behaviors with "mixed" lock manager. */ public class TestMixedLockManagerLockBasic extends SequencedActionsTest { + + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { setUp(LockEmployee.class , "openjpa.LockManager", "mixed" diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java index ee6993e86..b16ade868 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java @@ -26,6 +26,12 @@ import javax.persistence.LockModeType; * Test JPA 2.0 LockMode type permutation behaviors with "mixed" lock manager. */ public class TestMixedLockManagerLockPermutation extends SequencedActionsTest { + + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { setUp(LockEmployee.class , "openjpa.LockManager", "mixed" diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerNonVersion.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerNonVersion.java index ee09162cd..02b67fcf4 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerNonVersion.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerNonVersion.java @@ -34,6 +34,11 @@ public class TestMixedLockManagerNonVersion extends SQLListenerTestCase { private String empTableName; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { setUp(LockEmployeeNonVersion.class , "openjpa.LockManager", "mixed" diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestNamedQueryLockMode.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestNamedQueryLockMode.java index 54ee89da6..7b7b41d9a 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestNamedQueryLockMode.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestNamedQueryLockMode.java @@ -40,6 +40,11 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase; public class TestNamedQueryLockMode extends SQLListenerTestCase { String lockClause = "FOR UPDATE"; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { super.setUp(CLEAR_TABLES, LockEmployee.class, "openjpa.LockManager", "pessimistic", diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestOptimisticNamedQueryLockMode.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestOptimisticNamedQueryLockMode.java index d6d437da1..185e87755 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestOptimisticNamedQueryLockMode.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestOptimisticNamedQueryLockMode.java @@ -35,6 +35,11 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase; public class TestOptimisticNamedQueryLockMode extends SQLListenerTestCase { String lockClause = "FOR UPDATE"; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { super.setUp(CLEAR_TABLES, LockEmployee.class, "openjpa.LockManager", "pessimistic" diff --git a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestPessimisticLocks.java b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestPessimisticLocks.java index a74ac6849..e74d213f3 100644 --- a/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestPessimisticLocks.java +++ b/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestPessimisticLocks.java @@ -56,6 +56,11 @@ public class TestPessimisticLocks extends SQLListenerTestCase { private DBDictionary dict = null; private int lockWaitTime = 2000; + @Override + protected String getPersistenceUnitName() { + return "locking-test"; + } + public void setUp() { // Disable tests for any DB that has supportsQueryTimeout==false, like Postgres OpenJPAEntityManagerFactorySPI tempEMF = emf; diff --git a/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml b/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml index 6cf99a7d3..e05423146 100644 --- a/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml +++ b/openjpa-persistence-locking/src/test/resources/META-INF/persistence.xml @@ -20,7 +20,7 @@ - +