@Test public void test() throws Exception { CareWebShell shell = new CareWebShell(); shell.setLayout("/StatusPanelTest.xml"); shell.setPage(mockEnvironment.getDesktop().getFirstPage()); shell.afterCompose(); mockEnvironment.flushEvents(); PluginContainer plugin = shell.getActivatedPlugin("statusPanel"); Component root = plugin.getFirstChild(); StatusPanel controller = (StatusPanel) FrameworkController.getController(root); assertNotNull("Controller must not be null.", controller); assertEquals(1, root.getChildren().size()); test(root, "STATUS", 1, 1); test(root, "STATUS.TEST1", 1, 3); test(root, "STATUS.TEST1", 2, 3); test(root, "STATUS.TEST2", 1, 5); test(root, "STATUS.TEST2", 2, 5); }
@Test public void test() throws Exception { CareWebShell shell = new CareWebShell(); shell.setParent(getMockEnvironment().getSession().getPage()); shell.setLayout("/StatusPanelTest.xml"); getMockEnvironment().flushEvents(); ElementPlugin plugin = shell.getActivatedPlugin("cwfStatusPanel"); BaseComponent root = plugin.getOuterComponent().getFirstChild(); StatusPanel controller = (StatusPanel) FrameworkController.getController(root); assertNotNull("Controller must not be null.", controller); assertEquals(1, root.getChildren().size()); test(root, "STATUS", 1, 1); test(root, "STATUS.TEST1", 1, 2); test(root, "STATUS.TEST1", 2, 2); test(root, "STATUS.TEST2", 1, 3); test(root, "STATUS.TEST2", 2, 3); }