@Test public void testPerspectiveComponent() throws Exception { LayoutComponent layoutComponentB = new LayoutComponent("PerspectiveDrag"); layoutComponentB.addProperty(PERSPECTIVE_ID, "B"); layoutColumnA.add(layoutComponentB); when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder().build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA); assertTrue(info.isEmpty()); }
public NavTreeBuilder item(String id, String name, String description, boolean modifiable) { return item(id, name, description, modifiable, (String) null); }
@Test public void testPerspectiveComponent() throws Exception { LayoutComponent layoutComponentB = new LayoutComponent("PerspectiveDrag"); layoutComponentB.addProperty(PERSPECTIVE_ID, "B"); layoutColumnA.add(layoutComponentB); when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder().build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA); assertTrue(info.isEmpty()); }
public NavTreeBuilder item(String id, String name, String description, boolean modifiable) { return item(id, name, description, modifiable, (String) null); }
@Test public void testPerspectiveRecursiveIssue() throws Exception { LayoutComponent layoutComponentB = new LayoutComponent("PerspectiveDrag"); layoutComponentB.addProperty(PERSPECTIVE_ID, "B"); layoutColumnA.add(layoutComponentB); LayoutComponent layoutComponentA = new LayoutComponent("PerspectiveDrag"); layoutComponentB.addProperty(PERSPECTIVE_ID, "A"); layoutColumnB.add(layoutComponentA); when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder().build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA); assertEquals(info.getRefList().size(), 3); assertEquals(info.getRefList().get(0), new LayoutNavigationRef(PERSPECTIVE, "A")); assertEquals(info.getRefList().get(1), new LayoutNavigationRef(NAV_COMPONENT, "PerspectiveDrag")); assertEquals(info.getRefList().get(2), new LayoutNavigationRef(PERSPECTIVE, "A")); }
public NavTreeBuilder item(String id, String name, String description, boolean modifiable, NavItemContext itemCtx) { return item(id, name, description, modifiable, itemCtx != null ? itemCtx.toString() : null); }
@Before public void setUp() throws Exception { tree = new NavTreeBuilder() .item("H1", "H1", null, false) .divider() .group("A", "A", null, false) .item("A1", "A1", null, false) .item("A2", "A2", null, false) .group("B", "B", null, false) .group("C", "C", null, false) .build(); presenter = new NavComponentConfigModal(view); presenter.setOnOk(onOk); }
@Test public void testPerspectiveRecursiveIssue() throws Exception { LayoutComponent layoutComponentB = new LayoutComponent("PerspectiveDrag"); layoutComponentB.addProperty(PERSPECTIVE_ID, "B"); layoutColumnA.add(layoutComponentB); LayoutComponent layoutComponentA = new LayoutComponent("PerspectiveDrag"); layoutComponentB.addProperty(PERSPECTIVE_ID, "A"); layoutColumnB.add(layoutComponentA); when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder().build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA); assertEquals(info.getRefList().size(), 3); assertEquals(info.getRefList().get(0), new LayoutNavigationRef(PERSPECTIVE, "A")); assertEquals(info.getRefList().get(1), new LayoutNavigationRef(NAV_COMPONENT, "PerspectiveDrag")); assertEquals(info.getRefList().get(2), new LayoutNavigationRef(PERSPECTIVE, "A")); }
public NavTreeBuilder item(String id, String name, String description, boolean modifiable, NavItemContext itemCtx) { return item(id, name, description, modifiable, itemCtx != null ? itemCtx.toString() : null); }
@Before public void setUp() throws Exception { tree = new NavTreeBuilder() .item("H1", "H1", null, false) .divider() .group("A", "A", null, false) .item("A1", "A1", null, false) .item("A2", "A2", null, false) .group("B", "B", null, false) .group("C", "C", null, false) .build(); presenter = new NavComponentConfigModal(view); presenter.setOnOk(onOk); }
@Before public void setUp() throws Exception { when(beanManager.lookupBean(NavItemTileWidget.class)).thenReturn(tileWidgetBeanDef); when(tileWidgetBeanDef.getInstance()).thenReturn(tileWidget); presenter = new NavTilesWidget(view, navigationManager, pluginManager, placeManager, beanManager); tree = new NavTreeBuilder() .group("Home", "Home", null, false) .group("A", "A", null, false) .item("A1", "A1", null, false) .item("A2", "A2", null, false) .group("A3", "A3", null, false) .item("A31", "A3", null, false) .build(); }
@Before public void setUp() { tree = new NavTreeBuilder() .item(ITEM_HOME_ID, "Home", null, false, NavWorkbenchCtx.permission(ITEM_HOME_ID)) .divider() .group(ITEM_ADMIN_ID, "Administration", null, false) .item(ITEM_SECURITY_ID, "Security", null, false, NavWorkbenchCtx.permission(ITEM_SECURITY_ID)) .item(ITEM_DATASETS_ID, "Data sets", null, false, NavWorkbenchCtx.permission(ITEM_DATASETS_ID)) .build(); controller = new NavSecurityController(authorizationManager, user); }
@Before public void setUp() { tree = new NavTreeBuilder() .item(ITEM_HOME_ID, "Home", null, false, NavWorkbenchCtx.permission(ITEM_HOME_ID)) .divider() .group(ITEM_ADMIN_ID, "Administration", null, false) .item(ITEM_SECURITY_ID, "Security", null, false, NavWorkbenchCtx.permission(ITEM_SECURITY_ID)) .item(ITEM_DATASETS_ID, "Data sets", null, false, NavWorkbenchCtx.permission(ITEM_DATASETS_ID)) .build(); controller = new NavSecurityController(authorizationManager, user); }
@Before public void setUp() throws Exception { when(beanManager.lookupBean(NavItemTileWidget.class)).thenReturn(tileWidgetBeanDef); when(tileWidgetBeanDef.getInstance()).thenReturn(tileWidget); presenter = new NavTilesWidget(view, navigationManager, pluginManager, placeManager, beanManager); tree = new NavTreeBuilder() .group("Home", "Home", null, false) .group("A", "A", null, false) .item("A1", "A1", null, false) .item("A2", "A2", null, false) .group("A3", "A3", null, false) .item("A31", "A3", null, false) .build(); }
@Test public void testOneLevelNoRecursiveIssue() throws Exception { when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder() .group("groupA", "", "", true) .item("layout", "", "", true, NavWorkbenchCtx.perspective("B")) .endGroup() .build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA); assertTrue(info.isEmpty()); }
@Test public void testPerspectiveReuseNoRecursiveIssue() throws Exception { when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder() .group("groupC", "", "", true) .item("layout", "", "", true, NavWorkbenchCtx.perspective("B")) .endGroup() .build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutC); assertTrue(info.isEmpty()); }
@Test public void testPerspectiveReuseNoRecursiveIssue() throws Exception { when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder() .group("groupC", "", "", true) .item("layout", "", "", true, NavWorkbenchCtx.perspective("B")) .endGroup() .build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutC); assertTrue(info.isEmpty()); }
@Test public void testOneLevelNoRecursiveIssue() throws Exception { when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder() .group("groupA", "", "", true) .item("layout", "", "", true, NavWorkbenchCtx.perspective("B")) .endGroup() .build()); LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA); assertTrue(info.isEmpty()); }