Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-11-18 04:22:22 -0500
committerEike Stepper2012-11-18 04:22:22 -0500
commitd882450136cc13a89c28a77e60f5eff87f4e8d89 (patch)
treea2739ca4bb8e3b9a019f2b9974bd8531bfa13c85
parent971f6d3a263c9bf5af11d4e3f69b12a6b898d480 (diff)
downloadcdo-d882450136cc13a89c28a77e60f5eff87f4e8d89.tar.gz
cdo-d882450136cc13a89c28a77e60f5eff87f4e8d89.tar.xz
cdo-d882450136cc13a89c28a77e60f5eff87f4e8d89.zip
Fix tests
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_377727_Test.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CompareTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SavePointTest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/XATransactionTest.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/defs/CDOViewDefImplTest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/FailoverTest.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayed2Test.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayedTest.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/revisioncache/AbstractCDORevisionCacheTest.java38
19 files changed, 155 insertions, 191 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java
index 2b904a0f0f..67c1e0a3f4 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java
@@ -21,7 +21,6 @@ import org.eclipse.emf.cdo.tests.offline.Bugzilla_328352_Test;
import org.eclipse.emf.cdo.tests.offline.Bugzilla_329014_Test;
import org.eclipse.emf.cdo.tests.offline.Bugzilla_376470_Test;
import org.eclipse.emf.cdo.tests.offline.Bugzilla_376566_Test;
-import org.eclipse.emf.cdo.tests.offline.Bugzilla_376567_Test;
import org.eclipse.emf.cdo.tests.offline.FailoverTest;
import org.eclipse.emf.cdo.tests.offline.OfflineDelayedTest;
import org.eclipse.emf.cdo.tests.offline.OfflineLockReplicationTest;
@@ -67,7 +66,6 @@ public class AllTestsDBH2Offline extends DBConfigs
testClasses.add(Bugzilla_319552_Test.class);
testClasses.add(Bugzilla_376470_Test.class);
testClasses.add(Bugzilla_376566_Test.class);
- testClasses.add(Bugzilla_376567_Test.class);
testClasses.add(Bugzilla_377727_Test.class);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java
index 255578d488..bc535b6e46 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java
@@ -21,7 +21,6 @@ import org.eclipse.emf.cdo.tests.offline.Bugzilla_328352_Test;
import org.eclipse.emf.cdo.tests.offline.Bugzilla_329014_Test;
import org.eclipse.emf.cdo.tests.offline.Bugzilla_376470_Test;
import org.eclipse.emf.cdo.tests.offline.Bugzilla_376566_Test;
-import org.eclipse.emf.cdo.tests.offline.Bugzilla_376567_Test;
import org.eclipse.emf.cdo.tests.offline.FailoverTest;
import org.eclipse.emf.cdo.tests.offline.OfflineDelayedTest;
import org.eclipse.emf.cdo.tests.offline.OfflineLockReplicationTest;
@@ -67,7 +66,6 @@ public class AllTestsDBMysqlOffline extends DBConfigs
testClasses.add(Bugzilla_319552_Test.class);
testClasses.add(Bugzilla_376470_Test.class);
testClasses.add(Bugzilla_376566_Test.class);
- testClasses.add(Bugzilla_376567_Test.class);
testClasses.add(Bugzilla_377727_Test.class);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_377727_Test.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_377727_Test.java
index cded43a4e0..032106e253 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_377727_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_377727_Test.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.AbstractSyncingTest;
import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig;
import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.OfflineConfig;
import org.eclipse.emf.cdo.tests.model1.Category;
@@ -26,21 +26,11 @@ import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.io.IOUtil;
-import java.util.Map;
-
/**
* @author Stefan Winkler
*/
-public class Bugzilla_377727_Test extends AbstractCDOTest
+public class Bugzilla_377727_Test extends AbstractSyncingTest
{
- @Override
- public synchronized Map<String, Object> getTestProperties()
- {
- Map<String, Object> testProperties = super.getTestProperties();
- testProperties.put(OfflineConfig.PROP_TEST_RAW_REPLICATION, Boolean.TRUE);
- return testProperties;
- }
-
@Requires(RepositoryConfig.CAPABILITY_OFFLINE)
@CleanRepositoriesBefore
public void testAsyncPackages() throws Exception
@@ -52,7 +42,6 @@ public class Bugzilla_377727_Test extends AbstractCDOTest
// disconnect clone from master
((OfflineConfig)getRepositoryConfig()).stopMasterTransport();
- ConcurrencyUtil.sleep(1000L);
while (getRepository().getState() == CDOCommonRepository.State.ONLINE)
{
ConcurrencyUtil.sleep(250L);
@@ -81,7 +70,7 @@ public class Bugzilla_377727_Test extends AbstractCDOTest
}
// reconnect clone and let sync
- IOUtil.OUT().println("=== reconnect clone ===");
+ IOUtil.OUT().println("=== Reconnect clone ===");
((OfflineConfig)getRepositoryConfig()).startMasterTransport();
while (getRepository().getState() != CDOCommonRepository.State.ONLINE)
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java
index e9cf28b036..84c4272353 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java
@@ -106,35 +106,45 @@ public abstract class AbstractSyncingTest extends AbstractCDOTest
return false;
}
- protected static void checkEvent(final TestListener listener, int newPackageUnits, int newObjects,
- int changedObjects, int detachedObjects) throws InterruptedException
+ protected static void checkEvent(final TestListener listener, final int newPackageUnits, final int newObjects,
+ final int changedObjects, final int detachedObjects) throws InterruptedException
{
- new PollingTimeOuter()
+ try
{
- @Override
- protected boolean successful()
- {
- IEvent[] events = listener.getEvents();
- return events.length >= 1;
- }
- }.assertNoTimeOut();
+ final int[] counts = { 0, 0, 0, 0 };
- IEvent[] events = listener.getEvents();
- IEvent event = events[0];
- if (event instanceof CDOSessionInvalidationEvent)
- {
- CDOSessionInvalidationEvent e = (CDOSessionInvalidationEvent)event;
- assertEquals(newPackageUnits, e.getNewPackageUnits().size());
- assertEquals(newObjects, e.getNewObjects().size());
- assertEquals(changedObjects, e.getChangedObjects().size());
- assertEquals(detachedObjects, e.getDetachedObjects().size());
+ new PollingTimeOuter()
+ {
+ @Override
+ protected boolean successful()
+ {
+ IEvent[] events = listener.getEvents();
+ for (IEvent event : events)
+ {
+ if (event instanceof CDOSessionInvalidationEvent)
+ {
+ CDOSessionInvalidationEvent e = (CDOSessionInvalidationEvent)event;
+ counts[0] += e.getNewPackageUnits().size();
+ counts[1] += e.getNewObjects().size();
+ counts[2] += e.getChangedObjects().size();
+ counts[3] += e.getDetachedObjects().size();
+ }
+ }
+
+ return counts[0] >= newPackageUnits && counts[1] >= newObjects && counts[2] >= changedObjects
+ && counts[3] >= detachedObjects;
+ }
+ }.assertNoTimeOut();
+
+ assertEquals(newPackageUnits, counts[0]);
+ assertEquals(newObjects, counts[1]);
+ assertEquals(changedObjects, counts[2]);
+ assertEquals(detachedObjects, counts[3]);
}
- else
+ finally
{
- fail("Invalid event: " + event);
+ listener.clearEvents();
}
-
- listener.clearEvents();
}
protected static void checkRevision(EObject object, InternalRepository repository, String location)
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java
index 0acc33df5f..a8b35c4336 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java
@@ -242,7 +242,7 @@ public class BackupTest extends AbstractCDOTest
}
// Add content from a new package
- CDOResource resource = transaction2.createResource("/r1");
+ CDOResource resource = transaction2.createResource(getResourcePath("/r1"));
resource.getContents().add(getModel3Factory().createPolygon());
transaction2.commit();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CompareTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CompareTest.java
index 6a681ddba0..7c8dfd091e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CompareTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CompareTest.java
@@ -175,7 +175,7 @@ public class CompareTest extends AbstractCDOTest
CDOBranch mainBranch = session.getBranchManager().getMainBranch();
CDOTransaction transaction = session.openTransaction(mainBranch);
- CDOResource resource = transaction.createResource("/res" + 0);
+ CDOResource resource = transaction.createResource(getResourcePath("/res" + 0));
EList<EObject> contents = resource.getContents();
addCompany(contents);
addCompany(contents);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java
index c0f2c4ef7a..92bdccb724 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ExternalReferenceTest.java
@@ -76,7 +76,7 @@ public class ExternalReferenceTest extends AbstractCDOTest
sessionA.getPackageRegistry().putEPackage(getModel4Package());
CDOTransaction transactionA1 = sessionA.openTransaction(resourceSet);
- CDOResource resA = transactionA1.createResource("/resA");
+ CDOResource resA = transactionA1.createResource(getResourcePath("/resA"));
Resource resD = resourceSet.createResource(URI.createURI("test://1"));
EPackage schoolPackage = createDynamicEPackage();
@@ -377,8 +377,8 @@ public class ExternalReferenceTest extends AbstractCDOTest
CDOTransaction transaction1 = session.openTransaction();
CDOTransaction transaction2 = session.openTransaction();
- CDOResource resource1 = transaction1.createResource("/test1");
- CDOResource resource2 = transaction2.createResource("/test2");
+ CDOResource resource1 = transaction1.createResource(getResourcePath("/test1"));
+ CDOResource resource2 = transaction2.createResource(getResourcePath("/test2"));
Supplier supplier = getModel1Factory().createSupplier();
PurchaseOrder purchaseOrder = getModel1Factory().createPurchaseOrder();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
index c797675d6c..71464c16d5 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
@@ -38,7 +38,7 @@ public class GeneratedEcoreTest extends AbstractCDOTest
CDOSession session1 = openSession();
session1.getPackageRegistry().putEPackage(ecore);
CDOTransaction transaction1 = session1.openTransaction();
- CDOResource res1 = transaction1.createResource("/res");
+ CDOResource res1 = transaction1.createResource(getResourcePath("/res"));
EPackage root1 = TestEMFUtil.loadEcore("model1.ecore", session1.getPackageRegistry());
res1.getContents().add(root1);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
index 0827cc52d3..6c0e4c252d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
@@ -633,6 +633,7 @@ public class ResourceTest extends AbstractCDOTest
changePath(3, 0);
}
+ @CleanRepositoriesBefore
public void testChangeResourceURI() throws Exception
{
{
@@ -913,7 +914,7 @@ public class ResourceTest extends AbstractCDOTest
transaction.close();
CDOView view = session.openView();
- assertEquals(false, view.hasResource("/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/resource1")));
try
{
@@ -972,7 +973,7 @@ public class ResourceTest extends AbstractCDOTest
clearCache(getRepository().getRevisionManager());
CDOView view = session.openView();
- assertEquals(false, view.hasResource("/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/resource1")));
try
{
@@ -1035,7 +1036,7 @@ public class ResourceTest extends AbstractCDOTest
commitAndSync(transaction, view);
transaction.close();
- assertEquals(false, view.hasResource("/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/resource1")));
try
{
@@ -1099,7 +1100,7 @@ public class ResourceTest extends AbstractCDOTest
transaction.close();
clearCache(getRepository().getRevisionManager());
- assertEquals(false, view.hasResource("/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/resource1")));
try
{
@@ -1182,7 +1183,7 @@ public class ResourceTest extends AbstractCDOTest
transaction.close();
CDOView view = session.openView();
- assertEquals(false, view.hasResource("/folder/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/folder/resource1")));
try
{
@@ -1261,7 +1262,7 @@ public class ResourceTest extends AbstractCDOTest
clearCache(getRepository().getRevisionManager());
CDOView view = session.openView();
- assertEquals(false, view.hasResource("/folder/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/folder/resource1")));
try
{
@@ -1344,7 +1345,7 @@ public class ResourceTest extends AbstractCDOTest
commitAndSync(transaction, view);
transaction.close();
- assertEquals(false, view.hasResource("/folder/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/folder/resource1")));
try
{
@@ -1429,7 +1430,7 @@ public class ResourceTest extends AbstractCDOTest
transaction.close();
clearCache(getRepository().getRevisionManager());
- assertEquals(false, view.hasResource("/folder/resource1"));
+ assertEquals(false, view.hasResource(getResourcePath("/folder/resource1")));
try
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SavePointTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SavePointTest.java
index b42a2aaf00..3f0e1650e0 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SavePointTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SavePointTest.java
@@ -99,7 +99,7 @@ public class SavePointTest extends AbstractCDOTest
CDOTransaction transaction1 = session.openTransaction();
// Client1
- CDOResource resource1 = transaction1.createResource("/test1");
+ CDOResource resource1 = transaction1.createResource(getResourcePath("/test1"));
Company company1 = getModel1Factory().createCompany();
resource1.getContents().add(company1);
Category category1 = getModel1Factory().createCategory();
@@ -128,7 +128,7 @@ public class SavePointTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
CDOUserSavepoint savePoint0 = transaction.setSavepoint();
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
Company company = getModel1Factory().createCompany();
resource.getContents().add(company);
@@ -282,8 +282,8 @@ public class SavePointTest extends AbstractCDOTest
{
CDOSession client1 = openSession();
CDOTransaction transaction1 = client1.openTransaction();
- CDOResource object1X = transaction1.createResource("/object1");
- CDOResource object2X = transaction1.createResource("/object2");
+ CDOResource object1X = transaction1.createResource(getResourcePath("/object1"));
+ CDOResource object2X = transaction1.createResource(getResourcePath("/object2"));
transaction1.commit();
// client1 sets a save point
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/XATransactionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/XATransactionTest.java
index 3fb7654fc8..940cf1dfd1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/XATransactionTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/XATransactionTest.java
@@ -59,8 +59,8 @@ public class XATransactionTest extends AbstractCDOTest
CDOTransaction transactionA1 = sessionA.openTransaction(resourceSet);
CDOTransaction transactionB1 = sessionB.openTransaction(resourceSet);
- CDOResource resA = transactionA1.createResource("/resA");
- CDOResource resB = transactionB1.createResource("/resB");
+ CDOResource resA = transactionA1.createResource(getResourcePath("/resA"));
+ CDOResource resB = transactionB1.createResource(getResourcePath("/resB"));
Supplier supplier = getModel1Factory().createSupplier();
PurchaseOrder purchaseOrder = getModel1Factory().createPurchaseOrder();
@@ -101,8 +101,8 @@ public class XATransactionTest extends AbstractCDOTest
CDOTransaction transactionA1 = sessionA.openTransaction(resourceSet);
CDOTransaction transactionB1 = sessionB.openTransaction(resourceSet);
- CDOResource resA = transactionA1.createResource("/resA");
- CDOResource resB = transactionB1.createResource("/resB");
+ CDOResource resA = transactionA1.createResource(getResourcePath("/resA"));
+ CDOResource resB = transactionB1.createResource(getResourcePath("/resB"));
Supplier supplier = getModel1Factory().createSupplier();
PurchaseOrder purchaseOrder = getModel1Factory().createPurchaseOrder();
@@ -306,8 +306,8 @@ public class XATransactionTest extends AbstractCDOTest
CDOTransaction transactionA1 = sessionA.openTransaction(resourceSet);
CDOTransaction transactionB1 = sessionB.openTransaction(resourceSet);
- CDOResource resA = transactionA1.createResource("/resA");
- CDOResource resB = transactionB1.createResource("/resB");
+ CDOResource resA = transactionA1.createResource(getResourcePath("/resA"));
+ CDOResource resB = transactionB1.createResource(getResourcePath("/resB"));
Supplier supplier = getModel1Factory().createSupplier();
PurchaseOrder purchaseOrder = getModel1Factory().createPurchaseOrder();
@@ -325,7 +325,7 @@ public class XATransactionTest extends AbstractCDOTest
sessionC.getPackageRegistry().putEPackage(getModel1Package());
PurchaseOrder purchaseOrder3 = getModel1Factory().createPurchaseOrder();
- CDOResource resC = transactionC1.createResource("/resC");
+ CDOResource resC = transactionC1.createResource(getResourcePath("/resC"));
resC.getContents().add(purchaseOrder3);
supplier.getPurchaseOrders().add(purchaseOrder3);
purchaseOrder.setDate(new Date());
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
index 38e1c679de..cb253ee31c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
@@ -50,6 +50,7 @@ import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.spi.server.InternalRepositorySynchronizer;
import org.eclipse.emf.cdo.spi.server.InternalSessionManager;
import org.eclipse.emf.cdo.spi.server.InternalStore;
+import org.eclipse.emf.cdo.spi.server.InternalSynchronizableRepository;
import org.eclipse.emf.cdo.tests.config.IRepositoryConfig;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesAfter;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesBefore;
@@ -704,14 +705,21 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
boolean failover)
{
IStore masterStore = createStore(masterName);
+
+ InternalRepository repository;
if (failover)
{
InternalRepositorySynchronizer synchronizer = createSynchronizer("backup", name);
- return (InternalRepository)CDOServerUtil.createFailoverParticipant(masterName, masterStore, props,
+ repository = (InternalRepository)CDOServerUtil.createFailoverParticipant(masterName, masterStore, props,
synchronizer, true);
}
+ else
+ {
+ repository = (InternalRepository)CDOServerUtil.createRepository(masterName, masterStore, props);
+ }
- return (InternalRepository)CDOServerUtil.createRepository(masterName, masterStore, props);
+ setInitialPackages(repository);
+ return repository;
}
@Override
@@ -742,37 +750,48 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
InternalRepositorySynchronizer synchronizer = createSynchronizer("master", masterName);
IStore store = createStore(name);
+ InternalSynchronizableRepository repository;
if (failover)
{
- return (InternalRepository)CDOServerUtil.createFailoverParticipant(name, store, props, synchronizer, false);
+ repository = (InternalSynchronizableRepository)CDOServerUtil.createFailoverParticipant(name, store, props,
+ synchronizer, false);
}
-
- OfflineClone repository = new OfflineClone()
+ else
{
- @Override
- public void handleCommitInfo(CDOCommitInfo commitInfo)
+ repository = new OfflineClone()
{
- waitIfLockAvailable();
- super.handleCommitInfo(commitInfo);
- }
+ @Override
+ public void handleCommitInfo(CDOCommitInfo commitInfo)
+ {
+ waitIfLockAvailable();
+ super.handleCommitInfo(commitInfo);
+ }
- private void waitIfLockAvailable()
- {
- long millis = getTestDelayedCommitHandling();
- if (millis != 0L)
+ private void waitIfLockAvailable()
{
- ConcurrencyUtil.sleep(millis);
+ long millis = getTestDelayedCommitHandling();
+ if (millis != 0L)
+ {
+ ConcurrencyUtil.sleep(millis);
+ }
}
- }
- };
+ };
- repository.setName(name);
- repository.setStore((InternalStore)store);
- repository.setProperties(props);
- repository.setSynchronizer(synchronizer);
+ repository.setName(name);
+ repository.setStore((InternalStore)store);
+ repository.setProperties(props);
+ repository.setSynchronizer(synchronizer);
+ }
+
+ setInitialPackages(repository);
return repository;
}
+ protected void setInitialPackages(IRepository repository)
+ {
+ repository.setInitialPackages(getCurrentTest().getModel1Package(), getCurrentTest().getModel3Package());
+ }
+
protected InternalRepositorySynchronizer createSynchronizer(final String acceptorName, final String repositoryName)
{
CDOSessionConfigurationFactory masterFactory = new CDOSessionConfigurationFactory()
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/defs/CDOViewDefImplTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/defs/CDOViewDefImplTest.java
index 5a77c961ff..f1c6e0dc3b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/defs/CDOViewDefImplTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/defs/CDOViewDefImplTest.java
@@ -85,8 +85,8 @@ public class CDOViewDefImplTest extends AbstractCDOTest
CDOView cdoView = (CDOView)cdoViewDef.getInstance();
- assertEquals(true, cdoView.hasResource(RESOURCE_ID));
- assertEquals(false, cdoView.hasResource("/test2"));
+ assertEquals(true, cdoView.hasResource(getResourcePath(RESOURCE_ID)));
+ assertEquals(false, cdoView.hasResource(getResourcePath("/test2")));
}
public void testViewMayBeUnset()
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java
deleted file mode 100644
index c35f55b6c3..0000000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.tests.offline;
-
-import org.eclipse.emf.cdo.tests.AbstractSyncingTest;
-import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesBefore;
-
-/**
- * Clone Repository doesn't retry to init root resource
- * <p>
- * See bug 376566.
- *
- * @author Eike Stepper
- */
-@CleanRepositoriesBefore
-public class Bugzilla_376567_Test extends AbstractSyncingTest
-{
- @Override
- protected boolean isHinderInitialReplication()
- {
- return true;
- }
-
- public void testInitCloneWithoutMaster() throws Exception
- {
- // try
- // {
- // openSession();
- // fail("IllegalStateException expected");
- // }
- // catch (Throwable t)
- // {
- // if (t instanceof RemoteException)
- // {
- // t = ((RemoteException)t).getCause();
- // }
- //
- // String msg = ((IllegalStateException)t).getMessage();
- // assertEquals("Root resource has not been initialized in Repository[repo1]", msg);
- // }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/FailoverTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/FailoverTest.java
index 845dc201eb..52af35c6be 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/FailoverTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/FailoverTest.java
@@ -114,7 +114,7 @@ public class FailoverTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession("master");
CDOTransaction transaction = masterSession.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
TestListener listener = new TestListener();
CDOSession backupSession = openSession();
@@ -126,7 +126,7 @@ public class FailoverTest extends AbstractSyncingTest
resource.getContents().add(company);
long timeStamp = transaction.commit().getTimeStamp();
assertEquals(true, backupSession.waitForUpdate(timeStamp, DEFAULT_TIMEOUT));
- checkEvent(listener, 1, 3, 1, 0);
+ checkEvent(listener, 0, 4, 1, 0);
for (int i = 0; i < 10; i++)
{
@@ -158,8 +158,7 @@ public class FailoverTest extends AbstractSyncingTest
public void testClientCommitsToBackupForbidden() throws Exception
{
- /* InternalRepository backup = */
- getRepository();
+ InternalRepository backup = getRepository();
InternalRepository master = getRepository("master");
@@ -170,7 +169,7 @@ public class FailoverTest extends AbstractSyncingTest
Company company = getModel1Factory().createCompany();
company.setName("Test");
- CDOSession backupSession = openSession();
+ CDOSession backupSession = openSession(backup.getName());
waitForOnline(backupSession.getRepositoryInfo());
CDOTransaction transaction = backupSession.openTransaction();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayed2Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayed2Test.java
index f2d9fa235d..bd1d7be4db 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayed2Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayed2Test.java
@@ -38,7 +38,7 @@ public class OfflineDelayed2Test extends AbstractSyncingTest
CDOSession masterSession = openSession(master.getName());
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/my/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/my/resource"));
Company masterCompany = getModel1Factory().createCompany();
masterCompany.setName("Test");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayedTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayedTest.java
index a9ecd52bff..863a0fdc62 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayedTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineDelayedTest.java
@@ -45,7 +45,7 @@ public class OfflineDelayedTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
for (int i = 0; i < 10; i++)
{
masterResource.getContents().add(getModel1Factory().createCompany());
@@ -83,7 +83,7 @@ public class OfflineDelayedTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
masterResource.getContents().add(getModel1Factory().createCompany());
masterTransaction.commit();
@@ -129,7 +129,7 @@ public class OfflineDelayedTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
for (int i = 0; i < 20; i++)
{
masterResource.getContents().add(getModel1Factory().createCompany());
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java
index fd82d1d71e..ded3fba964 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java
@@ -57,7 +57,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession session = openSession("master");
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
Company company = getModel1Factory().createCompany();
company.setName("Test");
@@ -100,7 +100,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession("master");
CDOTransaction transaction = masterSession.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
TestListener listener = new TestListener();
CDOSession cloneSession = openSession();
@@ -158,7 +158,7 @@ public class OfflineTest extends AbstractSyncingTest
waitForOnline(cloneSession.getRepositoryInfo());
CDOTransaction transaction = cloneSession.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(company);
transaction.commit();
@@ -182,7 +182,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
masterResource.getContents().add(getModel1Factory().createCompany());
masterTransaction.commit();
@@ -202,7 +202,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(company);
transaction.commit();
@@ -224,7 +224,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
Company comp = getModel1Factory().createCompany();
masterResource.getContents().add(comp);
@@ -240,7 +240,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getResource("/master/resource");
+ CDOResource resource = transaction.getResource(getResourcePath("/master/resource"));
Company company = (Company)resource.getContents().get(0);
assertEquals("MODIFICATION", company.getName());
@@ -257,7 +257,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
Company comp = getModel1Factory().createCompany();
masterResource.getContents().add(comp);
@@ -273,7 +273,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getResource("/master/resource");
+ CDOResource resource = transaction.getResource(getResourcePath("/master/resource"));
assertEquals(0, resource.getContents().size());
}
@@ -291,7 +291,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(company);
CDOCommitInfo commitInfo = transaction.commit();
@@ -306,7 +306,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(getModel1Factory().createCompany());
transaction.commit();
@@ -351,7 +351,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(company);
CDOCommitInfo commitInfo = transaction.commit();
@@ -375,7 +375,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction transaction = masterSession.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
for (int i = 0; i < 10; i++)
{
@@ -455,7 +455,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
InputStream inputStream = null;
@@ -486,7 +486,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getResource("/master/resource");
+ CDOResource resource = transaction.getResource(getResourcePath("/master/resource"));
Image image = (Image)resource.getContents().get(0);
@@ -515,7 +515,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.createResource("/master/resource");
+ CDOResource masterResource = masterTransaction.createResource(getResourcePath("/master/resource"));
InputStream inputStream = null;
@@ -561,7 +561,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getResource("/master/resource");
+ CDOResource resource = transaction.getResource(getResourcePath("/master/resource"));
File file = (File)resource.getContents().get(0);
@@ -593,7 +593,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(getModel1Factory().createCompany());
transaction.setCommitComment("resource with one company created on clone");
@@ -611,7 +611,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.getResource("/my/resource");
+ CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
masterResource.getContents().add(getModel1Factory().createCompany());
masterTransaction.setCommitComment("one company added on master");
@@ -670,7 +670,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
session.options().setPassiveUpdateMode(PassiveUpdateMode.ADDITIONS);
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(getModel1Factory().createCompany());
transaction.setCommitComment("resource with one company created on clone");
@@ -688,7 +688,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.getResource("/my/resource");
+ CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
masterResource.getContents().add(getModel1Factory().createCompany());
masterTransaction.setCommitComment("one company added on master");
@@ -748,7 +748,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/my/resource");
+ CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
resource.getContents().add(getModel1Factory().createCompany());
transaction.setCommitComment("resource with one company created on clone");
@@ -760,7 +760,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession("master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.getResource("/my/resource");
+ CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
for (int i = 0; i < 100; i++)
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/revisioncache/AbstractCDORevisionCacheTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/revisioncache/AbstractCDORevisionCacheTest.java
index 8a867f1b8d..95d1b0cfa6 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/revisioncache/AbstractCDORevisionCacheTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/revisioncache/AbstractCDORevisionCacheTest.java
@@ -41,7 +41,7 @@ import java.util.List;
/**
* An abstract superclass that may be subclassed to test behaviour common to all CDORevisionCaches
- *
+ *
* @author Andre Dietisheim
* @see CDORevisionCache
* @see DBRevisionCache
@@ -53,6 +53,8 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
{
private static final String RESOURCE_PATH = "/res1";
+ private static final String COMPANY = "Eclipse";
+
private static final int MAX_THREADS = 10;
private static final CDOBranch BRANCH = null;
@@ -88,7 +90,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testAddedRevisionIsGettable()
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision cdoRevision = company.cdoRevision();
addRevision(cdoRevision);
@@ -104,7 +106,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testGetRevisionReturnsLatestVersion() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstRevision = company.cdoRevision();
addRevision(firstRevision);
@@ -120,7 +122,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testAddedRevisionIsNotRevised() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstRevision = company.cdoRevision();
addRevision(firstRevision);
@@ -131,7 +133,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testFormerVersionIsGettable() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstRevision = company.cdoRevision();
addRevision(firstRevision);
@@ -151,7 +153,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testAddRevisionUpdatesRevisedTimeStampOfLastRevision() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
CDOID id = company.cdoID();
InternalCDORevision firstVersion = company.cdoRevision();
@@ -175,7 +177,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testTheFormerRevisionOf2VersionsMayBeFetchedByTimestamp() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
CDOID id = CDOUtil.getCDOObject(company).cdoID();
InternalCDORevision firstRevision = company.cdoRevision();
addRevision(firstRevision);
@@ -200,7 +202,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testGiven3ObjectsOf2TypesGetRevisionsReturns2Versions() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
addRevision(company.cdoRevision());
company.setName("Andre");
@@ -219,7 +221,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testReturnsRemovedVersionWhenRemoving() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstVersion = company.cdoRevision();
addRevision(firstVersion);
@@ -236,7 +238,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testRemovedRevisionIsRemovedFromCache() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstVersion = company.cdoRevision();
addRevision(firstVersion);
@@ -252,7 +254,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testRemoveSecondRevisionResultsInNoActiveRevision() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstVersion = company.cdoRevision();
addRevision(firstVersion);
@@ -269,7 +271,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testRemovedRevisionIsNotGettableByTimeStamp() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstVersion = company.cdoRevision();
addRevision(firstVersion);
@@ -285,7 +287,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
public void testClearedCacheDoesNotContainAnyRevisions() throws Exception
{
- CompanyImpl company = (CompanyImpl)createCompanyInResource("Puzzle");
+ CompanyImpl company = (CompanyImpl)createCompanyInResource(COMPANY);
InternalCDORevision firstVersion = company.cdoRevision();
addRevision(firstVersion);
@@ -312,9 +314,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
{
public void run()
{
- // transactions are not thread safe, open a new one, this is probably a bug
- // CDOObject company = createCompanyInResource("Puzzle", (CDOTransaction)resource.cdoView());
- CDOObject company = createCompanyInResource("Puzzle", session.openTransaction());
+ CDOObject company = createCompanyInResource(COMPANY, session.openTransaction());
CDORevision revision = company.cdoRevision();
addRevision(revision);
CDORevision fetchedRevision = revisionCache.getRevision(revision.getID(), BRANCH_POINT);
@@ -326,7 +326,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
{
public void run()
{
- CDOObject company = createCompanyInResource("Puzzle", session.openTransaction());
+ CDOObject company = createCompanyInResource(COMPANY, session.openTransaction());
CDORevision revision = company.cdoRevision();
addRevision(revision);
CDORevision fetchedRevision = revisionCache.getRevisionByVersion(revision.getID(),
@@ -340,7 +340,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
{
public void run()
{
- CDOObject company = createCompanyInResource("Puzzle", session.openTransaction());
+ CDOObject company = createCompanyInResource(COMPANY, session.openTransaction());
CDORevision revision = company.cdoRevision();
addRevision(revision);
revisionCache.removeRevision(revision.getID(), revision);
@@ -359,7 +359,7 @@ public abstract class AbstractCDORevisionCacheTest extends AbstractOMTest
{
public void run()
{
- CDOObject company = createCompanyInResource("Puzzle", session.openTransaction());
+ CDOObject company = createCompanyInResource(COMPANY, session.openTransaction());
CDORevision revision = company.cdoRevision();
addRevision(revision);
CDORevision fetchedRevision = revisionCache.getRevision(revision.getID(), BRANCH_POINT);

Back to the top