Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.matrix.tests/src/org/eclipse/papyrus/uml/nattable/matrix/tests/tests/OpenDependencyMatrixTest.java')
-rwxr-xr-xtests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.matrix.tests/src/org/eclipse/papyrus/uml/nattable/matrix/tests/tests/OpenDependencyMatrixTest.java80
1 files changed, 80 insertions, 0 deletions
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.matrix.tests/src/org/eclipse/papyrus/uml/nattable/matrix/tests/tests/OpenDependencyMatrixTest.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.matrix.tests/src/org/eclipse/papyrus/uml/nattable/matrix/tests/tests/OpenDependencyMatrixTest.java
new file mode 100755
index 00000000000..1dcf1532c9e
--- /dev/null
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.matrix.tests/src/org/eclipse/papyrus/uml/nattable/matrix/tests/tests/OpenDependencyMatrixTest.java
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * 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:
+ * Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.nattable.matrix.tests.tests;
+
+import java.util.List;
+
+import org.eclipse.papyrus.junit.utils.rules.ActiveTable;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ * This class checks an existing matrix after opening it.
+ *
+ */
+@PluginResource("resources/openDependencyMatrixTests/open_matrix.di")
+public class OpenDependencyMatrixTest extends AbstractTableTest {
+
+ /**
+ * the number of classes in the tested model
+ */
+ private static final int NB_CLASSES = 7;
+
+ /**
+ * the number of columns in the tested matrix
+ */
+ private static final int NB_COLUMNS = NB_CLASSES;
+
+ /**
+ * the number of rows in the tested matrix
+ */
+ private static final int NB_ROWS = NB_CLASSES + 2; // +1 for the context package and +1 for the TreeFillingConfiguration
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.nattable.matrix.tests.tests.AbstractTableTest#getSourcePath()
+ *
+ * @return
+ */
+ protected String getSourcePath() {
+ return "resources/openDependencyMatrixTests/"; //$NON-NLS-1$
+ }
+
+ /**
+ * This JUnit tests check the opening of an existing matrix
+ */
+ @Test
+ @ActiveTable("MatrixOfRelationships")
+ public void testOpeningMatrix() {
+ initTest();
+ final List<Object> rowElementsList = this.manager.getRowElementsList();
+ final List<Object> columnElementsList = this.manager.getColumnElementsList();
+ Assert.assertEquals("The number of rows is not the expected one.", NB_ROWS, rowElementsList.size()); //$NON-NLS-1$
+ Assert.assertEquals("The number of columns is not the expected one.", NB_COLUMNS, columnElementsList.size()); //$NON-NLS-1$
+ }
+
+ /**
+ * This JUnit tests check the opening of an existing matrix
+ *
+ * @throws Exception
+ */
+ @Test
+ @ActiveTable("MatrixOfRelationships")
+ public void testMatrixContents() throws Exception {
+ initTest();
+ checkTableContent(manager, "");// no suffix here //$NON-NLS-1$
+ }
+}

Back to the top