Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPierre-Charles David2015-12-15 15:58:33 +0000
committerPierre-Charles David2016-01-05 10:05:13 +0000
commiteea19a2556d682ce50863d04826da8ac19eae25c (patch)
tree4458f11d623c61e953d6c49b57618a02a5ed721e /tests
parentcd128f9e0f06d1b1d2beb561043238e90dcb0f99 (diff)
downloadorg.eclipse.eef-eea19a2556d682ce50863d04826da8ac19eae25c.tar.gz
org.eclipse.eef-eea19a2556d682ce50863d04826da8ac19eae25c.tar.xz
org.eclipse.eef-eea19a2556d682ce50863d04826da8ac19eae25c.zip
[482993] Use the default EvaluationResult implementation from Sirius
Bug: 482993 Change-Id: Ifcabc67ae7277680c6cce157bd09a143ac9ed2c3 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java5
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EvaluationResult.java76
2 files changed, 3 insertions, 78 deletions
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 e3eaba4be..7d9842f1f 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
@@ -31,6 +31,7 @@ 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.EvaluationResult;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.junit.Before;
import org.junit.Test;
@@ -86,7 +87,7 @@ public class EEFTextControllerTests {
final String newValue = "newValue"; //$NON-NLS-1$
IInterpreter interpreter = (Map<String, Object> variables, String expressionBody) -> {
- return new EvaluationResult(newValue);
+ return EvaluationResult.of(newValue);
};
EEFTextController controller = new EEFTextControllerImpl(description, variableManager, interpreter, editingDomain);
@@ -123,7 +124,7 @@ public class EEFTextControllerTests {
final String newLabel = "Label"; //$NON-NLS-1$
IInterpreter interpreter = (Map<String, Object> variables, String expressionBody) -> {
- return new EvaluationResult(newLabel);
+ return EvaluationResult.of(newLabel);
};
EEFTextController controller = new EEFTextControllerImpl(description, variableManager, interpreter, editingDomain);
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EvaluationResult.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EvaluationResult.java
deleted file mode 100644
index 167e08d6c..000000000
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EvaluationResult.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.eef.tests.internal.controllers;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.sirius.common.interpreter.api.IEvaluationResult;
-
-/**
- * The evaluation result.
- *
- * @author sbegaudeau
- */
-public class EvaluationResult implements IEvaluationResult {
-
- /**
- * The value.
- */
- private Object value;
-
- /**
- * The diagnostic.
- */
- private Diagnostic diagnostic;
-
- /**
- * The constructor.
- *
- * @param value
- * The value
- */
- public EvaluationResult(Object value) {
- this(value, Diagnostic.OK_INSTANCE);
- }
-
- /**
- * The constructor.
- *
- * @param value
- * The value
- * @param diagnostic
- * The diagnostic
- */
- public EvaluationResult(Object value, Diagnostic diagnostic) {
- this.value = value;
- this.diagnostic = diagnostic;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.common.interpreter.api.IEvaluationResult#getValue()
- */
- @Override
- public Object getValue() {
- return this.value;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.common.interpreter.api.IEvaluationResult#getDiagnostic()
- */
- @Override
- public Diagnostic getDiagnostic() {
- return this.diagnostic;
- }
-
-}

Back to the top