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
This commit is contained in:
Jeremy Bauer 2012-02-22 22:46:51 +00:00
parent 1cb2f10f6e
commit 103aa4ffc0
10 changed files with 48 additions and 1 deletions

View File

@ -86,6 +86,11 @@ public abstract class LockScopeTestCase extends SQLListenerTestCase {
protected Map<String, Object> normalProps; protected Map<String, Object> normalProps;
protected Map<String, Object> extendedProps; protected Map<String, Object> extendedProps;
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
protected void commonSetUp(Class<?>... eClasses ) { protected void commonSetUp(Class<?>... eClasses ) {
normalProps = new HashMap<String, Object>(); normalProps = new HashMap<String, Object>();
extendedProps = new HashMap<String, Object>(); extendedProps = new HashMap<String, Object>();

View File

@ -81,6 +81,11 @@ public abstract class SequencedActionsTest extends SQLListenerTestCase {
private String empTableName; private String empTableName;
private List<TestThread> threads = null; private List<TestThread> threads = null;
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
protected void commonSetUp() { protected void commonSetUp() {
empTableName = getMapping(LockEmployee.class).getTable().getFullName(); empTableName = getMapping(LockEmployee.class).getTable().getFullName();

View File

@ -32,6 +32,11 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase;
public class TestLocking extends SQLListenerTestCase { public class TestLocking extends SQLListenerTestCase {
String _phone = "5075555555"; String _phone = "5075555555";
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
super.setUp(CLEAR_TABLES, Person.class, PhoneNumber.class super.setUp(CLEAR_TABLES, Person.class, PhoneNumber.class
// ,"openjpa.Log", "SQL=trace" // ,"openjpa.Log", "SQL=trace"

View File

@ -24,6 +24,12 @@ import javax.persistence.LockModeType;
* Test JPA 2.0 em.lock(LockMode) basic behaviors with "mixed" lock manager. * Test JPA 2.0 em.lock(LockMode) basic behaviors with "mixed" lock manager.
*/ */
public class TestMixedLockManagerLockBasic extends SequencedActionsTest { public class TestMixedLockManagerLockBasic extends SequencedActionsTest {
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
setUp(LockEmployee.class setUp(LockEmployee.class
, "openjpa.LockManager", "mixed" , "openjpa.LockManager", "mixed"

View File

@ -26,6 +26,12 @@ import javax.persistence.LockModeType;
* Test JPA 2.0 LockMode type permutation behaviors with "mixed" lock manager. * Test JPA 2.0 LockMode type permutation behaviors with "mixed" lock manager.
*/ */
public class TestMixedLockManagerLockPermutation extends SequencedActionsTest { public class TestMixedLockManagerLockPermutation extends SequencedActionsTest {
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
setUp(LockEmployee.class setUp(LockEmployee.class
, "openjpa.LockManager", "mixed" , "openjpa.LockManager", "mixed"

View File

@ -34,6 +34,11 @@ public class TestMixedLockManagerNonVersion extends SQLListenerTestCase {
private String empTableName; private String empTableName;
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
setUp(LockEmployeeNonVersion.class setUp(LockEmployeeNonVersion.class
, "openjpa.LockManager", "mixed" , "openjpa.LockManager", "mixed"

View File

@ -40,6 +40,11 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase;
public class TestNamedQueryLockMode extends SQLListenerTestCase { public class TestNamedQueryLockMode extends SQLListenerTestCase {
String lockClause = "FOR UPDATE"; String lockClause = "FOR UPDATE";
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
super.setUp(CLEAR_TABLES, LockEmployee.class, super.setUp(CLEAR_TABLES, LockEmployee.class,
"openjpa.LockManager", "pessimistic", "openjpa.LockManager", "pessimistic",

View File

@ -35,6 +35,11 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase;
public class TestOptimisticNamedQueryLockMode extends SQLListenerTestCase { public class TestOptimisticNamedQueryLockMode extends SQLListenerTestCase {
String lockClause = "FOR UPDATE"; String lockClause = "FOR UPDATE";
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
super.setUp(CLEAR_TABLES, LockEmployee.class, super.setUp(CLEAR_TABLES, LockEmployee.class,
"openjpa.LockManager", "pessimistic" "openjpa.LockManager", "pessimistic"

View File

@ -56,6 +56,11 @@ public class TestPessimisticLocks extends SQLListenerTestCase {
private DBDictionary dict = null; private DBDictionary dict = null;
private int lockWaitTime = 2000; private int lockWaitTime = 2000;
@Override
protected String getPersistenceUnitName() {
return "locking-test";
}
public void setUp() { public void setUp() {
// Disable tests for any DB that has supportsQueryTimeout==false, like Postgres // Disable tests for any DB that has supportsQueryTimeout==false, like Postgres
OpenJPAEntityManagerFactorySPI tempEMF = emf; OpenJPAEntityManagerFactorySPI tempEMF = emf;

View File

@ -20,7 +20,7 @@
<persistence xmlns="http://java.sun.com/xml/ns/persistence" <persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0"> version="1.0">
<persistence-unit name="test"> <persistence-unit name="locking-test">
<properties> <properties>
<!-- <!--
These properties are instead passed via System properties These properties are instead passed via System properties