summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-07-06 07:55:27 (EDT)
committerCaspar De Groot2011-07-06 07:55:27 (EDT)
commitdf4a8e2b5ab0290dcfe5613017d9519b31eeca04 (patch)
treedb864885f1c095b0a256c20e3b466794ef4fd21b
parent316cdfa98bb7b23785a5a11d3cd0900587084531 (diff)
downloadcdo-df4a8e2b5ab0290dcfe5613017d9519b31eeca04.zip
cdo-df4a8e2b5ab0290dcfe5613017d9519b31eeca04.tar.gz
cdo-df4a8e2b5ab0290dcfe5613017d9519b31eeca04.tar.bz2
[351046] Offline test and example failures
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351046
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF44
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMOffline.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Scenario.java32
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_329014_Test.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/FailoverTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineRawTest.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineTest.java20
9 files changed, 72 insertions, 63 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
index cc0e3ca..cbaa72a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.tests;singleton:=true
-Bundle-Version: 4.0.0.qualifier
+Bundle-Version: 4.0.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -35,25 +35,25 @@ Require-Bundle: org.eclipse.net4j.tests;bundle-version="[4.0.0,5.0.0)";visibilit
org.eclipse.emf.cdo.workspace;bundle-version="[4.0.0,5.0.0)"
Import-Package: org.apache.derby.jdbc;version="[10.0.0,11.0.0)",
org.h2.jdbcx;version="[1.0.0,2.0.0)"
-Export-Package: base;version="4.0.0",
- base.impl;version="4.0.0",
- base.util;version="4.0.0",
- derived;version="4.0.0",
- derived.impl;version="4.0.0",
- derived.util;version="4.0.0",
- interface_;version="4.0.0",
- interface_.impl;version="4.0.0",
- interface_.util;version="4.0.0",
- org.eclipse.emf.cdo.tests;version="4.0.0",
- org.eclipse.emf.cdo.tests.bugzilla;version="4.0.0",
- org.eclipse.emf.cdo.tests.bundle;version="4.0.0",
- org.eclipse.emf.cdo.tests.config;version="4.0.0",
- org.eclipse.emf.cdo.tests.config.impl;version="4.0.0",
- org.eclipse.emf.cdo.tests.defs;version="4.0.0",
- org.eclipse.emf.cdo.tests.offline;version="4.0.0",
- org.eclipse.emf.cdo.tests.revisioncache;version="4.0.0",
- org.eclipse.emf.cdo.tests.util;version="4.0.0",
- reference;version="4.0.0",
- reference.impl;version="4.0.0",
- reference.util;version="4.0.0"
+Export-Package: base;version="4.0.1",
+ base.impl;version="4.0.1",
+ base.util;version="4.0.1",
+ derived;version="4.0.1",
+ derived.impl;version="4.0.1",
+ derived.util;version="4.0.1",
+ interface_;version="4.0.1",
+ interface_.impl;version="4.0.1",
+ interface_.util;version="4.0.1",
+ org.eclipse.emf.cdo.tests;version="4.0.1",
+ org.eclipse.emf.cdo.tests.bugzilla;version="4.0.1",
+ org.eclipse.emf.cdo.tests.bundle;version="4.0.1",
+ org.eclipse.emf.cdo.tests.config;version="4.0.1",
+ org.eclipse.emf.cdo.tests.config.impl;version="4.0.1",
+ org.eclipse.emf.cdo.tests.defs;version="4.0.1",
+ org.eclipse.emf.cdo.tests.offline;version="4.0.1",
+ org.eclipse.emf.cdo.tests.revisioncache;version="4.0.1",
+ org.eclipse.emf.cdo.tests.util;version="4.0.1",
+ reference;version="4.0.1",
+ reference.impl;version="4.0.1",
+ reference.util;version="4.0.1"
Eclipse-BuddyPolicy: dependent
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 04945cc..c9c94bf 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
@@ -100,19 +100,20 @@ public abstract class AbstractSyncingTest extends AbstractCDOTest
return 0L;
}
- protected static void checkEvent(TestListener listener, int newPackageUnits, int newObjects, int changedObjects,
- int detachedObjects) throws InterruptedException
+ protected static void checkEvent(final TestListener listener, int newPackageUnits, int newObjects,
+ int changedObjects, int detachedObjects) throws InterruptedException
{
- final IEvent[] events = listener.getEvents();
new PollingTimeOuter()
{
@Override
protected boolean successful()
{
- return events.length == 1;
+ IEvent[] events = listener.getEvents();
+ return events.length >= 1;
}
}.assertNoTimeOut();
+ IEvent[] events = listener.getEvents();
IEvent event = events[0];
if (event instanceof CDOSessionInvalidationEvent)
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMOffline.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMOffline.java
index 8f14183..abbfc25 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMOffline.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsMEMOffline.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.cdo.tests;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest;
import org.eclipse.emf.cdo.tests.offline.FailoverTest;
+import org.eclipse.emf.cdo.tests.offline.OfflineDelayed2Test;
+import org.eclipse.emf.cdo.tests.offline.OfflineTest;
import java.util.List;
@@ -33,9 +35,11 @@ public class AllTestsMEMOffline extends AllConfigs
{
// super.initTestClasses(testClasses);
+ // MEM does not support raw replication
// testClasses.add(OfflineRawTest.class);
- // testClasses.add(OfflineTest.class);
- // testClasses.add(OfflineDelayed2Test.class);
+
+ testClasses.add(OfflineTest.class);
+ testClasses.add(OfflineDelayed2Test.class);
testClasses.add(FailoverTest.class);
}
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 65febee..ad6e08f 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
@@ -279,7 +279,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
public void tearDown() throws Exception
{
deactivateServerBrowser();
- if (!isOptimizing() || leavesCleanRepos())
+ if (!isOptimizing() || mustLeaveCleanRepos())
{
deactivateRepositories();
}
@@ -464,7 +464,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
return hasAnnotation(CleanRepositoriesBefore.class);
}
- protected boolean leavesCleanRepos()
+ protected boolean mustLeaveCleanRepos()
{
return hasAnnotation(CleanRepositoriesAfter.class);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Scenario.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Scenario.java
index 89dc19a..aea655b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Scenario.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Scenario.java
@@ -55,12 +55,12 @@ public class Scenario implements IScenario
{
}
- public synchronized IContainerConfig getContainerConfig()
+ public IContainerConfig getContainerConfig()
{
return containerConfig;
}
- public synchronized void setContainerConfig(IContainerConfig containerConfig)
+ public void setContainerConfig(IContainerConfig containerConfig)
{
configs = null;
this.containerConfig = containerConfig;
@@ -70,12 +70,12 @@ public class Scenario implements IScenario
}
}
- public synchronized IRepositoryConfig getRepositoryConfig()
+ public IRepositoryConfig getRepositoryConfig()
{
return repositoryConfig;
}
- public synchronized void setRepositoryConfig(IRepositoryConfig repositoryConfig)
+ public void setRepositoryConfig(IRepositoryConfig repositoryConfig)
{
configs = null;
this.repositoryConfig = repositoryConfig;
@@ -85,12 +85,12 @@ public class Scenario implements IScenario
}
}
- public synchronized ISessionConfig getSessionConfig()
+ public ISessionConfig getSessionConfig()
{
return sessionConfig;
}
- public synchronized void setSessionConfig(ISessionConfig sessionConfig)
+ public void setSessionConfig(ISessionConfig sessionConfig)
{
configs = null;
this.sessionConfig = sessionConfig;
@@ -100,12 +100,12 @@ public class Scenario implements IScenario
}
}
- public synchronized IModelConfig getModelConfig()
+ public IModelConfig getModelConfig()
{
return modelConfig;
}
- public synchronized void setModelConfig(IModelConfig modelConfig)
+ public void setModelConfig(IModelConfig modelConfig)
{
configs = null;
this.modelConfig = modelConfig;
@@ -116,13 +116,13 @@ public class Scenario implements IScenario
}
@Override
- public synchronized String toString()
+ public String toString()
{
return MessageFormat.format("Scenario[{0}, {1}, {2}, {3}]", //
getContainerConfig(), getRepositoryConfig(), getSessionConfig(), getModelConfig());
}
- public synchronized Set<IConfig> getConfigs()
+ public Set<IConfig> getConfigs()
{
if (configs == null)
{
@@ -136,7 +136,7 @@ public class Scenario implements IScenario
return configs;
}
- public synchronized boolean isValid()
+ public boolean isValid()
{
Set<IConfig> configs = getConfigs();
for (IConfig config : configs)
@@ -150,12 +150,12 @@ public class Scenario implements IScenario
return true;
}
- public synchronized ConfigTest getCurrentTest()
+ public ConfigTest getCurrentTest()
{
return currentTest;
}
- public synchronized void setCurrentTest(ConfigTest currentTest)
+ public void setCurrentTest(ConfigTest currentTest)
{
this.currentTest = currentTest;
if (containerConfig != null)
@@ -179,7 +179,7 @@ public class Scenario implements IScenario
}
}
- public synchronized void setUp() throws Exception
+ public void setUp() throws Exception
{
try
{
@@ -205,7 +205,7 @@ public class Scenario implements IScenario
}
}
- public synchronized void tearDown() throws Exception
+ public void tearDown() throws Exception
{
try
{
@@ -244,7 +244,7 @@ public class Scenario implements IScenario
}
}
- public synchronized void save()
+ public void save()
{
File file = getStateFile();
ObjectOutputStream stream = null;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_329014_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_329014_Test.java
index a7e5692..a705a10 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_329014_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_329014_Test.java
@@ -215,6 +215,7 @@ public class Bugzilla_329014_Test extends AbstractSyncingTest
masterTransaction.commit();
masterCompany.setName("Company3");
masterTransaction.commit();
+ msg(CDOUtil.getCDOObject(masterCompany).cdoRevision().getVersion());
// go online.
getOfflineConfig().startMasterTransport();
@@ -222,6 +223,9 @@ public class Bugzilla_329014_Test extends AbstractSyncingTest
cloneTransaction.waitForUpdate(masterTransaction.getLastCommitTime(), 1000);
+ cloneCompany.getName();
+ msg(CDOUtil.getCDOObject(cloneCompany).cdoRevision().getVersion());
+
cloneCompany.setName("Company4");
cloneTransaction.commit();
cloneCompany.setName("Company5");
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 b1a3668..88c5087 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(getRepository().getName() + "_master");
CDOTransaction transaction = masterSession.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
TestListener listener = new TestListener();
CDOSession backupSession = openSession();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineRawTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineRawTest.java
index 585d7f0..a23a1aa 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineRawTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/OfflineRawTest.java
@@ -53,7 +53,7 @@ public class OfflineRawTest extends OfflineTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(getModel1Factory().createCompany());
transaction.setCommitComment("resource with one company created on clone");
@@ -71,7 +71,7 @@ public class OfflineRawTest extends OfflineTest
{
CDOSession masterSession = openSession(clone.getName() + "_master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
+ CDOResource masterResource = masterTransaction.getResource("/my/resource");
masterResource.getContents().add(getModel1Factory().createCompany());
masterTransaction.setCommitComment("one company added on master");
@@ -120,7 +120,7 @@ public class OfflineRawTest extends OfflineTest
CDOSession session = openSession();
session.options().setPassiveUpdateMode(PassiveUpdateMode.ADDITIONS);
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(getModel1Factory().createCompany());
transaction.setCommitComment("resource with one company created on clone");
@@ -138,7 +138,7 @@ public class OfflineRawTest extends OfflineTest
{
CDOSession masterSession = openSession(clone.getName() + "_master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
+ CDOResource masterResource = masterTransaction.getResource("/my/resource");
masterResource.getContents().add(getModel1Factory().createCompany());
masterTransaction.setCommitComment("one company added on master");
@@ -188,7 +188,7 @@ public class OfflineRawTest extends OfflineTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(getModel1Factory().createCompany());
transaction.setCommitComment("resource with one company created on clone");
@@ -200,7 +200,7 @@ public class OfflineRawTest extends OfflineTest
{
CDOSession masterSession = openSession(clone.getName() + "_master");
CDOTransaction masterTransaction = masterSession.openTransaction();
- CDOResource masterResource = masterTransaction.getResource(getResourcePath("/my/resource"));
+ CDOResource masterResource = masterTransaction.getResource("/my/resource");
for (int i = 0; i < 100; i++)
{
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 01c62a2..11380d8 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
@@ -41,7 +41,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession session = openSession(getRepository().getName() + "_master");
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
Company company = getModel1Factory().createCompany();
company.setName("Test");
@@ -84,7 +84,7 @@ public class OfflineTest extends AbstractSyncingTest
{
CDOSession masterSession = openSession(getRepository().getName() + "_master");
CDOTransaction transaction = masterSession.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
TestListener listener = new TestListener();
CDOSession cloneSession = openSession();
@@ -142,7 +142,7 @@ public class OfflineTest extends AbstractSyncingTest
waitForOnline(cloneSession.getRepositoryInfo());
CDOTransaction transaction = cloneSession.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(company);
transaction.commit();
@@ -186,7 +186,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(company);
transaction.commit();
@@ -222,7 +222,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getResource(getResourcePath("/master/resource"));
+ CDOResource resource = transaction.getResource("/master/resource");
Company company = (Company)resource.getContents().get(0);
assertEquals("MODIFICATION", company.getName());
@@ -255,7 +255,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getResource(getResourcePath("/master/resource"));
+ CDOResource resource = transaction.getResource("/master/resource");
assertEquals(0, resource.getContents().size());
}
@@ -273,7 +273,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(company);
CDOCommitInfo commitInfo = transaction.commit();
@@ -288,7 +288,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(getModel1Factory().createCompany());
transaction.commit();
@@ -330,7 +330,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
resource.getContents().add(company);
CDOCommitInfo commitInfo = transaction.commit();
@@ -354,7 +354,7 @@ public class OfflineTest extends AbstractSyncingTest
CDOSession masterSession = openSession(clone.getName() + "_master");
CDOTransaction transaction = masterSession.openTransaction();
- CDOResource resource = transaction.createResource(getResourcePath("/my/resource"));
+ CDOResource resource = transaction.createResource("/my/resource");
for (int i = 0; i < 10; i++)
{