summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-04 12:58:42 (EST)
committerEike Stepper2008-01-04 12:58:42 (EST)
commit637668f4a7446b697f7f6fa586f0e411d3b7260a (patch)
tree92ae6d6031dda6a9af08b817fe52088dd03bd262
parent975a62d6eba435214608a0b489a6fd29cdf872b0 (diff)
downloadcdo-637668f4a7446b697f7f6fa586f0e411d3b7260a.zip
cdo-637668f4a7446b697f7f6fa586f0e411d3b7260a.tar.gz
cdo-637668f4a7446b697f7f6fa586f0e411d3b7260a.tar.bz2
[214374] Some revisions are not linked via CDOID
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214374
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BugzillasTest.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionDeadLockTest.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java4
11 files changed, 115 insertions, 64 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BugzillasTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BugzillasTest.java
new file mode 100644
index 0000000..9377c31
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BugzillasTest.java
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * 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;
+
+import org.eclipse.emf.cdo.CDOSession;
+import org.eclipse.emf.cdo.CDOTransaction;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.tests.model1.Customer;
+import org.eclipse.emf.cdo.tests.model1.Model1Factory;
+import org.eclipse.emf.cdo.tests.model1.Model1Package;
+import org.eclipse.emf.cdo.tests.model1.SalesOrder;
+
+import org.eclipse.emf.internal.cdo.CDOTransactionImpl;
+
+import junit.framework.Assert;
+
+/**
+ * @author Eike Stepper
+ */
+public class BugzillasTest extends AbstractCDOTest
+{
+ /**
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=214374
+ */
+ public void test214374() throws Exception
+ {
+ CDOSession session = openModel1Session();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/test1");
+
+ SalesOrder salesOrder = Model1Factory.eINSTANCE.createSalesOrder();
+ resource.getContents().add(salesOrder);
+ transaction.commit();
+
+ Customer customer = Model1Factory.eINSTANCE.createCustomer();
+ salesOrder.setCustomer(customer);
+
+ resource.getContents().add(customer);
+ transaction.commit();
+ transaction.close();
+
+ CDOTransactionImpl transaction2 = (CDOTransactionImpl)session.openTransaction();
+ SalesOrder salesOrder2 = (SalesOrder)transaction2.getObject(salesOrder.cdoID(), true);
+ CDORevision salesRevision = salesOrder2.cdoRevision();
+ CDOFeature customerFeature = salesRevision.getCDOClass().lookupFeature(
+ Model1Package.eINSTANCE.getSalesOrder_Customer().getFeatureID());
+ Object value = salesRevision.getData().get(customerFeature, 0);
+ Assert.assertEquals(true, value instanceof CDOID);
+ transaction2.close();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
index f90c506..0012d08 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
@@ -21,7 +21,6 @@ import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import java.util.Iterator;
@@ -37,7 +36,7 @@ public class ChunkingTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -67,7 +66,7 @@ public class ChunkingTest extends AbstractCDOTest
session.setReferenceChunkSize(10);
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Loading resource");
CDOResource resource = transaction.getResource("/test1");
@@ -90,7 +89,7 @@ public class ChunkingTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -120,7 +119,7 @@ public class ChunkingTest extends AbstractCDOTest
session.setReferenceChunkSize(10);
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Loading resource");
CDOResource resource = transaction.getResource("/test1");
@@ -145,7 +144,7 @@ public class ChunkingTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -165,7 +164,7 @@ public class ChunkingTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
transaction.setLoadRevisionCollectionChunkSize(10);
msg("Loading resource");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java
index 2816e7b..4df5c3b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java
@@ -27,7 +27,6 @@ import org.eclipse.emf.cdo.tests.model1.SalesOrder;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import java.util.HashMap;
import java.util.Iterator;
@@ -74,7 +73,7 @@ public class ChunkingWithMEMTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -109,7 +108,7 @@ public class ChunkingWithMEMTest extends AbstractCDOTest
session.setReferenceChunkSize(10);
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Loading resource");
CDOResource resource = transaction.getResource("/test1");
@@ -133,7 +132,7 @@ public class ChunkingWithMEMTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -169,7 +168,7 @@ public class ChunkingWithMEMTest extends AbstractCDOTest
session.setReferenceChunkSize(10);
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Loading resource");
CDOResource resource = transaction.getResource("/test1");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
index 27afd54..36e5f31 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
@@ -20,7 +20,6 @@ import org.eclipse.emf.cdo.tests.model1.Supplier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
/**
* @author Eike Stepper
@@ -64,7 +63,7 @@ public class ContainmentTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -108,7 +107,7 @@ public class ContainmentTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -157,7 +156,7 @@ public class ContainmentTest extends AbstractCDOTest
category2.getCategories().add(category3);
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -170,7 +169,7 @@ public class ContainmentTest extends AbstractCDOTest
}
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Loading resource");
CDOResource resource = transaction.getResource("/test1");
@@ -226,7 +225,7 @@ public class ContainmentTest extends AbstractCDOTest
category2.getCategories().add(category3);
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -242,7 +241,7 @@ public class ContainmentTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Loading resource");
CDOResource resource = transaction.getResource("/test1");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java
index 4599319..b2792a0 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java
@@ -25,7 +25,6 @@ import org.eclipse.emf.internal.cdo.CDOTransactionImpl;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EContentAdapter;
import java.util.Collection;
@@ -61,7 +60,7 @@ public class ContentAdapterTest extends AbstractCDOTest
{
CDOSession session = openModel1Session();
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.createResource("/test2");
// resource.eAdapters().add(contentAdapter);
@@ -87,7 +86,7 @@ public class ContentAdapterTest extends AbstractCDOTest
CDOFetchRuleManagerInfo info = new CDOFetchRuleManagerInfo();
session.getRevisionManager().setRuleManager(info);
- CDOTransactionImpl transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransactionImpl transaction = session.openTransaction();
CDOResource resource = transaction.getResource("/test2");
// I don't want to fetch my objects!!
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
index 15fb43e..8ee4607 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
@@ -21,7 +21,6 @@ import org.eclipse.emf.cdo.tests.model1.SalesOrder;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
/**
* @author Eike Stepper
@@ -56,7 +55,7 @@ public class CrossReferenceTest extends AbstractCDOTest
companyA.getSalesOrders().add(salesOrder2A);
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resourceA = transaction.createResource("/test1");
@@ -72,7 +71,7 @@ public class CrossReferenceTest extends AbstractCDOTest
// ************************************************************* //
msg("Attaching viewB");
- CDOView viewB = session.openTransaction(new ResourceSetImpl());
+ CDOView viewB = session.openTransaction();
msg("Loading resource");
CDOResource resourceB = viewB.getResource("/test1");
@@ -131,7 +130,7 @@ public class CrossReferenceTest extends AbstractCDOTest
companyA.getSalesOrders().add(salesOrder2A);
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resourceA = transaction.createResource("/test1");
@@ -147,7 +146,7 @@ public class CrossReferenceTest extends AbstractCDOTest
// ************************************************************* //
msg("Attaching viewB");
- CDOView viewB = session.openTransaction(new ResourceSetImpl());
+ CDOView viewB = session.openTransaction();
msg("Loading resource");
CDOResource resourceB = viewB.getResource("/test1");
@@ -182,7 +181,7 @@ public class CrossReferenceTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Attaching transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
// ************************************************************* //
@@ -237,7 +236,7 @@ public class CrossReferenceTest extends AbstractCDOTest
// ************************************************************* //
msg("Attaching viewB");
- CDOView viewB = session.openTransaction(new ResourceSetImpl());
+ CDOView viewB = session.openTransaction();
msg("Loading resource1");
CDOResource resource1B = viewB.getResource("/test1");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
index 4f17c02..eb6af45 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
@@ -31,7 +31,6 @@ import org.eclipse.emf.internal.cdo.analyzer.CDOFetchRuleManagerThreadLocal;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import java.util.ArrayList;
import java.util.List;
@@ -52,7 +51,7 @@ public class FetchRuleAnalyzerTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test2");
@@ -94,7 +93,7 @@ public class FetchRuleAnalyzerTest extends AbstractCDOTest
session.getRevisionManager().setRuleManager(new CDOFetchRuleManagerThreadLocal());
msg("Opening transaction");
- CDOTransactionImpl transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransactionImpl transaction = session.openTransaction();
CDOFeatureAnalyzerModelBased featureanalyzerModelBased = new CDOFeatureAnalyzerModelBased();
transaction.setFeatureAnalyzer(featureanalyzerModelBased);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
index 5defa98..f13aaff 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
@@ -124,7 +124,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
assertNotNull(transaction);
assertEquals(session, transaction.getSession());
}
@@ -135,7 +135,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -244,7 +244,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -267,7 +267,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -293,7 +293,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -322,7 +322,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -352,7 +352,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -385,7 +385,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -419,7 +419,7 @@ public class InitialTest extends AbstractCDOTest
{
disableConsole();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -439,7 +439,7 @@ public class InitialTest extends AbstractCDOTest
}
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Getting resource");
CDOResource resource = transaction.getResource("/test1");
@@ -459,7 +459,7 @@ public class InitialTest extends AbstractCDOTest
{
disableConsole();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -479,7 +479,7 @@ public class InitialTest extends AbstractCDOTest
}
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Getting resource");
CDOResource resource = transaction.getResource("/test1");
@@ -497,7 +497,7 @@ public class InitialTest extends AbstractCDOTest
{
disableConsole();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -517,7 +517,7 @@ public class InitialTest extends AbstractCDOTest
}
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Getting resource");
CDOResource resource = transaction.getResource("/test1");
@@ -541,7 +541,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -565,7 +565,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Getting resource");
CDOResource resource = transaction.getResource("/test1");
@@ -585,7 +585,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
CDOResource resource = transaction.createResource("/test1");
@@ -609,7 +609,7 @@ public class InitialTest extends AbstractCDOTest
CDOSession session = openModel1Session();
msg("Opening transaction");
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
msg("Getting resource");
CDOResource resource = transaction.getResource("/test1");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java
index e9c95a2..85e8358 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java
@@ -24,7 +24,6 @@ import org.eclipse.net4j.util.event.IListener;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -62,7 +61,7 @@ public class InvalidationTest extends AbstractCDOTest
category2A.getCategories().add(category3A);
msg("Opening transaction");
- final CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ final CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
final CDOResource resourceA = transaction.createResource("/test1");
@@ -76,7 +75,7 @@ public class InvalidationTest extends AbstractCDOTest
// ************************************************************* //
msg("Opening view");
- final CDOView view = session.openTransaction(new ResourceSetImpl());
+ final CDOView view = session.openTransaction();
msg("Loading resource");
final CDOResource resourceB = view.getResource("/test1");
@@ -158,7 +157,7 @@ public class InvalidationTest extends AbstractCDOTest
category2A.getCategories().add(category3A);
msg("Attaching transaction");
- final CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ final CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
final CDOResource resourceA = transaction.createResource("/test1");
@@ -172,7 +171,7 @@ public class InvalidationTest extends AbstractCDOTest
// ************************************************************* //
msg("Attaching viewB");
- final CDOView viewB = session.openTransaction(new ResourceSetImpl());
+ final CDOView viewB = session.openTransaction();
msg("Loading resource");
final CDOResource resourceB = viewB.getResource("/test1");
@@ -269,7 +268,7 @@ public class InvalidationTest extends AbstractCDOTest
final CDOSession sessionA = openModel1Session();
msg("Attaching transaction");
- final CDOTransaction transaction = sessionA.openTransaction(new ResourceSetImpl());
+ final CDOTransaction transaction = sessionA.openTransaction();
msg("Creating resource");
final CDOResource resourceA = transaction.createResource("/test1");
@@ -286,7 +285,7 @@ public class InvalidationTest extends AbstractCDOTest
final CDOSession sessionB = openModel1Session();
msg("Attaching viewB");
- final CDOView viewB = sessionB.openTransaction(new ResourceSetImpl());
+ final CDOView viewB = sessionB.openTransaction();
msg("Loading resource");
final CDOResource resourceB = viewB.getResource("/test1");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionDeadLockTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionDeadLockTest.java
index dbef56b..982425d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionDeadLockTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionDeadLockTest.java
@@ -19,8 +19,6 @@ import org.eclipse.emf.cdo.tests.model1.Model1Factory;
import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
/**
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=213782
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=201366
@@ -71,7 +69,7 @@ public class TransactionDeadLockTest extends AbstractCDOTest
{
msg("Opening session");
CDOSession session = openModel1Session();
- CDOTransaction transaction = session.openTransaction(new ResourceSetImpl());
+ CDOTransaction transaction = session.openTransaction();
transaction.createResource("/test2");
transaction.commit();
transaction.close();
@@ -79,7 +77,7 @@ public class TransactionDeadLockTest extends AbstractCDOTest
for (int i = 0; i < 1000; i++)
{
msg("Transaction " + i);
- transaction = session.openTransaction(new ResourceSetImpl());
+ transaction = session.openTransaction();
CDOResource resource = transaction.getResource("/test2");
Category category = Model1Factory.eINSTANCE.createCategory();
resource.getContents().add(category);
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
index 687adc0..ff7729e 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
@@ -13,8 +13,6 @@ package org.eclipse.emf.cdo.internal.ui.actions;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -34,6 +32,6 @@ public final class OpenTransactionAction extends AbstractOpenViewAction
@Override
protected void doRun() throws Exception
{
- getSession().openTransaction(new ResourceSetImpl());
+ getSession().openTransaction();
}
}