Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-07-20 11:50:52 +0000
committerEike Stepper2011-07-20 11:50:52 +0000
commitaf719ba16912427971a462cf41f6245cde962ab6 (patch)
tree8ea61c606d79b36652b1fdbcc7299aeac7ea0b9b /plugins/org.eclipse.emf.cdo.tests
parentad46e775fa0f070dcb43eaea4e8b260e3e9bf443 (diff)
downloadcdo-af719ba16912427971a462cf41f6245cde962ab6.tar.gz
cdo-af719ba16912427971a462cf41f6245cde962ab6.tar.xz
cdo-af719ba16912427971a462cf41f6245cde962ab6.zip
[352561] Support client assigned CDOIDs (UUIDs)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352561
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java11
6 files changed, 71 insertions, 22 deletions
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 f1685da3e4..a45912d2ca 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
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.tests;
import org.eclipse.emf.cdo.CDOState;
+import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
@@ -822,6 +823,13 @@ public class InitialTest extends AbstractCDOTest
assertEquals(supplier, CDOUtil.getEObject(supplierFromURI));
EObject supplierAfterCommit2 = transaction.getResourceSet().getEObject(supplierTempURI, true);
- assertEquals(null, supplierAfterCommit2);
+ if (session.getRepositoryInfo().getIDGenerationLocation() == IDGenerationLocation.STORE)
+ {
+ assertEquals(null, supplierAfterCommit2);
+ }
+ else
+ {
+ assertEquals(supplier, supplierAfterCommit2);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java
index 3865555a48..d4c2ae19c5 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.tests;
+import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
@@ -19,10 +20,8 @@ import org.eclipse.emf.cdo.common.revision.CDOAllRevisionsProvider;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.server.mem.MEMStore;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IStore;
-import org.eclipse.emf.cdo.server.mem.MEMStoreUtil;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
import org.eclipse.emf.cdo.session.CDOSessionConfigurationFactory;
@@ -41,6 +40,7 @@ import org.eclipse.emf.cdo.util.CommitException;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.workspace.CDOWorkspace;
import org.eclipse.emf.cdo.workspace.CDOWorkspaceBase;
+import org.eclipse.emf.cdo.workspace.CDOWorkspaceConfiguration;
import org.eclipse.emf.cdo.workspace.CDOWorkspaceUtil;
import org.eclipse.net4j.jvm.JVMUtil;
@@ -94,11 +94,10 @@ public class WorkspaceTest extends AbstractCDOTest
@Override
protected void doSetUp() throws Exception
{
- disableConsole();
super.doSetUp();
+
skipUnlessAuditing();
skipHandleRevisions();
- skipTest(!getRepository().getStore().getObjectIDTypes().equals(MEMStore.OBJECT_ID_TYPES));
CDOSession session = openSession();
transaction = session.openTransaction();
@@ -116,7 +115,6 @@ public class WorkspaceTest extends AbstractCDOTest
JVMUtil.prepareContainer(getClientContainer());
localStore = createLocalStore();
-
CDOUtil.setLegacyModeDefault(true);
}
@@ -197,6 +195,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testAddObjects() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
CDOTransaction transaction = workspace.openTransaction();
@@ -322,6 +322,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testAddObjects2() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
CDOTransaction transaction = workspace.openTransaction();
@@ -462,6 +464,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testLocalChangesAfterAdd() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
CDOTransaction transaction = workspace.openTransaction();
@@ -542,6 +546,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testLocalChangesAfterAdd2() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
CDOTransaction transaction = workspace.openTransaction();
@@ -639,6 +645,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testCheckinAfterAdd() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
IOUtil.ERR().println("Checkout done");
@@ -735,6 +743,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testCheckinAfterAdd2() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
CDOTransaction transaction = workspace.openTransaction();
@@ -865,6 +875,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testCheckin2AfterAdd() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
CDOTransaction transaction = workspace.openTransaction();
@@ -1003,6 +1015,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testUpdateAfterMasterAdd() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
assertNotSame(CDOBranchPoint.UNSPECIFIED_DATE, workspace.getTimeStamp());
@@ -1098,6 +1112,8 @@ public class WorkspaceTest extends AbstractCDOTest
public void testUpdateAfterMasterAndLocalAdd() throws Exception
{
+ skipTest(getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE);
+
InternalCDOWorkspace workspace = checkout("MAIN", CDOBranchPoint.UNSPECIFIED_DATE);
assertNotSame(CDOBranchPoint.UNSPECIFIED_DATE, workspace.getTimeStamp());
@@ -1196,7 +1212,7 @@ public class WorkspaceTest extends AbstractCDOTest
protected IStore createLocalStore()
{
- return MEMStoreUtil.createMEMStore();
+ return getRepositoryConfig().createStore(CDOWorkspaceConfiguration.DEFAULT_LOCAL_REPOSITORY_NAME);
}
protected InternalCDOWorkspace checkout(String branchPath, long timeStamp)
@@ -1208,13 +1224,21 @@ public class WorkspaceTest extends AbstractCDOTest
CDOWorkspaceBase base = CDOWorkspaceUtil.createFolderWorkspaceBase(folder);
IOUtil.ERR().println("CDOWorkspaceBaseline: " + folder.getAbsolutePath());
- InternalCDOWorkspace workspace = (InternalCDOWorkspace)CDOWorkspaceUtil.checkout(localStore, base, remote,
- branchPath, timeStamp);
+ CDOWorkspaceConfiguration config = CDOWorkspaceUtil.createWorkspaceConfiguration();
+ config.setStore(localStore);
+ config.setBase(base);
+ config.setRemote(remote);
+ config.setBranchPath(branchPath);
+ config.setTimeStamp(timeStamp);
+ config.setIDGenerationLocation(getRepository().getIDGenerationLocation());
+ InternalCDOWorkspace workspace = (InternalCDOWorkspace)config.checkout();
workspaces.add(workspace);
+
InternalRepository localRepository = workspace.getLocalRepository();
registerRepository(localRepository);
LifecycleUtil.activate(localRepository);
+
return workspace;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java
index cdfb93808f..a7d6bb373b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java
@@ -34,6 +34,7 @@ import org.eclipse.emf.cdo.util.CommitException;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.workspace.CDOWorkspace;
import org.eclipse.emf.cdo.workspace.CDOWorkspaceBase;
+import org.eclipse.emf.cdo.workspace.CDOWorkspaceConfiguration;
import org.eclipse.emf.cdo.workspace.CDOWorkspaceUtil;
import org.eclipse.net4j.jvm.JVMUtil;
@@ -159,10 +160,16 @@ public class Bugzilla_327604_Test extends AbstractCDOTest
CDOWorkspaceBase base = CDOWorkspaceUtil.createFolderWorkspaceBase(folder);
IOUtil.ERR().println("CDOWorkspaceBaseline: " + folder.getAbsolutePath());
- InternalCDOWorkspace workspace = (InternalCDOWorkspace)CDOWorkspaceUtil.checkout(localStore, base, remote,
- branchPath, timeStamp);
+ CDOWorkspaceConfiguration config = CDOWorkspaceUtil.createWorkspaceConfiguration();
+ config.setStore(localStore);
+ config.setBase(base);
+ config.setRemote(remote);
+ config.setBranchPath(branchPath);
+ config.setTimeStamp(timeStamp);
+ InternalCDOWorkspace workspace = (InternalCDOWorkspace)config.checkout();
workspaces.add(workspace);
+
InternalRepository localRepository = workspace.getLocalRepository();
registerRepository(localRepository);
LifecycleUtil.activate(localRepository);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java
index 0c7f07af12..988530e652 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.tests.config;
+import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
import java.util.Map;
@@ -30,4 +31,6 @@ public interface IRepositoryConfig extends IConfig
public void registerRepository(InternalRepository repository);
public void setRestarting(boolean b);
+
+ public IStore createStore(String repoName);
}
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 46ec669957..b98243161c 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
@@ -139,6 +139,8 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
}
}
+ // int xxx;
+ // repositoryProperties.put(IRepository.Props.ID_GENERATION_LOCATION, IDGenerationLocation.CLIENT.toString());
return repositoryProperties;
}
@@ -419,8 +421,6 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
return repository;
}
- protected abstract IStore createStore(String repoName);
-
protected InternalRepository getTestRepository()
{
return (InternalRepository)getTestProperty(PROP_TEST_REPOSITORY);
@@ -766,8 +766,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
super("MEM");
}
- @Override
- protected IStore createStore(String repoName)
+ public IStore createStore(String repoName)
{
return MEMStoreUtil.createMEMStore();
}
@@ -795,8 +794,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
super("MEMAudits");
}
- @Override
- protected IStore createStore(String repoName)
+ public IStore createStore(String repoName)
{
return MEMStoreUtil.createMEMStore();
}
@@ -824,8 +822,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
super("MEMBranches");
}
- @Override
- protected IStore createStore(String repoName)
+ public IStore createStore(String repoName)
{
return MEMStoreUtil.createMEMStore();
}
@@ -850,11 +847,10 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
public MEMOffline()
{
- super("MEM_OFFLINE");
+ super("MEMOffline");
}
- @Override
- protected IStore createStore(String repoName)
+ public IStore createStore(String repoName)
{
return MEMStoreUtil.createMEMStore();
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java
index 099945508a..81c2408d9e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.tests.util;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
+import org.eclipse.emf.cdo.common.id.CDOIDGenerator;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticator;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
@@ -37,6 +38,11 @@ public abstract class TestSessionConfiguration extends Notifier implements CDOSe
throw new UnsupportedOperationException();
}
+ public void setIDGenerator(CDOIDGenerator idGenerator)
+ {
+ throw new UnsupportedOperationException();
+ }
+
public void setActivateOnOpen(boolean activateOnOpen)
{
throw new UnsupportedOperationException();
@@ -67,6 +73,11 @@ public abstract class TestSessionConfiguration extends Notifier implements CDOSe
throw new UnsupportedOperationException();
}
+ public CDOIDGenerator getIDGenerator()
+ {
+ throw new UnsupportedOperationException();
+ }
+
public CDOAuthenticator getAuthenticator()
{
throw new UnsupportedOperationException();

Back to the top