Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-04-17 08:55:32 +0000
committerEike Stepper2010-04-17 08:55:32 +0000
commitd4d3d5279a4b2ef8850f2fb2db687b28491fe82c (patch)
tree329a019cf8a9aa9776d16a9a18e54a761a5de193 /plugins
parent0ff7c7433a8536e1804b79f93b7b29161009fad6 (diff)
downloadcdo-d4d3d5279a4b2ef8850f2fb2db687b28491fe82c.tar.gz
cdo-d4d3d5279a4b2ef8850f2fb2db687b28491fe82c.tar.xz
cdo-d4d3d5279a4b2ef8850f2fb2db687b28491fe82c.zip
[256936] Support for Offline Mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256936
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java
index fa16628df9..6f40b1d96d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java
@@ -295,4 +295,41 @@ public class FailoverTest extends AbstractSyncingTest
session.close();
}
+
+ public void testSwitchMasterAndCommit() throws Exception
+ {
+ CDOSession session = openSession(getRepository().getName() + "_master");
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/my/resource");
+
+ Company company = getModel1Factory().createCompany();
+ company.setName("Test");
+
+ resource.getContents().add(company);
+
+ for (int i = 0; i < 10; i++)
+ {
+ company.getCategories().add(getModel1Factory().createCategory());
+ transaction.commit();
+ }
+
+ startBackupTransport();
+ getRepository().setType(CDOCommonRepository.Type.MASTER);
+ getRepository(getRepository().getName() + "_master").setType(CDOCommonRepository.Type.BACKUP);
+
+ session.close();
+ session = openSession();
+ transaction = session.openTransaction();
+
+ resource = transaction.getResource("/my/resource");
+ company = (Company)resource.getContents().get(0);
+
+ for (int i = 0; i < 10; i++)
+ {
+ company.setName("AfterFailover-" + i);
+ transaction.commit();
+ }
+
+ session.close();
+ }
}

Back to the top