From eea19a2556d682ce50863d04826da8ac19eae25c Mon Sep 17 00:00:00 2001 From: Pierre-Charles David Date: Tue, 15 Dec 2015 16:58:33 +0100 Subject: [482993] Use the default EvaluationResult implementation from Sirius Bug: 482993 Change-Id: Ifcabc67ae7277680c6cce157bd09a143ac9ed2c3 Signed-off-by: Pierre-Charles David --- .../controllers/EEFTextControllerTests.java | 5 +- .../internal/controllers/EvaluationResult.java | 76 ---------------------- 2 files changed, 3 insertions(+), 78 deletions(-) delete mode 100644 tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EvaluationResult.java 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 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 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; - } - -} -- cgit v1.2.3