Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authortfesenko2010-08-18 08:21:39 +0000
committertfesenko2010-08-18 08:21:39 +0000
commitf572a5e7b728b7402db3fc3fd5e748cff45ca819 (patch)
tree1208a2311e0567e25f0960da5aecc87e3fdcf8ba /tests
parent6a637a8fb0e2beabb46afe8d1ec29ac14f6188b1 (diff)
downloadorg.eclipse.papyrus-f572a5e7b728b7402db3fc3fd5e748cff45ca819.tar.gz
org.eclipse.papyrus-f572a5e7b728b7402db3fc3fd5e748cff45ca819.tar.xz
org.eclipse.papyrus-f572a5e7b728b7402db3fc3fd5e748cff45ca819.zip
314614 [Wizard] Add SelectDiagramCategory Wizard page - test
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.papyrus.diagram.common.tests/META-INF/MANIFEST.MF6
-rw-r--r--tests/org.eclipse.papyrus.diagram.common.tests/src/org/eclipse/papyrus/diagram/common/tests/wizard/WizardTestCase.java47
2 files changed, 51 insertions, 2 deletions
diff --git a/tests/org.eclipse.papyrus.diagram.common.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.papyrus.diagram.common.tests/META-INF/MANIFEST.MF
index ac564c92915..950314cfa58 100644
--- a/tests/org.eclipse.papyrus.diagram.common.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.papyrus.diagram.common.tests/META-INF/MANIFEST.MF
@@ -7,8 +7,10 @@ Bundle-Activator: org.eclipse.papyrus.diagram.common.tests.Activator
Bundle-Vendor: CEA LIST
Require-Bundle: org.eclipse.core.runtime,
org.junit4,
- org.eclipse.papyrus.diagram.common;bundle-version="0.7.0"
+ org.eclipse.papyrus.diagram.common;bundle-version="0.7.0",
+ org.eclipse.papyrus.wizards;bundle-version="0.7.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.diagram.common.tests,
- org.eclipse.papyrus.diagram.common.tests.parser
+ org.eclipse.papyrus.diagram.common.tests.parser,
+ org.eclipse.papyrus.diagram.common.tests.wizard
diff --git a/tests/org.eclipse.papyrus.diagram.common.tests/src/org/eclipse/papyrus/diagram/common/tests/wizard/WizardTestCase.java b/tests/org.eclipse.papyrus.diagram.common.tests/src/org/eclipse/papyrus/diagram/common/tests/wizard/WizardTestCase.java
new file mode 100644
index 00000000000..11b03380eb6
--- /dev/null
+++ b/tests/org.eclipse.papyrus.diagram.common.tests/src/org/eclipse/papyrus/diagram/common/tests/wizard/WizardTestCase.java
@@ -0,0 +1,47 @@
+package org.eclipse.papyrus.diagram.common.tests.wizard;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.papyrus.wizards.SelectDiagramCategoryPage;
+import org.junit.Test;
+
+
+public class WizardTestCase extends TestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ @Test
+ public void testDefaultDiagramCategory() {
+ final String categoryId = "uml";
+ final IDialogSettings settings = new DialogSettings("") {
+ @Override
+ public String get(String key) {
+ if ("diagramCategory".equals(key)) {
+ return categoryId;
+ }
+ return super.get(key);
+ }
+
+ };
+ SelectDiagramCategoryPage selectDiagramCategoryPage = new SelectDiagramCategoryPage() {
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return settings;
+ }
+ };
+ // selectDiagramCategory is initialized in setWizard(), as wizard is needed to get DialogSettings
+ selectDiagramCategoryPage.setWizard(null);
+ assertEquals(categoryId, selectDiagramCategoryPage.getDiagramCategory());
+ }
+
+}

Back to the top