Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Lorenzo2016-05-27 11:12:02 +0000
committerGerrit Code Review @ Eclipse.org2016-05-27 13:00:50 +0000
commit099d89f83f8dc826b473f6d7449fcf0ab6e7e8fd (patch)
tree7fd1909b0177015d2b77ae37cf8d74b3b304b56d /tests
parent5a1636c8922c25d47a56c5a112668d129346352f (diff)
downloadorg.eclipse.papyrus-099d89f83f8dc826b473f6d7449fcf0ab6e7e8fd.tar.gz
org.eclipse.papyrus-099d89f83f8dc826b473f6d7449fcf0ab6e7e8fd.tar.xz
org.eclipse.papyrus-099d89f83f8dc826b473f6d7449fcf0ab6e7e8fd.zip
bug 494740: [Table] JUnit tests of class org.eclipse.papyrus.uml.nattable.generic.tests.bugs.StereotypeInheritDisplayTest.testStereotypePropeties don't work
Change-Id: I50a46f6581830b011a4683451f83384c255c1bf0 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/StereotypeInheritDisplayTest.java18
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/CellEditorsConfigurationTest.java113
2 files changed, 65 insertions, 66 deletions
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/StereotypeInheritDisplayTest.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/StereotypeInheritDisplayTest.java
index ad01e9ae0d2..ad3e8d48a94 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/StereotypeInheritDisplayTest.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/StereotypeInheritDisplayTest.java
@@ -24,6 +24,10 @@ import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusT
import org.eclipse.papyrus.junit.utils.TableUtils;
import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleBooleanCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleIntegerCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleRealCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleStringCellEditorConfiguration;
import org.eclipse.ui.IEditorPart;
import org.eclipse.uml2.uml.Model;
import org.junit.Assert;
@@ -76,7 +80,7 @@ public class StereotypeInheritDisplayTest extends AbstractPapyrusTest {
* The caught exception.
*/
@Test
- public void testStereotypePropeties() throws Exception {
+ public void testStereotypeProperties() throws Exception {
// Open the table and get the manager
final IPageManager pageManager = fixture.getPageManager();
final List<Object> pages = pageManager.allPages();
@@ -107,26 +111,22 @@ public class StereotypeInheritDisplayTest extends AbstractPapyrusTest {
final ILayerCell cell0 = currentManager.getBodyLayerStack().getCellByPosition(0, 0);
Assert.assertNotEquals("The first cell must have config labels", null, cell0.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The first cell must have at least one cell editor configuration", 0, cell0.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The first cell editor must be an UMLStereotypeSingleStringCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleStringCellEditorConfiguration.MultiLineText0", //$NON-NLS-1$ //$NON-NLS-2$
- cell0.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The first cell editor is not the expected one", UMLStereotypeSingleStringCellEditorConfiguration.ID + "0", cell0.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
final ILayerCell cell1 = currentManager.getBodyLayerStack().getCellByPosition(1, 0);
Assert.assertNotEquals("The second cell must have config labels", null, cell1.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The second cell must have at least one cell editor configuration", 0, cell1.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The second cell editor must be an UMLStereotypeSingleBooleanCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleBooleanCellEditorConfiguration.CheckBox1", //$NON-NLS-1$ //$NON-NLS-2$
- cell1.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The second cell editor is not the expected one", UMLStereotypeSingleBooleanCellEditorConfiguration.ID + "1", cell1.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
final ILayerCell cell2 = currentManager.getBodyLayerStack().getCellByPosition(2, 0);
Assert.assertNotEquals("The third cell must have config labels", null, cell2.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The third cell must have at least one cell editor configuration", 0, cell2.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The third cell editor must be an UMLStereotypeSingleIntegerCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleIntegerCellEditorConfiguration.Text2", //$NON-NLS-1$ //$NON-NLS-2$
- cell2.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The third cell editor is not the expected one", UMLStereotypeSingleIntegerCellEditorConfiguration.ID + "2", cell2.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
final ILayerCell cell3 = currentManager.getBodyLayerStack().getCellByPosition(3, 0);
Assert.assertNotEquals("The fourth cell must have config labels", null, cell3.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The fourth cell must have at least one cell editor configuration", 0, cell3.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The fourth cell editor must be an UMLStereotypeSingleRealCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleRealCellEditorConfiguration.Text3", //$NON-NLS-1$ //$NON-NLS-2$
- cell3.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The fourth cell editor is not the expected one", UMLStereotypeSingleRealCellEditorConfiguration.ID + "3", cell3.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
// Check the values
Assert.assertEquals("The first value is not the expected one", "Vincent", currentManager.getDataValue(0, 0)); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/CellEditorsConfigurationTest.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/CellEditorsConfigurationTest.java
index 93fb07e7bad..1647b764ec3 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/CellEditorsConfigurationTest.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/CellEditorsConfigurationTest.java
@@ -24,6 +24,20 @@ import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusT
import org.eclipse.papyrus.junit.utils.TableUtils;
import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiBooleanCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiIntegerCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiRealCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiStringCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiUMLEnumerationCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiUMLReferenceCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeMultiUnlimitedNaturalCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleBooleanCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleIntegerCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleRealCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleStringCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleUMLEnumerationCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleUMLReferenceCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.config.UMLStereotypeSingleUnlimitedNaturalCellEditorConfiguration;
import org.eclipse.ui.IEditorPart;
import org.eclipse.uml2.uml.Model;
import org.junit.Assert;
@@ -76,7 +90,7 @@ public class CellEditorsConfigurationTest extends AbstractPapyrusTest {
* The exception.
*/
@Test
- public void testCellEditorsConfigruation() throws Exception {
+ public void testCellEditorsConfiguration() throws Exception {
// Open the table and get the manager
IPageManager pageManager = fixture.getPageManager();
List<Object> pages = pageManager.allPages();
@@ -86,7 +100,7 @@ public class CellEditorsConfigurationTest extends AbstractPapyrusTest {
NatTableEditor editor = (NatTableEditor) part;
INattableModelManager currentManager = (INattableModelManager) editor.getAdapter(INattableModelManager.class);
Assert.assertTrue(currentManager instanceof INattableModelManager);
-
+
int nbUMLCellEditors = checkUMLCellEditors(currentManager, 0);
checkEMFCellEditors(currentManager, nbUMLCellEditors);
}
@@ -94,186 +108,171 @@ public class CellEditorsConfigurationTest extends AbstractPapyrusTest {
/**
* This allows to check the cell editors corresponding to UML Types.
*
- * @param currentManager the current nattable model manager.
- * @param nbCellsBefore The number of cells before the first one.
+ * @param currentManager
+ * the current nattable model manager.
+ * @param nbCellsBefore
+ * The number of cells before the first one.
*/
private int checkUMLCellEditors(final INattableModelManager currentManager, final int nbCellsBefore) {
-
+
int currentCellNumber = nbCellsBefore;
-
+
// The first cell must be an UMLStereotypeSingleUMLBooleanCellEditorConfiguration
final ILayerCell cell0 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The first UML cell must have config labels", null, cell0.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The first UML cell must have at least one cell editor configuration", 0, cell0.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The first UML cell editor must be an UMLStereotypeSingleUMLBooleanCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleUMLBooleanCellEditorConfiguration.CheckBox" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell0.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The first UML cell editor is not the expected one", UMLStereotypeSingleBooleanCellEditorConfiguration.ID + currentCellNumber, cell0.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
+
currentCellNumber++;
// The second cell must be an UMLStereotypeMultiUMLBooleanCellEditorConfiguration
final ILayerCell cell1 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The second UML cell must have config labels", null, cell1.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The second UML cell must have at least one cell editor configuration", 0, cell1.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The second UML cell editor must be an UMLStereotypeMultiUMLBooleanCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiUMLBooleanCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell1.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The second UML cell editor is not the expected one", UMLStereotypeMultiBooleanCellEditorConfiguration.ID + currentCellNumber, cell1.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The third cell must be an UMLStereotypeSingleUMLEnumerationCellEditorConfiguration
final ILayerCell cell2 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The third UML cell must have config labels", null, cell2.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The third UML cell must have at least one cell editor configuration", 0, cell2.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The third UML cell editor must be an UMLStereotypeSingleUMLEnumerationCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleUMLEnumerationCellEditorConfiguration.ComboBox" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell2.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The third UML cell editor is not the expected one", UMLStereotypeSingleUMLEnumerationCellEditorConfiguration.ID + currentCellNumber, cell2.getConfigLabels().getLabels().get(0));// $NON-NLS-1$
currentCellNumber++;
// The fourth cell must be an UMLStereotypeMultiUMLEnumerationCellEditorConfiguration
final ILayerCell cell3 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The fourth UML cell must have config labels", null, cell3.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The fourth UML cell must have at least one cell editor configuration", 0, cell3.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The fourth UML cell editor must be an UMLStereotypeMultiUMLEnumerationCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiUMLEnumerationCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell3.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The fourth cell editor is not the expected one", UMLStereotypeMultiUMLEnumerationCellEditorConfiguration.ID + currentCellNumber, cell3.getConfigLabels().getLabels().get(0));// $NON-NLS-1$
currentCellNumber++;
// The fifth cell must be an UMLStereotypeSingleUMLIntegerCellEditorConfiguration
final ILayerCell cell4 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The fifth UML cell must have config labels", null, cell4.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The fifth UML cell must have at least one cell editor configuration", 0, cell4.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The fifth UML cell editor must be an UMLStereotypeSingleUMLIntegerCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleUMLIntegerCellEditorConfiguration.Text" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell4.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The fifth UML cell editor is not the expected one", UMLStereotypeSingleIntegerCellEditorConfiguration.ID + currentCellNumber, cell4.getConfigLabels().getLabels().get(0)); // $NON-NLS-1$
currentCellNumber++;
// The sixth cell must be an UMLStereotypeMultiUMLIntegerCellEditorConfiguration
final ILayerCell cell5 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The sixth UML cell must have config labels", null, cell5.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The sixth UML cell must have at least one cell editor configuration", 0, cell5.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The sixth UML cell editor must be an UMLStereotypeMultiUMLIntegerCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiUMLIntegerCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell5.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The sixth UML cell editor is not the expected one", UMLStereotypeMultiIntegerCellEditorConfiguration.ID + currentCellNumber, cell5.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The seventh cell must be an UMLStereotypeSingleUMLStringCellEditorConfiguration
final ILayerCell cell6 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The seventh UML cell must have config labels", null, cell6.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The seventh UML cell must have at least one cell editor configuration", 0, cell6.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The seventh UML cell editor must be an UMLStereotypeSingleUMLStringCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleUMLStringCellEditorConfiguration.MultiLineText" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell6.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The seventh UML cell editoris not the expected one", UMLStereotypeSingleStringCellEditorConfiguration.ID + currentCellNumber, cell6.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The height cell must be an UMLStereotypeMultiUMLStringCellEditorConfiguration
final ILayerCell cell7 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
- Assert.assertNotEquals("The height UML cell must have config labels", null, cell7.getConfigLabels()); //$NON-NLS-1$
- Assert.assertNotEquals("The height UML cell must have at least one cell editor configuration", 0, cell7.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The height UML cell editor must be an UMLStereotypeMultiUMLStringCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiUMLStringCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell7.getConfigLabels().getLabels().get(0));
+ Assert.assertNotEquals("The eighth UML cell must have config labels", null, cell7.getConfigLabels()); //$NON-NLS-1$
+ Assert.assertNotEquals("The eighth UML cell must have at least one cell editor configuration", 0, cell7.getConfigLabels().getLabels().size()); //$NON-NLS-1$
+ Assert.assertEquals("The eighth UML cell editor is not the expected one", UMLStereotypeMultiStringCellEditorConfiguration.ID + currentCellNumber, cell7.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The ninth cell must be an UMLStereotypeSingleUnlimitedNaturalCellEditorConfiguration
final ILayerCell cell8 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The ninth UML cell must have config labels", null, cell8.getConfigLabels());
Assert.assertNotEquals("The ninth UML cell must have at least one cell editor configuration", 0, cell8.getConfigLabels().getLabels().size());
- Assert.assertEquals("The ninth UML cell editor must be an UMLStereotypeSingleUnlimitedNaturalCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleUnlimitedNaturalCellEditorConfiguration.Text" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell8.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The ninth UML cell editor is not the expected one", UMLStereotypeSingleUnlimitedNaturalCellEditorConfiguration.ID + currentCellNumber, cell8.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The tenth cell must be an UMLStereotypeMultiUnlimitedNaturalCellEditorConfiguration
final ILayerCell cell9 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The tenth UML cell must have config labels", null, cell9.getConfigLabels());
Assert.assertNotEquals("The tenth UML cell must have at least one cell editor configuration", 0, cell9.getConfigLabels().getLabels().size());
- Assert.assertEquals("The tenth UML cell editor must be an UMLStereotypeMultiUnlimitedNaturalCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiUnlimitedNaturalCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell9.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The tenth UML cell editoris not the expected one", UMLStereotypeMultiUnlimitedNaturalCellEditorConfiguration.ID + currentCellNumber, cell9.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
-
+
// The eleventh cell must be an UMLStereotypeSingleRealCellEditorConfiguration
final ILayerCell cell10 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The eleventh UML cell must have config labels", null, cell10.getConfigLabels());
Assert.assertNotEquals("The eleventh UML cell must have at least one cell editor configuration", 0, cell10.getConfigLabels().getLabels().size());
- Assert.assertEquals("The eleventh UML cell editor must be an UMLStereotypeSingleRealCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleRealCellEditorConfiguration.Text" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell10.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The eleventh UML cell editor is not the expected one", UMLStereotypeSingleRealCellEditorConfiguration.ID + currentCellNumber, cell10.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The twelveth cell must be an UMLStereotypeSingleRealCellEditorConfiguration
final ILayerCell cell11 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The twelveth UML cell must have config labels", null, cell11.getConfigLabels());
Assert.assertNotEquals("The twelveth UML cell must have at least one cell editor configuration", 0, cell11.getConfigLabels().getLabels().size());
- Assert.assertEquals("The twelveth UML cell editor must be an UMLStereotypeMultiRealCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiRealCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell11.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The twelveth UML cell editoris not the expected one", UMLStereotypeMultiRealCellEditorConfiguration.ID + currentCellNumber, cell11.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The thirteenth cell must be an UMLStereotypeMultiRealCellEditorConfiguration
final ILayerCell cell12 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The thirteenth UML cell must have config labels", null, cell12.getConfigLabels());
Assert.assertNotEquals("The thirteenth UML cell must have at least one cell editor configuration", 0, cell12.getConfigLabels().getLabels().size());
- Assert.assertEquals("The thirteenth UML cell editor must be an UMLStereotypeSingleUMLReferenceCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleUMLReferenceCellEditorConfiguration.Reference" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell12.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The thirteenth UML cell editor is not the expected one", UMLStereotypeSingleUMLReferenceCellEditorConfiguration.ID + currentCellNumber, cell12.getConfigLabels().getLabels().get(0));//$NON-NLS-1$
currentCellNumber++;
// The fourteenth cell must be an UMLStereotypeMultiUMLReferenceCellEditorConfiguration
final ILayerCell cell13 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The fourteenth UML cell must have config labels", null, cell13.getConfigLabels());
Assert.assertNotEquals("The fourteenth UML cell must have at least one cell editor configuration", 0, cell13.getConfigLabels().getLabels().size());
- Assert.assertEquals("The fourteenth UML cell editor must be an UMLStereotypeMultiUMLReferenceCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiUMLReferenceCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell13.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The fourteenth UML cell editor is not the expected one", UMLStereotypeMultiUMLReferenceCellEditorConfiguration.ID + currentCellNumber, cell13.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
-
+
return currentCellNumber;
}
-
+
/**
* This allows to check the cell editors corresponding to EMF Types.
*
- * @param currentManager The current nattable model manager.
- * @param nbCellsBefore The number of cells before the first one.
+ * @param currentManager
+ * The current nattable model manager.
+ * @param nbCellsBefore
+ * The number of cells before the first one.
*/
private int checkEMFCellEditors(final INattableModelManager currentManager, final int nbCellsBefore) {
-
+
int currentCellNumber = nbCellsBefore;
-
+
// The first cell must be an UMLStereotypeSingleBooleanCellEditorConfiguration
final ILayerCell cell0 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The first EMF cell must have config labels", null, cell0.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The first EMF cell must have at least one cell editor configuration", 0, cell0.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The first EMF cell editor must be an UMLStereotypeSingleBooleanCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleBooleanCellEditorConfiguration.CheckBox" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell0.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The first EMF cell editor is not the expected one", UMLStereotypeSingleBooleanCellEditorConfiguration.ID + currentCellNumber, cell0.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
// The second cell must be an UMLStereotypeMultiBooleanCellEditorConfiguration
final ILayerCell cell1 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The second EMF cell must have config labels", null, cell1.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The second EMF cell must have at least one cell editor configuration", 0, cell1.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The second EMF cell editor must be an UMLStereotypeMultiBooleanCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiBooleanCellEditorConfiguration.MultiEditor" +currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell1.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The second EMF cell editor is not the expected onen", UMLStereotypeMultiBooleanCellEditorConfiguration.ID + currentCellNumber, cell1.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
-
+
// The third cell must be an UMLStereotypeSingleIntegerCellEditorConfiguration
final ILayerCell cell2 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The third EMF cell must have config labels", null, cell2.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The third EMF cell must have at least one cell editor configuration", 0, cell2.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The third EMF cell editor must be an UMLStereotypeSingleIntegerCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleIntegerCellEditorConfiguration.Text" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell2.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The third EMF cell editor is not the expected one", UMLStereotypeSingleIntegerCellEditorConfiguration.ID + currentCellNumber, cell2.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
// The fourth cell must be an UMLStereotypeMultiIntegerCellEditorConfiguration
final ILayerCell cell3 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The fourth EMF cell must have config labels", null, cell3.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The fourth EMF cell must have at least one cell editor configuration", 0, cell3.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The fourth EMF cell editor must be an UMLStereotypeMultiIntegerCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiIntegerCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell3.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The fourth EMF cell editor is not the expected one", UMLStereotypeMultiIntegerCellEditorConfiguration.ID + currentCellNumber, cell3.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
// The fifth cell must be an UMLStereotypeSingleStringCellEditorConfiguration
final ILayerCell cell4 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The fifth EMF cell must have config labels", null, cell4.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The fifth EMF cell must have at least one cell editor configuration", 0, cell4.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The fifth EMF cell editor must be an UMLStereotypeSingleStringCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeSingleStringCellEditorConfiguration.MultiLineText" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell4.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The fifth EMF cell editor is not the expected one", UMLStereotypeSingleStringCellEditorConfiguration.ID + currentCellNumber, cell4.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
// The sixth cell must be an UMLStereotypeMultiStringCellEditorConfiguration
final ILayerCell cell5 = currentManager.getBodyLayerStack().getCellByPosition(currentCellNumber, 0);
Assert.assertNotEquals("The sixth EMF cell must have config labels", null, cell5.getConfigLabels()); //$NON-NLS-1$
Assert.assertNotEquals("The sixth EMF cell must have at least one cell editor configuration", 0, cell5.getConfigLabels().getLabels().size()); //$NON-NLS-1$
- Assert.assertEquals("The sixth EMF cell editor must be an UMLStereotypeMultiStringCellEditorConfiguration", "org.eclipse.papyrus.uml.nattable.celleditor.configuration.UMLStereotypeMultiStringCellEditorConfiguration.MultiEditor" + currentCellNumber, //$NON-NLS-1$ //$NON-NLS-2$
- cell5.getConfigLabels().getLabels().get(0));
+ Assert.assertEquals("The sixth EMF cell editor is not the expected one", UMLStereotypeMultiStringCellEditorConfiguration.ID + currentCellNumber, cell5.getConfigLabels().getLabels().get(0)); //$NON-NLS-1$
currentCellNumber++;
-
+
return currentCellNumber;
}

Back to the top