Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGoulwen Le Fur2016-01-04 16:17:57 +0000
committerGoulwen Le Fur2016-01-04 16:17:57 +0000
commitd8cc32c3f164d294f9360842526b956d15611701 (patch)
treecf958c89dec74a75e86d7f73767692277e9a5503 /tests
parentb9e0ad941d752eba3bde17ebf0bafb8f4643282d (diff)
parentd08acf29b7031828fe0089228463c1f427b112a8 (diff)
downloadorg.eclipse.eef-d8cc32c3f164d294f9360842526b956d15611701.tar.gz
org.eclipse.eef-d8cc32c3f164d294f9360842526b956d15611701.tar.xz
org.eclipse.eef-d8cc32c3f164d294f9360842526b956d15611701.zip
Merge branch 'master' of ssh://git.eclipse.org:29418/eef/org.eclipse.eef
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.eef.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java16
2 files changed, 17 insertions, 2 deletions
diff --git a/tests/org.eclipse.eef.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.eef.tests/META-INF/MANIFEST.MF
index c0b44e6a0..83a1cd93a 100644
--- a/tests/org.eclipse.eef.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.eef.tests/META-INF/MANIFEST.MF
@@ -12,4 +12,5 @@ Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)",
org.eclipse.eef;bundle-version="[1.6.0,2.0.0)",
org.eclipse.eef.core;bundle-version="[1.6.0,2.0.0)",
org.eclipse.emf.transaction;bundle-version="[1.9.0,2.0.0)",
- org.eclipse.sirius.common.interpreter;bundle-version="1.0.0"
+ org.eclipse.sirius.common.interpreter;bundle-version="[4.0.0,5.0.0)",
+ org.eclipse.emf.ecore.xmi;bundle-version="[2.8.0,3.0.0)"
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
index a46cbe89c..e3eaba4be 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
@@ -19,13 +19,17 @@ import org.eclipse.eef.core.api.EEFVariableManagerFactory;
import org.eclipse.eef.core.api.IVariableManager;
import org.eclipse.eef.core.api.controllers.EEFTextController;
import org.eclipse.eef.core.internal.controllers.EEFTextControllerImpl;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.junit.Before;
@@ -65,6 +69,8 @@ public class EEFTextControllerTests {
public void setUp() {
AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
this.resourceSet = new ResourceSetImpl();
+ this.resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
+ .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
this.editingDomain = new TransactionalEditingDomainImpl(adapterFactory, this.resourceSet);
this.variableManager = new EEFVariableManagerFactory().createVariableManager();
@@ -99,7 +105,15 @@ public class EEFTextControllerTests {
eClass.setName(name);
Resource resource = this.resourceSet.createResource(URI.createURI("test.ecore")); //$NON-NLS-1$
- resource.getContents().add(eClass);
+ Command command = new RecordingCommand(this.editingDomain) {
+ @Override
+ protected void doExecute() {
+ resource.getContents().add(eClass);
+ }
+ };
+
+ CommandStack commandStack = this.editingDomain.getCommandStack();
+ commandStack.execute(command);
this.variableManager.getVariables().put(EEFExpressionUtils.SELF, eClass);
}

Back to the top