Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-09-21 11:29:02 -0400
committerEike Stepper2018-09-21 11:30:51 -0400
commite9d92e913be6076e6093270974f1b7c2c02be11e (patch)
tree3dd2108de1141285d8b55b0fba010e1096c686e3 /plugins/org.eclipse.emf.cdo.tests/src
parent75dbe9847542d67cbe8d74fcc86ea433481058ca (diff)
downloadcdo-e9d92e913be6076e6093270974f1b7c2c02be11e.tar.gz
cdo-e9d92e913be6076e6093270974f1b7c2c02be11e.tar.xz
cdo-e9d92e913be6076e6093270974f1b7c2c02be11e.zip
[539332] Repository can't initialize dynamic packages
https://bugs.eclipse.org/bugs/show_bug.cgi?id=539332
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_539332_Test.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_539332_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_539332_Test.java
new file mode 100644
index 0000000000..27d3f79964
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_539332_Test.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2018 Eike Stepper (Loehne, 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.bugzilla;
+
+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.config.IRepositoryConfig;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/**
+ * Bug 539332 - Repository can't initialize dynamic packages.
+ *
+ * @author Eike Stepper
+ */
+public class Bugzilla_539332_Test extends AbstractCDOTest
+{
+ @Requires(IRepositoryConfig.CAPABILITY_RESTARTABLE)
+ public void testRestartWithDynamicPackage() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ EClass eClass = createDynamicEClass();
+ EObject eObject = EcoreUtil.create(eClass);
+
+ resource.getContents().add(eObject);
+ transaction.commit();
+
+ restartRepository();
+ }
+
+ private EClass createDynamicEClass()
+ {
+ EPackage ePackage = createUniquePackage();
+
+ EClass result = EcoreFactory.eINSTANCE.createEClass();
+ result.setName("Dynamic");
+ ePackage.getEClassifiers().add(result);
+ return result;
+ }
+}

Back to the top