Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2018-05-29 09:57:31 -0400
committerNicolas FAUVERGUE2018-05-29 09:57:31 -0400
commite7af437ab447162ae07d8e36d92ebc645fec19d1 (patch)
treebc9cae746a3f6b3f129635a6e4c1f9e99c96609d
parente65c18ff964d6407a3c750de581984eafd9044ee (diff)
downloadorg.eclipse.papyrus-e7af437ab447162ae07d8e36d92ebc645fec19d1.tar.gz
org.eclipse.papyrus-e7af437ab447162ae07d8e36d92ebc645fec19d1.tar.xz
org.eclipse.papyrus-e7af437ab447162ae07d8e36d92ebc645fec19d1.zip
Bug 533676: [Sequence Diagram] Validation should be triggered after
creation of CombinedFragment or InteractionOperand Delete comment for preference initialization + Modify the tests due to the preference modification Change-Id: I143fa33442c84191210336ef90510546c988c246 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramGeneralPreferencePage.java1
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/CombinedFragmentRegressionTest.java24
2 files changed, 23 insertions, 2 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramGeneralPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramGeneralPreferencePage.java
index a72e526a228..c8f30e782e5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramGeneralPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramGeneralPreferencePage.java
@@ -172,7 +172,6 @@ public class CustomDiagramGeneralPreferencePage extends DiagramPreferencePage {
preferenceStore.setDefault(PREF_MOVE_BELOW_ELEMENTS_AT_MESSAGE_DOWN, true);
preferenceStore.setDefault(PREF_MOVE_BELOW_ELEMENTS_AT_MESSAGE_CREATION, PREF_MOVE_BELOW_ELEMENTS_AT_MESSAGE_CREATION_VALUE);
- // by default, validation is activated.
preferenceStore.setDefault(PREF_TRIGGER_ASYNC_VALIDATION, false);
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/CombinedFragmentRegressionTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/CombinedFragmentRegressionTest.java
index 84ce45bde15..8a7f37f7129 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/CombinedFragmentRegressionTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/CombinedFragmentRegressionTest.java
@@ -64,6 +64,8 @@ import org.eclipse.papyrus.junit.matchers.DiagramMatchers;
import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.uml.diagram.sequence.preferences.CustomDiagramGeneralPreferencePage;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.CombinedFragment;
@@ -80,6 +82,8 @@ import org.eclipse.uml2.uml.Message;
import org.hamcrest.CoreMatchers;
import org.hamcrest.CustomTypeSafeMatcher;
import org.hamcrest.Matcher;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -102,7 +106,23 @@ public class CombinedFragmentRegressionTest extends AbstractPapyrusTest {
public CombinedFragmentRegressionTest() {
super();
}
-
+
+ /**
+ * Before test initialization with preference initialization.
+ */
+ @Before
+ public void init() {
+ UMLDiagramEditorPlugin.getInstance().getPreferenceStore().setValue(CustomDiagramGeneralPreferencePage.PREF_TRIGGER_ASYNC_VALIDATION, true);
+ }
+
+ /**
+ * After test with preference modification.
+ */
+ @After
+ public void finalize() {
+ UMLDiagramEditorPlugin.getInstance().getPreferenceStore().setValue(CustomDiagramGeneralPreferencePage.PREF_TRIGGER_ASYNC_VALIDATION, false);
+ }
+
/**
* Verify the creation and extent of a default interaction operand in a newly
* created combined fragment.
@@ -649,6 +669,7 @@ public class CombinedFragmentRegressionTest extends AbstractPapyrusTest {
@Test
@PluginResource("resource/bugs/bug533676.di")
public void validateResizedInteractionOperand_533676() {
+
GraphicalEditPart operandEP = (GraphicalEditPart) editor.findEditPart("opt", InteractionOperand.class);
InteractionOperand operand = (InteractionOperand) operandEP.getAdapter(EObject.class);
Interaction interaction = (Interaction) operand.eContainer().eContainer();
@@ -671,6 +692,7 @@ public class CombinedFragmentRegressionTest extends AbstractPapyrusTest {
@Test
@PluginResource("resource/bugs/bug533676a.di")
public void validateCreatedInteractionOperand_533676() {
+
EditPart interactionEP = editor.findEditPart("doIt", Interaction.class);
EditPart interactionCompartment = editor.getShapeCompartment(interactionEP);

Back to the top