Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpguilet2018-02-12 09:15:16 +0000
committerPierre Guilet2018-02-19 09:36:38 +0000
commit65b2a37184b2d5060bf853a655c9e0a5afcaa390 (patch)
tree4b9130b85a54ea9b3f3c962e836f44229561ed82
parentc74b96f51098514fc53e4ac91022891d77486fe4 (diff)
downloadorg.eclipse.sirius-65b2a37184b2d5060bf853a655c9e0a5afcaa390.tar.gz
org.eclipse.sirius-65b2a37184b2d5060bf853a655c9e0a5afcaa390.tar.xz
org.eclipse.sirius-65b2a37184b2d5060bf853a655c9e0a5afcaa390.zip
[471900] fix unstable test
The modifications done for this bug to the already existing test files used by another test were making this other test fail. Now each test has its own design with services classes they need. Bug: 471900 Change-Id: I253d051593f3bfbc7b98fc67765ed9b58dbe43c8 Signed-off-by: pguilet <pierre.guilet@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test.odesign1
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test2.odesign14
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java107
3 files changed, 45 insertions, 77 deletions
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test.odesign
index 6c988976cc..8aa2f0cff1 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test.odesign
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test.odesign
@@ -7,7 +7,6 @@
</defaultLayer>
</ownedRepresentations>
<ownedJavaExtensions qualifiedClassName="org.eclipse.sirius.test.design.BasicService"/>
- <ownedJavaExtensions qualifiedClassName="org.eclipse.sirius.test.design.BasicService2"/>
<ownedJavaExtensions qualifiedClassName="org::eclipse::sirius::test::design::AcceleoMtlInterpreterTestModule"/>
<ownedJavaExtensions qualifiedClassName="org.eclipse.sirius.test.design.ServicesWithDependencies"/>
</ownedViewpoints>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test2.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test2.odesign
new file mode 100644
index 0000000000..6c988976cc
--- /dev/null
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editor/vsm/completion/test2.odesign
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" name="test" version="11.0.0.201609021200">
+ <ownedViewpoints name="VP">
+ <ownedRepresentations xsi:type="description_1:DiagramDescription" name="Diag" domainClass="EClass">
+ <defaultLayer name="Default">
+ <containerMappings name="C1" domainClass="EClass"/>
+ </defaultLayer>
+ </ownedRepresentations>
+ <ownedJavaExtensions qualifiedClassName="org.eclipse.sirius.test.design.BasicService"/>
+ <ownedJavaExtensions qualifiedClassName="org.eclipse.sirius.test.design.BasicService2"/>
+ <ownedJavaExtensions qualifiedClassName="org::eclipse::sirius::test::design::AcceleoMtlInterpreterTestModule"/>
+ <ownedJavaExtensions qualifiedClassName="org.eclipse.sirius.test.design.ServicesWithDependencies"/>
+ </ownedViewpoints>
+</description:Group>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java
index 17f868b1d4..6b31b3c09c 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/ServiceNavigationTest.java
@@ -44,8 +44,7 @@ import org.eclipse.ui.IEditorReference;
import com.google.common.collect.Lists;
/**
- * Test the service implementation navigation from VSM service call in
- * interpreted expressions.
+ * Test the service implementation navigation from VSM service call in interpreted expressions.
*
* @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a>
*
@@ -82,7 +81,7 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
private static final String VSM_PROJECT_NAME = "org.eclipse.sirius.test.design";
- private static final String VSM = "test.odesign";
+ private static final String VSM = "test2.odesign";
/**
*
@@ -111,16 +110,14 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Initialize the context by copying new resources and waiting all build
- * process.
+ * Initialize the context by copying new resources and waiting all build process.
*
* @exception InterruptedException
* if this thread is interrupted while waiting
* @exception OperationCanceledException
* if the progress monitor is canceled while waiting
* @exception CoreException
- * In case of problem during setting workspace description to
- * disable auto build.
+ * In case of problem during setting workspace description to disable auto build.
* @throws CommandException
*/
private void initContext(List<String> nodes) throws InterruptedException, OperationCanceledException, CoreException, CommandException {
@@ -139,7 +136,7 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
String MANIFEST_MF = "MANIFEST.MF";
EclipseTestsSupportHelper.INSTANCE.copyFile(Activator.PLUGIN_ID, PATH + MANIFEST_MF, VSM_PROJECT_NAME + "/META-INF/" + MANIFEST_MF);
EclipseTestsSupportHelper.INSTANCE.copyFile(Activator.PLUGIN_ID, PATH + VSM, VSM_PROJECT_NAME + "/description/" + TESTED_ODESIGN_NAME);
-
+ waitJobsBuildOrRefresh();
// We open the new design used by the test. We avoid replacing the
// already existing one because sometime the refresh is not correctly
// done and tests can fail.
@@ -179,24 +176,7 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * @param string
- */
- private void expandNode(String string) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * @param string
- */
- private void getNode(String string) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * There is problem on linux with this test so we are waiting build or
- * refresh jobs by joining them.
+ * There is problem on linux with this test so we are waiting build or refresh jobs by joining them.
*/
private void waitJobsBuildOrRefresh() throws InterruptedException, OperationCanceledException {
Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, new NullProgressMonitor());
@@ -207,14 +187,12 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the service interpreter.</li>
* <li>The cursor is at the starting position</li>
* <li>The service called is present in two different classes</li>
- * <li>The service from which the navigation is done is the first one in the
- * wizard.</li>
+ * <li>The service from which the navigation is done is the first one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -228,14 +206,12 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the service interpreter.</li>
* <li>The cursor is at the starting position</li>
* <li>The service called is present in two different classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -249,8 +225,7 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the service interpreter.</li>
* <li>The cursor is at the 12 index position</li>
@@ -266,13 +241,11 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the starting position</li>
- * <li>No service should be detected at the cursor position. So nothing
- * should be done.</li>
+ * <li>No service should be detected at the cursor position. So nothing should be done.</li>
* </ul>
*
* @exception Exception
@@ -283,13 +256,11 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the last position</li>
- * <li>No service should be detected at the cursor position. So nothing
- * should be done.</li>
+ * <li>No service should be detected at the cursor position. So nothing should be done.</li>
* </ul>
*
* @exception Exception
@@ -300,13 +271,11 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 27 index position</li>
- * <li>No service should be detected at the cursor position. So nothing
- * should be done.</li>
+ * <li>No service should be detected at the cursor position. So nothing should be done.</li>
* </ul>
*
* @exception Exception
@@ -317,15 +286,12 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 13 index position</li>
- * <li>The service call at cursor position is present in two different
- * classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service call at cursor position is present in two different classes</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -339,15 +305,12 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 9 index position</li>
- * <li>The service call at cursor position is present in two different
- * classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service call at cursor position is present in two different classes</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -361,15 +324,12 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 23 index position</li>
- * <li>The service call at cursor position is present in two different
- * classes</li>
- * <li>The service from which the navigation is done is the second one in
- * the wizard.</li>
+ * <li>The service call at cursor position is present in two different classes</li>
+ * <li>The service from which the navigation is done is the second one in the wizard.</li>
* </ul>
*
* @exception Exception
@@ -383,8 +343,7 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Check that Java service navigation from F3 key and a VSM expression works
- * in the following context:
+ * Check that Java service navigation from F3 key and a VSM expression works in the following context:
* <ul>
* <li>The expression calls the AQL interpreter.</li>
* <li>The cursor is at the 38 index position</li>
@@ -400,22 +359,18 @@ public class ServiceNavigationTest extends AbstractContentAssistTest {
}
/**
- * Tests that Java service navigation from VSM expression is the expected
- * one.
+ * Tests that Java service navigation from VSM expression is the expected one.
*
* @param vsmExpression
* the VSM expression used to test Java service navigation.
* @param matchingJavaServiceNumber
- * the number of Java service that should be proposed for
- * navigation.
+ * the number of Java service that should be proposed for navigation.
* @param expectedItemLabels
* The Java service item's labels in their wizard's order.
* @param javaServiceIndex
- * the index of the Java service item to open with Java editor
- * when in Java service navigation wizard.
+ * the index of the Java service item to open with Java editor when in Java service navigation wizard.
* @param cursorPosition
- * the cursor position in the VSM expression before triggering
- * navigation with F3 key.
+ * the cursor position in the VSM expression before triggering navigation with F3 key.
*
* @throws InterruptedException
* if a problem occurs.

Back to the top