summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-04-06 09:58:11 (EDT)
committerCarsten Drossel2009-04-06 09:58:11 (EDT)
commitdd043168b68f7d49cefc0c90d2ea8b70b0e72efe (patch)
tree8e41fa9c92738bb761bea4f4fbf45716bc5a678d
parent19c4c34208cf7821d16bc5c2229a7ac8d8a4ad0e (diff)
downloadorg.eclipse.riena-dd043168b68f7d49cefc0c90d2ea8b70b0e72efe.zip
org.eclipse.riena-dd043168b68f7d49cefc0c90d2ea8b70b0e72efe.tar.gz
org.eclipse.riena-dd043168b68f7d49cefc0c90d2ea8b70b0e72efe.tar.bz2
bug 269221
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleViewTest.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleViewTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleViewTest.java
new file mode 100644
index 0000000..4628f1b
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleViewTest.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 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.ui.swt.views;
+
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.riena.navigation.model.ModuleNode;
+import org.eclipse.riena.navigation.model.NavigationProcessor;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.eclipse.riena.tests.RienaTestCase;
+import org.eclipse.riena.tests.collect.UITestCase;
+import org.eclipse.riena.ui.swt.utils.SwtUtilities;
+
+/**
+ * Tests for the ModuleView.
+ */
+@UITestCase
+public class ModuleViewTest extends RienaTestCase {
+
+ private ModuleView view;
+ private ModuleNode node;
+ private SubModuleNode subNode;
+ private SubModuleNode subSubNode;
+ private SubModuleNode subSubSubNode;
+ private Shell shell;
+
+ @Override
+ protected void setUp() throws Exception {
+
+ shell = new Shell();
+ view = new ModuleView(shell);
+ final NavigationProcessor navigationProcessor = new NavigationProcessor();
+ node = new ModuleNode();
+ node.setNavigationProcessor(navigationProcessor);
+ subNode = new SubModuleNode();
+ subNode.setNavigationProcessor(navigationProcessor);
+ node.addChild(subNode);
+ subSubNode = new SubModuleNode();
+ subSubNode.setNavigationProcessor(navigationProcessor);
+ subNode.addChild(subSubNode);
+ subSubSubNode = new SubModuleNode();
+ subSubSubNode.setNavigationProcessor(navigationProcessor);
+ subSubNode.addChild(subSubSubNode);
+ view.bind(node);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ view.dispose();
+ SwtUtilities.disposeWidget(shell);
+ node = null;
+ }
+
+ /**
+ * Test for bug 269221
+ */
+ public void testSetActivatedSubModuleExpanded() throws Exception {
+
+ subNode.activate();
+
+ assertTrue(node.isActivated());
+ assertTrue(subNode.isActivated());
+ assertFalse(subSubNode.isActivated());
+ assertFalse(subSubSubNode.isActivated());
+ assertFalse(subNode.isExpanded());
+ assertFalse(subSubNode.isExpanded());
+
+ subSubSubNode.activate();
+
+ assertTrue(node.isActivated());
+ assertFalse(subNode.isActivated());
+ assertFalse(subSubNode.isActivated());
+ assertTrue(subSubSubNode.isActivated());
+ assertTrue(subNode.isExpanded());
+ assertTrue(subSubNode.isExpanded());
+ }
+
+}