Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMélanie Bats2016-09-06 08:44:21 +0000
committerMélanie Bats2016-09-29 13:37:15 +0000
commitefa5ed85bf4a038c35f769f579290cb1bc5094f3 (patch)
treeadb16b89519edd281bca33f76abf00f589c3175a /tests
parent8c252b45cba09fcb11666b23944e16a9d8c0b91a (diff)
downloadorg.eclipse.eef-efa5ed85bf4a038c35f769f579290cb1bc5094f3.tar.gz
org.eclipse.eef-efa5ed85bf4a038c35f769f579290cb1bc5094f3.tar.xz
org.eclipse.eef-efa5ed85bf4a038c35f769f579290cb1bc5094f3.zip
[496011] Defer the evaluation of select candidates
The computation of the candidates available for a select is deferred until the user clicks on the combo box. Bug: 496011 Change-Id: I5174df1d864e1a69b72d552b236ac1fe7daa0e77 Signed-off-by: Mélanie Bats <melanie.bats@obeo.fr>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java25
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java3
2 files changed, 24 insertions, 4 deletions
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java
index 4963e35d6..051fabc06 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java
@@ -10,6 +10,10 @@
*******************************************************************************/
package org.eclipse.eef.tests.internal.controllers;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
@@ -21,6 +25,7 @@ import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EditingContextAdapter;
+import org.eclipse.eef.core.api.controllers.IEEFSelectController;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.tests.internal.AQLInterpreter;
import org.eclipse.eef.tests.internal.EEFDataTests;
@@ -36,10 +41,6 @@ import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.sirius.common.interpreter.api.VariableManagerFactory;
import org.junit.Before;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.notNullValue;
-
import static org.junit.Assert.assertTrue;
/**
@@ -125,6 +126,14 @@ public abstract class AbstractEEFControllerTests {
assertThat(label, is(expectedLabel));
atomicBoolean.set(true);
});
+ if (controller instanceof IEEFSelectController) {
+ ((IEEFSelectController) controller).onNewCandidates(candidates -> {
+ // do nothing
+ });
+ ((IEEFSelectController) controller).onNewValue(value -> {
+ // do nothing
+ });
+ }
controller.refresh();
assertTrue(atomicBoolean.get());
}
@@ -136,6 +145,14 @@ public abstract class AbstractEEFControllerTests {
atomicBoolean.set(true);
});
controller.computeHelp();
+ if (controller instanceof IEEFSelectController) {
+ ((IEEFSelectController) controller).onNewCandidates(candidates -> {
+ // do nothing
+ });
+ ((IEEFSelectController) controller).onNewValue(value -> {
+ // do nothing
+ });
+ }
controller.refresh();
assertTrue(atomicBoolean.get());
}
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java
index 78e0a22bf..c51151977 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java
@@ -56,6 +56,9 @@ public class EEFSelectControllerTests extends AbstractEEFControllerTests {
public void testValue() {
AtomicBoolean atomicBoolean = new AtomicBoolean(false);
IEEFSelectController controller = this.selectController(EEFDataTests.EEFSELECTCONTROLLERTESTS_VALUE);
+ controller.onNewCandidates(candidates -> {
+ // do nothing
+ });
controller.onNewValue(value -> {
assertThat(value, is("public")); //$NON-NLS-1$
atomicBoolean.set(true);

Back to the top