Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStéphane Bégaudeau2015-12-10 09:05:51 +0000
committerStéphane Bégaudeau2015-12-10 09:05:51 +0000
commitd08acf29b7031828fe0089228463c1f427b112a8 (patch)
treeb35c78cb9a12cf6068be88cbacb99376f2528b14 /tests
parentc65f0259cf7b1932d6b456c0c1fa69af1dab7379 (diff)
downloadorg.eclipse.eef-d08acf29b7031828fe0089228463c1f427b112a8.tar.gz
org.eclipse.eef-d08acf29b7031828fe0089228463c1f427b112a8.tar.xz
org.eclipse.eef-d08acf29b7031828fe0089228463c1f427b112a8.zip
[build] Improve the build
1) Add org.eclipse.eef.properties.ui to the build 2) Fix an issue with a missing maven plugin version for an update site 3) Fix an error in a unit test when run as an Eclipse Plugin test Change-Id: I16b852fd6fc89980eba286024fbe3c7b91c099c6 Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
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