Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian W. Damus2015-12-10 21:23:17 +0000
committerChristian W. Damus2015-12-10 21:28:58 +0000
commita29d8bc5bff15223f2a74c2ea16e3293a4920a52 (patch)
tree87001f0aab2f00c851bf65135af25beafa2dbfb9 /tests
parentd63a234173147425b1cc8cbe4689e00bd28d6ad3 (diff)
downloadorg.eclipse.papyrus-a29d8bc5bff15223f2a74c2ea16e3293a4920a52.tar.gz
org.eclipse.papyrus-a29d8bc5bff15223f2a74c2ea16e3293a4920a52.tar.xz
org.eclipse.papyrus-a29d8bc5bff15223f2a74c2ea16e3293a4920a52.zip
Bug 469188: [Editor] Page management improvements in the Papyrus multi-editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=469188 Implement sashes in the Welcome Page to give the user even more control over the layout of its contents. Model the sash layout to persist it for restoration of the layout when opening the editor.
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashColumnTest.java141
-rw-r--r--tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashRowTest.java107
-rw-r--r--tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomePageTest.java47
-rw-r--r--tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomeTests.java1
4 files changed, 296 insertions, 0 deletions
diff --git a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashColumnTest.java b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashColumnTest.java
new file mode 100644
index 00000000000..b1c8cadc005
--- /dev/null
+++ b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashColumnTest.java
@@ -0,0 +1,141 @@
+/**
+ * Copyright (c) 2015 Christian W. Damus 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:
+ * Christian W. Damus - Initial API and implementation
+ *
+ */
+package org.eclipse.papyrus.infra.editor.welcome.tests;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.eclipse.papyrus.infra.editor.welcome.SashColumn;
+import org.eclipse.papyrus.infra.editor.welcome.WelcomeFactory;
+
+import junit.framework.TestCase;
+import junit.textui.TestRunner;
+
+/**
+ * <!-- begin-user-doc -->
+ * A test case for the model object '<em><b>Sash Column</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following operations are tested:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.editor.welcome.SashColumn#getSashRow(int) <em>Get Sash Row</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SashColumnTest extends TestCase {
+
+ /**
+ * The fixture for this Sash Column test case.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected SashColumn fixture = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static void main(String[] args) {
+ TestRunner.run(SashColumnTest.class);
+ }
+
+ /**
+ * Constructs a new Sash Column test case with the given name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public SashColumnTest(String name) {
+ super(name);
+ }
+
+ /**
+ * Sets the fixture for this Sash Column test case.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void setFixture(SashColumn fixture) {
+ this.fixture = fixture;
+ }
+
+ /**
+ * Returns the fixture for this Sash Column test case.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected SashColumn getFixture() {
+ return fixture;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see junit.framework.TestCase#setUp()
+ * @generated NOT
+ */
+ @Override
+ protected void setUp() throws Exception {
+ setFixture(WelcomeFactory.eINSTANCE.createSashColumn());
+ configureFixture();
+ }
+
+ protected void configureFixture() {
+ SashColumn fixture = getFixture();
+
+ fixture.createSashRow().setY(1);
+ fixture.createSashRow().setY(2);
+ fixture.createSashRow().setY(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see junit.framework.TestCase#tearDown()
+ * @generated
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ setFixture(null);
+ }
+
+ /**
+ * Tests the '{@link org.eclipse.papyrus.infra.editor.welcome.SashColumn#getSashRow(int) <em>Get Sash Row</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.infra.editor.welcome.SashColumn#getSashRow(int)
+ * @generated NOT
+ */
+ public void testGetSashRow__int() {
+ assertThat(getFixture().getSashRow(-1), nullValue());
+ assertThat(getFixture().getSashRow(3), nullValue());
+ assertThat(getFixture().getSashRow(1), notNullValue());
+ assertThat(getFixture().getSashRow(1).getY(), is(2));
+ }
+
+} // SashColumnTest
diff --git a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashRowTest.java b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashRowTest.java
new file mode 100644
index 00000000000..ad540bea6f9
--- /dev/null
+++ b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/SashRowTest.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2015 Christian W. Damus 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:
+ * Christian W. Damus - Initial API and implementation
+ *
+ */
+package org.eclipse.papyrus.infra.editor.welcome.tests;
+
+import junit.framework.TestCase;
+
+import junit.textui.TestRunner;
+
+import org.eclipse.papyrus.infra.editor.welcome.SashRow;
+import org.eclipse.papyrus.infra.editor.welcome.WelcomeFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * A test case for the model object '<em><b>Sash Row</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class SashRowTest extends TestCase {
+
+ /**
+ * The fixture for this Sash Row test case.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected SashRow fixture = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static void main(String[] args) {
+ TestRunner.run(SashRowTest.class);
+ }
+
+ /**
+ * Constructs a new Sash Row test case with the given name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public SashRowTest(String name) {
+ super(name);
+ }
+
+ /**
+ * Sets the fixture for this Sash Row test case.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void setFixture(SashRow fixture) {
+ this.fixture = fixture;
+ }
+
+ /**
+ * Returns the fixture for this Sash Row test case.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected SashRow getFixture() {
+ return fixture;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see junit.framework.TestCase#setUp()
+ * @generated
+ */
+ @Override
+ protected void setUp() throws Exception {
+ setFixture(WelcomeFactory.eINSTANCE.createSashRow());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see junit.framework.TestCase#tearDown()
+ * @generated
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ setFixture(null);
+ }
+
+} // SashRowTest
diff --git a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomePageTest.java b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomePageTest.java
index 7790071bb42..85349926673 100644
--- a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomePageTest.java
+++ b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomePageTest.java
@@ -15,12 +15,15 @@ package org.eclipse.papyrus.infra.editor.welcome.tests;
import static org.eclipse.papyrus.infra.editor.welcome.tests.WelcomeMatchers.identifiedBy;
import static org.hamcrest.CoreMatchers.both;
import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.Arrays;
+import org.eclipse.papyrus.infra.editor.welcome.SashColumn;
import org.eclipse.papyrus.infra.editor.welcome.WelcomeFactory;
import org.eclipse.papyrus.infra.editor.welcome.WelcomePage;
import org.eclipse.papyrus.infra.editor.welcome.WelcomeSection;
@@ -42,6 +45,8 @@ import junit.textui.TestRunner;
* The following operations are tested:
* <ul>
* <li>{@link org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSection(java.lang.String) <em>Get Section</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSashColumn(int) <em>Get Sash Column</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSashRow(int, int) <em>Get Sash Row</em>}</li>
* </ul>
* </p>
*
@@ -120,6 +125,16 @@ public class WelcomePageTest extends TestCase {
createSection("b", "c", "d");
createSection(true, "e", "f");
createSection("g");
+
+ WelcomePage fixture = getFixture();
+ fixture.createSashColumn().setX(1);
+ fixture.createSashColumn().setX(2);
+ fixture.createSashColumn().setX(3);
+
+ SashColumn col1 = fixture.getSashColumns().get(1);
+ col1.createSashRow().setY(1);
+ col1.createSashRow().setY(2);
+ col1.createSashRow().setY(3);
}
protected WelcomeSection createSection(WelcomePage page, boolean hidden, String... id) {
@@ -182,4 +197,36 @@ public class WelcomePageTest extends TestCase {
assertThat(getFixture().getSection("f"), identifiedBy("e")); // hidden
}
+ /**
+ * Tests the '{@link org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSashColumn(int) <em>Get Sash Column</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSashColumn(int)
+ * @generated NOT
+ */
+ public void testGetSashColumn__int() {
+ assertThat(getFixture().getSashColumn(-1), nullValue());
+ assertThat(getFixture().getSashColumn(3), nullValue());
+ assertThat(getFixture().getSashColumn(1), notNullValue());
+ assertThat(getFixture().getSashColumn(1).getX(), is(2));
+ }
+
+ /**
+ * Tests the '{@link org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSashRow(int, int) <em>Get Sash Row</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.infra.editor.welcome.WelcomePage#getSashRow(int, int)
+ * @generated NOT
+ */
+ public void testGetSashRow__int_int() {
+ assertThat(getFixture().getSashRow(-1, 0), nullValue());
+ assertThat(getFixture().getSashRow(3, 0), nullValue());
+ assertThat(getFixture().getSashRow(1, -1), nullValue());
+ assertThat(getFixture().getSashRow(1, 3), nullValue());
+ assertThat(getFixture().getSashRow(1, 1), notNullValue());
+ assertThat(getFixture().getSashRow(1, 1).getY(), is(2));
+ }
+
} // WelcomePageTest
diff --git a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomeTests.java b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomeTests.java
index 7c43d7d59db..c5bcc24557e 100644
--- a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomeTests.java
+++ b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/src-gen/org/eclipse/papyrus/infra/editor/welcome/tests/WelcomeTests.java
@@ -45,6 +45,7 @@ public class WelcomeTests extends TestSuite {
TestSuite suite = new WelcomeTests("welcome Tests"); //$NON-NLS-1$
suite.addTestSuite(WelcomePageTest.class);
suite.addTestSuite(WelcomeSectionTest.class);
+ suite.addTestSuite(SashColumnTest.class);
return suite;
}

Back to the top