Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2018-04-25 20:28:05 +0000
committerNicolas FAUVERGUE2018-05-14 15:15:01 +0000
commit3ef042ffd8437bcc54f7b2258bcea0b6962f110c (patch)
tree2c95fb747c64ef6d66fbf61c84f315c1a74a9093 /tests/junit/framework
parentffad788980af9a4d5dc533f283a29915cc13a786 (diff)
downloadorg.eclipse.papyrus-3ef042ffd8437bcc54f7b2258bcea0b6962f110c.tar.gz
org.eclipse.papyrus-3ef042ffd8437bcc54f7b2258bcea0b6962f110c.tar.xz
org.eclipse.papyrus-3ef042ffd8437bcc54f7b2258bcea0b6962f110c.zip
Bug 533699: [Sequence Diagram] InteractionOperand Guard should not be moved
Disable moving of interaction operand guards. Resize was already disabled. Add JUnit test coverage for both move and resize. Change-Id: Ibbb29ff64f684b184be1efc6142f7c35df218399 Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
Diffstat (limited to 'tests/junit/framework')
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/CommandMatchers.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/CommandMatchers.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/CommandMatchers.java
index 3cd355c83b3..c8e7f58f9fc 100644
--- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/CommandMatchers.java
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/CommandMatchers.java
@@ -17,7 +17,7 @@ import java.util.function.Predicate;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
-import org.hamcrest.TypeSafeMatcher;
+import org.hamcrest.TypeSafeDiagnosingMatcher;
/**
* Matchers for commands of various flavours, which are defined in nested classes.
@@ -34,15 +34,21 @@ public final class CommandMatchers {
}
static <C> Matcher<C> executable(Predicate<? super C> canExecute) {
- return new TypeSafeMatcher<C>() {
+ return new TypeSafeDiagnosingMatcher<C>() {
@Override
public void describeTo(Description description) {
- description.appendText("unexecutable");
+ description.appendText("executable");
}
@Override
- protected boolean matchesSafely(C item) {
- return canExecute.test(item);
+ protected boolean matchesSafely(C item, Description mismatch) {
+ boolean result = canExecute.test(item);
+
+ if (!result) {
+ mismatch.appendText("unexecutable");
+ }
+
+ return result;
}
};
}

Back to the top