mirror of https://github.com/apache/openjpa.git
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:
parent
1cb2f10f6e
commit
103aa4ffc0
|
@ -86,6 +86,11 @@ public abstract class LockScopeTestCase extends SQLListenerTestCase {
|
|||
protected Map<String, Object> normalProps;
|
||||
protected Map<String, Object> extendedProps;
|
||||
|
||||
@Override
|
||||
protected String getPersistenceUnitName() {
|
||||
return "locking-test";
|
||||
}
|
||||
|
||||
protected void commonSetUp(Class<?>... eClasses ) {
|
||||
normalProps = new HashMap<String, Object>();
|
||||
extendedProps = new HashMap<String, Object>();
|
||||
|
|
|
@ -81,6 +81,11 @@ public abstract class SequencedActionsTest extends SQLListenerTestCase {
|
|||
private String empTableName;
|
||||
private List<TestThread> threads = null;
|
||||
|
||||
@Override
|
||||
protected String getPersistenceUnitName() {
|
||||
return "locking-test";
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void commonSetUp() {
|
||||
empTableName = getMapping(LockEmployee.class).getTable().getFullName();
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
version="1.0">
|
||||
<persistence-unit name="test">
|
||||
<persistence-unit name="locking-test">
|
||||
<properties>
|
||||
<!--
|
||||
These properties are instead passed via System properties
|
||||
|
|
Loading…
Reference in New Issue