Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-04-04 08:29:37 -0400
committerCamille Letavernier2014-04-04 08:36:17 -0400
commitdc3fbec34976521e5c9886949c945220f31fd8f3 (patch)
treedcfaa34b33871b89012cdb6faacb0841d2a395c2 /tests/junit
parent18a004eb3fa268c6a8bf4bed30498a9e8154fa3f (diff)
downloadorg.eclipse.papyrus-dc3fbec34976521e5c9886949c945220f31fd8f3.tar.gz
org.eclipse.papyrus-dc3fbec34976521e5c9886949c945220f31fd8f3.tar.xz
org.eclipse.papyrus-dc3fbec34976521e5c9886949c945220f31fd8f3.zip
431999: [Timing Diagram - Tests] Failures in the Timing Diagram tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431999 - First investigation: Annotated failing tests with possible cause and additional information
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java9
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java23
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/FailingTest.java39
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InteractiveTest.java38
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java2
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java2
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java10
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java6
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java8
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java6
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java3
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java6
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java67
20 files changed, 193 insertions, 41 deletions
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java
index 302e06314d9..e67a418b1bd 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java
@@ -11,8 +11,7 @@
*****************************************************************************/
package org.eclipse.papyrus.junit.utils.classification;
-import static org.eclipse.papyrus.junit.utils.classification.TestCategory.InvalidTest;
-import static org.eclipse.papyrus.junit.utils.classification.TestCategory.NotImplemented;
+import static org.eclipse.papyrus.junit.utils.classification.TestCategory.FailingTest;
import java.lang.annotation.Annotation;
import java.util.Arrays;
@@ -47,7 +46,11 @@ public class ClassificationConfig {
public static final Set<TestCategory> excludedTestCategories = new HashSet<TestCategory>();
static {
- setExcludedTestCategories(NotImplemented, InvalidTest);
+ //Default on Hudson: exclude everything which is already identified as an issue (i.e. is not a (new) regression)
+ //setExcludedTestCategories(NotImplemented, InvalidTest, FailingTest, InteractiveTest);
+
+ //Check whether identified regressions are still failing
+ setIncludedTestCategories(FailingTest);
}
/**
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java
index 24e7c324dd4..e673a6c048f 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java
@@ -9,10 +9,15 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - add support for conditional tests
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.junit.utils.classification;
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.tools.util.ListHelper;
import org.eclipse.papyrus.junit.utils.rules.ConditionRule;
import org.eclipse.papyrus.junit.utils.rules.Conditional;
import org.junit.runner.Description;
@@ -38,14 +43,16 @@ import org.junit.runners.model.InitializationError;
public class ClassificationRunner extends BlockJUnit4ClassRunner {
private final ThreadLocal<Object> preparedTest = new ThreadLocal<Object>();
-
+
public ClassificationRunner(Class<?> klass) throws InitializationError {
super(klass);
}
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
- if(ClassificationConfig.shouldRun(method.getAnnotations()) && conditionSatisfied(method)) {
+ List<Annotation> allAnnotations = ListHelper.asList(method.getAnnotations());
+ allAnnotations.addAll(Arrays.asList(method.getMethod().getDeclaringClass().getAnnotations()));
+ if(ClassificationConfig.shouldRun(allAnnotations.toArray(new Annotation[allAnnotations.size()])) && conditionSatisfied(method)) {
super.runChild(method, notifier);
} else {
Description description = describeChild(method);
@@ -66,22 +73,22 @@ public class ClassificationRunner extends BlockJUnit4ClassRunner {
return result;
}
-
+
protected final Object basicCreateTest() throws Exception {
return super.createTest();
}
-
+
protected final Object prepareTest() throws Exception {
// Prepare the test instance and stash it to return on the next invocation
Object result = basicCreateTest();
preparedTest.set(result);
return result;
}
-
+
protected final void clearPreparedTest() {
preparedTest.remove();
}
-
+
private boolean conditionSatisfied(FrameworkMethod method) {
boolean result = true;
@@ -102,7 +109,7 @@ public class ClassificationRunner extends BlockJUnit4ClassRunner {
}
}
}
-
+
return result;
}
}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/FailingTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/FailingTest.java
new file mode 100644
index 00000000000..5c8d0d350b5
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/FailingTest.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.junit.utils.classification;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * Indicates that a test currently fails. It can be used to sort new (unidentified) regressions
+ * from known (reported) issues.
+ *
+ * This annotation must be used with the {@link ClassificationRule}
+ *
+ * @author Camille Letavernier
+ *
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface FailingTest {
+
+ /**
+ * A specific message explaining why this test is failing
+ *
+ * @return
+ */
+ String value() default "";
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InteractiveTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InteractiveTest.java
new file mode 100644
index 00000000000..6fa7f1689ab
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InteractiveTest.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.junit.utils.classification;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that a test is interactive, e.g. it opens a user dialog. Such tests cannot be run
+ * automatically and should be disabled on Hudson
+ *
+ * This annotation must be used with the {@link ClassificationRule}
+ *
+ * @author Camille Letavernier
+ *
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface InteractiveTest {
+
+ /**
+ * A specific message explaining why this test is failing
+ *
+ * @return
+ */
+ String value() default "";
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java
index 625726d7239..257262f8495 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
* @author Camille Letavernier
*
*/
-@Target(ElementType.METHOD)
+@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface InvalidTest {
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java
index ab51c1ae20b..e43e07c870a 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
* @author Camille Letavernier
*
*/
-@Target(ElementType.METHOD)
+@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface NotImplemented {
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java
index 1ac992884da..7b1ce06bbbf 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java
@@ -32,6 +32,16 @@ public enum TestCategory {
InvalidTest(InvalidTest.class),
/**
+ * Test methods annotated with {@link FailingTest}
+ */
+ FailingTest(FailingTest.class),
+
+ /**
+ * Test methods annotated with {@link InteractiveTest}
+ */
+ InteractiveTest(InteractiveTest.class),
+
+ /**
* Test methods without any classification-related annotation
*/
Standard();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF
index faa6008225a..b4cb434c679 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.uml2.uml;bundle-version="4.1.0",
- org.junit;bundle-version="4.10.0"
+ org.junit;bundle-version="4.10.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.uml.diagram.timing.tests
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch
index 5415d36826a..0ec61beb21c 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch
@@ -12,7 +12,7 @@
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-timing-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java"/>
</listAttribute>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
index 769ebecf075..9b80f7c2471 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.LifelineVerticalLabelCellEditorLocator;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
@@ -72,6 +73,7 @@ public class TestTimingDiagramCompactLifeline extends AbstractTimingDiagramTestC
assertTrue("The cell editor locator must be the one specific to the vertical label", textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
}
+ @FailingTest("To be verified - Issue with opening the Text widget for direct edit request. Works in standard user environment")
@Test
public void testEditLifelineName() {
final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
index dfaa97026de..603a1464119 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
@@ -24,6 +24,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
@@ -44,6 +45,7 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
createDefaultCompactLifeline();
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testCreateThreeOccurrenceSpecifications() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
@@ -57,6 +59,7 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
checkSimpleCompactTimelinePattern("-o-o-o-");
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testDeleteOccurrenceSpecification() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
@@ -127,6 +130,7 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
checkCreatedOccurrenceSpecification();
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testMoveOccurrenceSpecification() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
@@ -189,6 +193,7 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
* When moving several OccurrenceSpecifications, we don't want the previous positions of the elements to constrain
* the future positions of the elements being moved.
*/
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testMoveAdjacentOccurrenceSpecifications() {
// create two OccurrenceSpecifications close to each other
@@ -226,6 +231,7 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
testDirtyStateForFullUndoRedo(nElementsToUndo);
}
+ @FailingTest("To be verified. Seems to fail on both Hudson and standard user environment")
@Test
public void testCreateOccurrenceSpecificationOnCompactStateInvariant() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
index 16930ef6438..469eca4df2a 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
@@ -24,6 +24,7 @@ import org.eclipse.gef.requests.GroupRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
@@ -43,6 +44,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
createDefaultCompactLifeline();
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testCutCompactStateInvariants() {
final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
@@ -56,6 +58,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);" + "OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testEditCompactStateInvariantName() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
@@ -69,6 +72,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
testSetNameWithDirectEditRequest(nameEditPart, stateInvariant, new INameProvider<StateInvariant>() {
+ @Override
public String getName(final StateInvariant stateInvariant) {
return StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
}
@@ -80,6 +84,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
}
@Test
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
public void testDeleteStateInvariants() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
checkInteractionFragmentsWithPattern("-o-o-o-");
@@ -96,6 +101,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
checkSimpleCompactTimelinePattern("-o-o-");
}
+ @FailingTest("To be verified. Seems to be failing in all environments; not related to the DirectEdit issue")
@Test
public void testDeleteStateInvariantsWithOccurrencesOnTop() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
@@ -132,6 +138,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
checkSimpleCompactTimelinePattern("-o");
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testHideStateInvariants() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
@@ -170,6 +177,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
assertFalse("We shouldn't be able to hide the last state invariant", command.canExecute());
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testResizeCompactStateInvariant() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
index 73ff53ce99b..442dccd36ba 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.LifelineVerticalLabelCellEditorLocator;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
@@ -72,6 +73,7 @@ public class TestTimingDiagramFullLifeline extends AbstractTimingDiagramTestCase
assertTrue("The cell editor locator must be the one specific to the vertical label", textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
}
+ @FailingTest("To be verified - Issue with opening the Text widget for direct edit request. Works in standard user environment")
@Test
public void testEditLifelineName() {
final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
index d6656d9412e..c699ddfdf03 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
@@ -11,6 +11,7 @@ package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
@@ -22,6 +23,7 @@ public class TestTimingDiagramFullLifelineLayout extends AbstractTimingDiagramTe
* This tests the layout of StateDefinitions, with some error margins in order to accommodate possible future
* modifications of the layout.
*/
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testStateDefinitionsLayout() {
final Point interactionLocation = new Point(12, 17);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
index 4864bd7fdcd..0f2f1028589 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
@@ -24,6 +24,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
@@ -32,6 +33,7 @@ import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.OccurrenceSpecification;
import org.eclipse.uml2.uml.StateInvariant;
+import org.junit.Ignore;
import org.junit.Test;
public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTimingDiagramTestCase {
@@ -124,6 +126,7 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
checkCreatedOccurrenceSpecification();
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testCreateOccurrenceSpecificationWithPaletteTool() {
// let GMF do its layout (in order for the Figure coordinates to be set)
@@ -148,6 +151,7 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
checkCreatedOccurrenceSpecification();
}
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testMoveOccurrenceSpecification() {
createThreeOccurrenceSpecificationsInDefaultFullLifeline();
@@ -210,6 +214,7 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
* When moving several OccurrenceSpecifications, we don't want the previous positions of the elements to constrain
* the future positions of the elements being moved.
*/
+ @FailingTest("To be verified. Seems to work for standard user, but not in raw test environment")
@Test
public void testMoveAdjacentOccurrenceSpecifications() {
// create two OccurrenceSpecifications close to each other
@@ -239,6 +244,7 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
}
+ @Ignore("Test is not implemented")
@Test
public void testMoveVerticalLine() {
// TODO: test that moving a vertical line moves the preceding occurrence specification
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
index 8b53a16a4b0..cf039efa2ef 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
import org.junit.Test;
@@ -31,6 +32,7 @@ public class TestTimingDiagramFullStateInvariant extends AbstractTimingDiagramTe
createThreeOccurrenceSpecificationsInDefaultFullLifeline();
}
+ @FailingTest("To be verified - Issue with opening the Text widget for direct edit request. Works in standard user environment")
@Test
public void testMoveStateInvariants() {
final List<FullStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultFullLifeline();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
index efe338e0145..108528348d1 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
@@ -13,6 +13,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionNameEditPart;
@@ -67,6 +68,7 @@ public class TestTimingDiagramInteraction extends AbstractTimingDiagramTestCase
assertTrue("The third interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction3));
}
+ @FailingTest("To be verified - Issue with opening the Text widget for direct edit request. Works in standard user environment")
@Test
public void testEditInteractionName() {
final InteractionEditPartTN interactionEditPart = createInteraction();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
index 02433f1f94c..666f2941f8e 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
@@ -8,6 +8,7 @@
*******************************************************************************/
package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.swt.widgets.Text;
import org.junit.Test;
@@ -25,6 +26,7 @@ public class TestTimingDiagramMessages extends AbstractTimingDiagramTestCase {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
}
+ @FailingTest("To be verified: NPE on the text widget")
@Test
public void testCreateSyncMessage() {
clickTwiceWithTool("createMessageSyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0), findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
@@ -39,6 +41,7 @@ public class TestTimingDiagramMessages extends AbstractTimingDiagramTestCase {
// TODO: check sync Message instance
}
+ @FailingTest("To be verified: NPE on the text widget")
@Test
public void testCreateAsyncMessage() {
clickTwiceWithTool("createMessageAsyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0), findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
index 16370e88091..f2c532cd77c 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
@@ -25,6 +25,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.requests.GroupRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
@@ -86,6 +87,7 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
* Creates a new StateDefinition by clicking using the StateDefinition palette tool (this is important to test
* because we customized this tool).
*/
+ @FailingTest("To be verified. Seems to be related to the DirectEdit issue (Text widget not found)")
@Test
public void testCreateStateDefinitionWithPaletteTool() {
final FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment = getDefaultStateDefinitionCompartment();
@@ -108,7 +110,7 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
/**
* Check that there is a StateDefinition with the given name.
- *
+ *
* @param expectedName
* the name of a StateDefinition that should exist.
*/
@@ -128,7 +130,6 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
}
}
assertNotNull("The Lifeline's EAnnotation should contain an entry for the StateDefinition", newEntry);
- @SuppressWarnings("null")
final String id = newEntry.getKey();
final View stateDefinitionView = StateDefinitionUtils.getStateDefinitionViewWithId(id, lifelineView);
final String stateDefinitionName = StateDefinitionUtils.getStateDefinitionName(stateDefinitionView);
@@ -191,6 +192,7 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
checkNoStateDefinition(name);
}
+ @FailingTest("To be verified. Seems to be related to the DirectEdit issue (Text widget not found)")
@Test
public void testEditStateDefinitionName() {
final EditPart stateDefinition = createStateDefinitionInDefaultFullLifeline();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
index 6c47afe960e..e2bae0458a3 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
*
- *
+ *
* 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
@@ -25,6 +25,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.core.commands.operations.IOperationHistoryListener;
import org.eclipse.core.commands.operations.OperationHistoryEvent;
import org.eclipse.core.commands.operations.OperationHistoryFactory;
@@ -35,7 +36,9 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.draw2d.FigureCanvas;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
@@ -66,6 +69,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.diagram.ui.util.INotationType;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.notation.View;
@@ -76,6 +80,7 @@ import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.DiResourceSet;
+import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
import org.eclipse.papyrus.uml.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand;
import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
@@ -103,7 +108,7 @@ import org.junit.Before;
// DiResourceSet is deprecated but we need it for CreateUMLModelCommand
@SuppressWarnings({ "deprecation" })
-public abstract class AbstractPapyrusTestCase {
+public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
protected PapyrusMultiDiagramEditor papyrusEditor;
@@ -125,6 +130,7 @@ public abstract class AbstractPapyrusTestCase {
public void setUp() throws Exception {
Runnable closeIntroRunnable = new Runnable() {
+ @Override
public void run() {
IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
@@ -135,6 +141,7 @@ public abstract class AbstractPapyrusTestCase {
// add a listener for failed operations
OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(new IOperationHistoryListener() {
+ @Override
public void historyNotification(final OperationHistoryEvent event) {
if(event.getEventType() == OperationHistoryEvent.OPERATION_NOT_OK) {
AbstractPapyrusTestCase.this.operationFailed = true;
@@ -147,6 +154,7 @@ public abstract class AbstractPapyrusTestCase {
// maximize the workbench window
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
maximize();
// closeAllViewsAndEditors();
@@ -168,7 +176,7 @@ public abstract class AbstractPapyrusTestCase {
* Asserts that no Command executed on the {@link IOperationHistory} since the last call to
* {@link AbstractPapyrusTestCase#resetLastOperationFailedState resetLastOperationFailedState} returned
* {@link OperationHistoryEvent#OPERATION_NOT_OK}.
- *
+ *
*/
protected void assertLastOperationSuccessful() {
assertFalse("The operation failed. Look at the log, or put a breakpoint on ExecutionException or DefaultOperationHistory#notifyNotOK to find the cause.", this.operationFailed);
@@ -194,6 +202,7 @@ public abstract class AbstractPapyrusTestCase {
this.papyrusEditor = null;
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
closeAllEditors();
}
@@ -256,6 +265,7 @@ public abstract class AbstractPapyrusTestCase {
}
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
try {
openPapyrusEditor();
@@ -292,7 +302,7 @@ public abstract class AbstractPapyrusTestCase {
assertTrue("The editor must be a " + PapyrusMultiDiagramEditor.class.getSimpleName() + " (Actual type: " + editorPart.getClass().getSimpleName() + ")", editorPart instanceof PapyrusMultiDiagramEditor);
// maximize the editor
final IWorkbenchPartReference reference = this.page.getReference(editorPart);
-// editorPart.getSite().getPage().toggleZoom(reference);
+ // editorPart.getSite().getPage().toggleZoom(reference);
this.papyrusEditor = ((PapyrusMultiDiagramEditor)editorPart);
Assert.assertNotNull(papyrusEditor);
}
@@ -300,12 +310,12 @@ public abstract class AbstractPapyrusTestCase {
/**
* Create a view for the given type, plus the associated semantic element unless the given type is a notation-only
* type.
- *
+ *
* <ul>
* <li>if type is an {@link INotationType}, then create a view using a {@link CreateViewRequest}
* <li>otherwise, create a view and the corresponding semantic element using a CreateViewAndElementRequest
* </ul>
- *
+ *
* @param elementType
* the type for which to create a view (and possibly a model element)
* @param parentEditPart
@@ -319,12 +329,12 @@ public abstract class AbstractPapyrusTestCase {
/**
* Create a view for the given type, plus the associated semantic element unless the given type is a notation-only
* type.
- *
+ *
* <ul>
* <li>if type is an {@link INotationType}, then create a view using a {@link CreateViewRequest}
* <li>otherwise, create a view and the corresponding semantic element using a CreateViewAndElementRequest
* </ul>
- *
+ *
* @param elementType
* the type for which to create a view (and possibly a model element)
* @param location
@@ -339,6 +349,7 @@ public abstract class AbstractPapyrusTestCase {
final View[] result = new View[1];
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
final CreateViewRequest createRequest = CreateViewRequestFactory.getCreateShapeRequest(elementType, getDiagramEditPart().getDiagramPreferencesHint());
if(size != null) {
@@ -432,7 +443,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Send the given EditPart a "delete" request (which only deletes the View), and execute the returned command.
- *
+ *
* @param editPart
* the EditPart to hide
*/
@@ -464,7 +475,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Send the given EditPart a {@link DestroyElementRequest}, and execute the returned command.
- *
+ *
* @param editPart
* the EditPart to destroy
*/
@@ -650,6 +661,7 @@ public abstract class AbstractPapyrusTestCase {
protected void testSetNameWithDirectEditRequest(final GraphicalEditPart editPart, final NamedElement namedElement) {
testSetNameWithDirectEditRequest(editPart, namedElement, new INameProvider<NamedElement>() {
+ @Override
public String getName(final NamedElement element) {
return element.getName();
}
@@ -660,7 +672,7 @@ public abstract class AbstractPapyrusTestCase {
* Set the name of the given GraphicalEditPart (which must be a name edit part) using a DirectEditRequest. This sets
* the name in the Text widget that appears as a result of the DirectEditRequest, and then closes the Text widget to
* accept the changes.
- *
+ *
* @param editPart
* the edit part on which to perform the DirectEditRequest.
* @param newName
@@ -680,6 +692,7 @@ public abstract class AbstractPapyrusTestCase {
protected static void setText(final Text textWidget, final String newName) {
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
textWidget.setText(newName);
// change the focus in order to accept the text
@@ -696,6 +709,7 @@ public abstract class AbstractPapyrusTestCase {
final Text[] result = new Text[1];
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
// note: both operations need to be performed in the same display runnable
editPart.performRequest(directEditRequest);
@@ -708,7 +722,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Click the palette tool with the given id on the center of the given EditPart's Figure.
- *
+ *
* @param toolId
* the id of the tool to click
* @param target
@@ -721,7 +735,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Click the palette tool with the given id at the given location.
- *
+ *
* @param toolId
* the id of the tool to click
* @param point
@@ -731,6 +745,7 @@ public abstract class AbstractPapyrusTestCase {
final Tool tool = createTool(toolId);
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
tool.activate();
internalClickTool(tool, point);
@@ -749,6 +764,7 @@ public abstract class AbstractPapyrusTestCase {
final Tool tool = createTool(toolId);
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
tool.activate();
internalClickTool(tool, firstPoint);
@@ -766,6 +782,7 @@ public abstract class AbstractPapyrusTestCase {
assertNotNull("The tool with id " + toolId + " couldn't be created", tool); //$NON-NLS-2$
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
initializeTool(tool);
}
@@ -780,7 +797,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Find a tool with the given id in the given palette container.
- *
+ *
* @param toolId
* the id of the tool to return
* @param paletteContainer
@@ -842,6 +859,7 @@ public abstract class AbstractPapyrusTestCase {
final Text[] result = new Text[1];
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
final Composite composite = (Composite)getDiagramEditor().getDiagramGraphicalViewer().getControl();
result[0] = findVisibleTextWidget(composite);
@@ -873,7 +891,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Find the EditPart corresponding to the given View, or <code>null</code> if it doesn't exist, or is not registered
* in the viewer's visual part map.
- *
+ *
* @param view
* the view for which to find a corresponding EditPart
* @return the EditPart corresponding to the View
@@ -889,6 +907,7 @@ public abstract class AbstractPapyrusTestCase {
final Display display = Display.getDefault();
display.syncExec(new Runnable() {
+ @Override
public void run() {
try {
while(display.readAndDispatch()) {
@@ -903,7 +922,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Move the given EditPart in its parent.
- *
+ *
* @param editPartToMove
* the EditPart to move
* @param parentEditPart
@@ -917,7 +936,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Resize the given EditPart in its parent.
- *
+ *
* @param editPartToResize
* the EditPart to resize
* @param parentEditPart
@@ -933,7 +952,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Move the given EditParts in their parent.
- *
+ *
* @param editPartsToMove
* the EditParts to move
* @param parentEditPart
@@ -959,7 +978,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Resize the given EditParts in their parent.
- *
+ *
* @param editPartsToMove
* the EditParts to resize
* @param parentEditPart
@@ -989,7 +1008,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Compute a Location for the mouse pointer that would occur when dragging the center of the given EditPart by the
* given translation vector.
- *
+ *
* @param graphicalEditPart
* the EditPart being dragged
* @param moveDelta
@@ -1021,7 +1040,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Check that undo and redo work correctly after moving/resizing an EditPart (the EditPart must have been
* moved/resized before calling this method).
- *
+ *
* @param editPart
* an EditPart that was just moved/resized
* @param boundsBefore
@@ -1045,7 +1064,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Check the bounds of the given GraphicalEditPart's Figure
- *
+ *
* @param graphicalEditPart
* The EditPart whose Figure's bounds to check
* @param expectedPosition
@@ -1067,7 +1086,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Check the bounds of the given GraphicalEditPart's Figure
- *
+ *
* @param graphicalEditPart
* The EditPart whose Figure's bounds to check
* @param expectedBounds
@@ -1101,7 +1120,7 @@ public abstract class AbstractPapyrusTestCase {
/**
* Find the EditPart corresponding to the given View in the given parent EditPart's children.
- *
+ *
* @param parentEditPart
* the EditPart in which the EditPart we are looking for should be found
* @param view

Back to the top