summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-08-07 04:37:05 (EDT)
committerCarsten Drossel2008-08-07 04:37:05 (EDT)
commitd3e06af3dedd779bd213fea2441b34eb9f44a189 (patch)
tree3c9ecdea0cc038f9c44eda8f8637099c4d359f1e
parent529de3977cf14bb3e4c4e6aae4b5a0c9bfa22957 (diff)
downloadorg.eclipse.riena-d3e06af3dedd779bd213fea2441b34eb9f44a189.zip
org.eclipse.riena-d3e06af3dedd779bd213fea2441b34eb9f44a189.tar.gz
org.eclipse.riena-d3e06af3dedd779bd213fea2441b34eb9f44a189.tar.bz2
added test for NavigationProcessor
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/AllTests.java29
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java66
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.xml22
3 files changed, 117 insertions, 0 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/AllTests.java
new file mode 100644
index 0000000..3e17ac2
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/AllTests.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.navigation.model;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ *
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.riena.navigation.model");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(NavigationProcessorTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java
new file mode 100644
index 0000000..598f4b1
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.navigation.model;
+
+import org.eclipse.riena.navigation.IApplicationModel;
+import org.eclipse.riena.navigation.IModuleGroupNode;
+import org.eclipse.riena.navigation.IModuleNode;
+import org.eclipse.riena.navigation.ISubApplicationNode;
+import org.eclipse.riena.navigation.ISubModuleNode;
+import org.eclipse.riena.tests.RienaTestCase;
+
+/**
+ * Tests for the NavigationProcessor.
+ */
+public class NavigationProcessorTest extends RienaTestCase {
+
+ private NavigationProcessor navigationProcessor;
+ private IApplicationModel applicationModel;
+ private ISubApplicationNode subApplication;
+ private IModuleGroupNode moduleGroup;
+ private IModuleNode module;
+ private ISubModuleNode subModule;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ addPluginXml(NavigationProcessorTest.class, "NavigationProcessorTest.xml");
+
+ applicationModel = new ApplicationModel();
+ navigationProcessor = new NavigationProcessor();
+ applicationModel.setNavigationProcessor(navigationProcessor);
+
+ subApplication = new SubApplicationNode();
+ applicationModel.addChild(subApplication);
+ moduleGroup = new ModuleGroupNode();
+ subApplication.addChild(moduleGroup);
+ module = new ModuleNode();
+ moduleGroup.addChild(module);
+ subModule = new SubModuleNode();
+ module.addChild(subModule);
+ }
+
+ public void testActivateChildren() throws Exception {
+
+ assertFalse(subApplication.isActivated());
+ assertFalse(moduleGroup.isActivated());
+ assertFalse(module.isActivated());
+ assertFalse(subModule.isActivated());
+
+ navigationProcessor.activate(subApplication);
+
+ assertTrue(subApplication.isActivated());
+ assertTrue(moduleGroup.isActivated());
+ assertTrue(module.isActivated());
+ assertTrue(subModule.isActivated());
+ }
+
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.xml b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.xml
new file mode 100644
index 0000000..ce08b5a
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="testSharedViewId"
+ view="org.eclipse.riena.navigation.ui.swt.views.TestView"
+ viewController="org.eclipse.riena.navigation.ui.controllers.SubModuleController"
+ viewShared="true">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="testNotSharedViewId"
+ view="org.eclipse.riena.navigation.ui.swt.views.TestView"
+ viewController="org.eclipse.riena.navigation.ui.controllers.SubModuleController"
+ viewShared="false">
+ </workAreaPresentation>
+ </extension>
+</plugin>