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> 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>();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue