public void testGetViewUsers() { final ISubModuleNode node1 = new SubModuleNode(new NavigationNodeId("testSharedViewId", "testInstanceId1")); final ISubModuleNode node2 = new SubModuleNode(new NavigationNodeId("testSharedViewId", "testInstanceId2")); final SwtViewId swtViewId1 = swtPresentationManager.getSwtViewId(node1); swtPresentationManager.getSwtViewId(node2); assertSame(swtPresentationManager.getViewUsers(swtViewId1).size(), 2); node1.dispose(); assertSame(swtPresentationManager.getViewUsers(swtViewId1).size(), 1); node2.dispose(); assertSame(swtPresentationManager.getViewUsers(swtViewId1).size(), 0); }
public void testUnconsistentDefinitionWithAViewBothSharedAndNotShared() throws Exception { final ISubModuleNode node1 = new SubModuleNode(new NavigationNodeId("testSharedViewId", "testInstanceId1")); final ISubModuleNode node2 = new SubModuleNode(new NavigationNodeId("testNotSharedViewId", "testInstanceId2")); swtPresentationManager.getSwtViewId(node1); try { swtPresentationManager.getSwtViewId(node2); fail("ApplicationModelFailure expected"); } catch (final ApplicationModelFailure expected) { ok("ApplicationModelFailure expected"); } }
public void testGetSwtViewIdSharedView() throws Exception { final ISubModuleNode node1 = new SubModuleNode(new NavigationNodeId("testSharedViewId", "testInstanceId1")); final ISubModuleNode node2 = new SubModuleNode(new NavigationNodeId("testSharedViewId", "testInstanceId2")); final SwtViewId swtViewId1 = swtPresentationManager.getSwtViewId(node1); assertEquals("org.eclipse.riena.navigation.ui.swt.views.TestView", swtViewId1.getId()); assertEquals(SubModuleView.SHARED_ID, swtViewId1.getSecondary()); final SwtViewId swtViewId2 = swtPresentationManager.getSwtViewId(node2); assertEquals("org.eclipse.riena.navigation.ui.swt.views.TestView", swtViewId2.getId()); assertEquals(SubModuleView.SHARED_ID, swtViewId2.getSecondary()); }