Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvlorenzo2013-06-21 12:15:24 +0000
committervlorenzo2013-06-21 12:15:24 +0000
commit53409d6a209a6dec52cb64c3581b5209c6e71ee8 (patch)
tree3fe45ee257e47d9e32ba70056936784b07f61523 /tests
parentce52dc8dfb32f82fa2dad68602874cefaf36c153 (diff)
downloadorg.eclipse.papyrus-53409d6a209a6dec52cb64c3581b5209c6e71ee8.tar.gz
org.eclipse.papyrus-53409d6a209a6dec52cb64c3581b5209c6e71ee8.tar.xz
org.eclipse.papyrus-53409d6a209a6dec52cb64c3581b5209c6e71ee8.zip
411338: [Table 2] Papyrus must provides Tests for the Requirement Table
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411338
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/tests/TableCreationInSysMLModelTest.java88
1 files changed, 34 insertions, 54 deletions
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/tests/TableCreationInSysMLModelTest.java b/tests/junit/extraplugins/table/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/tests/TableCreationInSysMLModelTest.java
index cc1d3cb7f39..bde006f7e2e 100644
--- a/tests/junit/extraplugins/table/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/tests/TableCreationInSysMLModelTest.java
+++ b/tests/junit/extraplugins/table/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/tests/TableCreationInSysMLModelTest.java
@@ -139,13 +139,13 @@ public class TableCreationInSysMLModelTest {
};
Display.getDefault().syncExec(runnableWithResult);
- try {
- Platform.getBundle("org.eclipse.papyrus.infra.nattable.common").start(); //$NON-NLS-1$
- Platform.getBundle("org.eclipse.papyrus.sysml.nattable.requirement").start(); //$NON-NLS-1$
- Platform.getBundle("org.eclipse.papyrus.sysml.nattable.requirement.config").start(); //$NON-NLS-1$
- } catch (BundleException e) {
- throw e;
- }
+// try {
+// Platform.getBundle("org.eclipse.papyrus.infra.nattable.common").start(); //$NON-NLS-1$
+// Platform.getBundle("org.eclipse.papyrus.sysml.nattable.requirement").start(); //$NON-NLS-1$
+// Platform.getBundle("org.eclipse.papyrus.sysml.nattable.requirement.config").start(); //$NON-NLS-1$
+// } catch (BundleException e) {
+// throw e;
+// }
Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity());
Assert.assertNotNull(class_);
Assert.assertNotNull(requirement1);
@@ -200,18 +200,13 @@ public class TableCreationInSysMLModelTest {
final ICommand creationCommand = provider.getEditCommand(request);
Assert.assertNotNull(creationCommand);
Assert.assertTrue(creationCommand.canExecute());
- RunnableWithResult<Object> runnable = new RunnableWithResult.Impl<Object>() {//in a runnable to be sure that the table will be refreshed
- @Override
- public void run() {
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(creationCommand));
- NamedElement requirement = TableCreationInSysMLModelTest.rootModel.getMember("Requirement3"); //$NON-NLS-1$
- Assert.assertNotNull(requirement);
- requirement3 = (Class)requirement;
- }
- };
-
- Display.getDefault().syncExec(runnable);
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(creationCommand));
+ NamedElement requirement = TableCreationInSysMLModelTest.rootModel.getMember("Requirement3"); //$NON-NLS-1$
+ Assert.assertNotNull(requirement);
+ requirement3 = (Class)requirement;
+ //to refresh the table content
+ while(Display.getDefault().readAndDispatch());
managedAxis = rowAxisManager.getAllManagedAxis();
Assert.assertEquals(3, managedAxis.size());
Assert.assertTrue(managedAxis.contains(requirement1));
@@ -228,18 +223,12 @@ public class TableCreationInSysMLModelTest {
Assert.assertNotNull(destroyCommand);
Assert.assertTrue(destroyCommand.canExecute());
- runnable = new RunnableWithResult.Impl<Object>() {//in a runnable to be sure that the table will be refreshed
-
- @Override
- public void run() {
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyCommand));
- NamedElement requirement = TableCreationInSysMLModelTest.rootModel.getMember("Requirement3"); //$NON-NLS-1$
- Assert.assertNull(requirement);
- requirement3 = (Class)requirement;
- }
- };
-
- Display.getDefault().syncExec(runnable);
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyCommand));
+ requirement = TableCreationInSysMLModelTest.rootModel.getMember("Requirement3"); //$NON-NLS-1$
+ Assert.assertNull(requirement);
+ requirement3 = (Class)requirement;
+ //to refresh the table content
+ while(Display.getDefault().readAndDispatch());
managedAxis = rowAxisManager.getAllManagedAxis();
Assert.assertEquals(2, managedAxis.size());
Assert.assertTrue(managedAxis.contains(requirement1));
@@ -279,18 +268,14 @@ public class TableCreationInSysMLModelTest {
final ICommand creationCommand = provider.getEditCommand(request);
Assert.assertNotNull(creationCommand);
Assert.assertTrue(creationCommand.canExecute());
- RunnableWithResult<Object> runnable = new RunnableWithResult.Impl<Object>() {//in a runnable to be sure that the table will be refreshed
- @Override
- public void run() {
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(creationCommand));
- NamedElement requirement = TableCreationInSysMLModelTest.rootModel.getMember("Requirement1"); //$NON-NLS-1$
- Assert.assertNotNull(requirement);
- nestedRequirement3 = (Class)requirement;
- }
- };
-
- Display.getDefault().syncExec(runnable);
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(creationCommand));
+ NamedElement requirement = TableCreationInSysMLModelTest.requirement1.getMember("Requirement1"); //$NON-NLS-1$
+ Assert.assertNotNull(requirement);
+ nestedRequirement3 = (Class)requirement;
+
+ //to refresh the table content
+ while(Display.getDefault().readAndDispatch());
managedAxis = rowAxisManager.getAllManagedAxis();
Assert.assertEquals(3, managedAxis.size());
Assert.assertTrue(managedAxis.contains(nestedRequirement1));
@@ -306,19 +291,15 @@ public class TableCreationInSysMLModelTest {
final ICommand destroyCommand = provider.getEditCommand(destroyRequest);
Assert.assertNotNull(destroyCommand);
Assert.assertTrue(destroyCommand.canExecute());
+
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyCommand));
+ requirement = TableCreationInSysMLModelTest.requirement1.getMember("Requirement1"); //$NON-NLS-1$
+ Assert.assertNull(requirement);
+ nestedRequirement3 = (Class)requirement;
+
+ //to refresh the table content
+ while(Display.getDefault().readAndDispatch());
- runnable = new RunnableWithResult.Impl<Object>() {//in a runnable to be sure that the table will be refreshed
-
- @Override
- public void run() {
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyCommand));
- NamedElement requirement = TableCreationInSysMLModelTest.rootModel.getMember("Requirement1"); //$NON-NLS-1$
- Assert.assertNull(requirement);
- nestedRequirement3 = (Class)requirement;
- }
- };
-
- Display.getDefault().syncExec(runnable);
managedAxis = rowAxisManager.getAllManagedAxis();
Assert.assertEquals(2, managedAxis.size());
Assert.assertTrue(managedAxis.contains(nestedRequirement1));
@@ -329,5 +310,4 @@ public class TableCreationInSysMLModelTest {
Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(nestedRequirement2));
}
- //FIXME : test syncrho sur requirements fils!
}

Back to the top