EvaluatorComponentProvider extends AbstractComponentProvider { @Override public Collection<ViewInfo> getViews(String componentTypeId) { if (EvaluatorComponent.class.getName().equals(componentTypeId)) { List<ViewInfo> views = new ArrayList<ViewInfo>(); views.add(new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, ViewType.OBJECT)); views.add(new ViewInfo(ExpressionsViewManifestation.class, ExpressionsViewManifestation.VIEW_NAME, ExpressionsViewManifestation.class.getName(), ViewType.OBJECT)); views.add(new ViewInfo(ExpressionsViewManifestation.class, ExpressionsViewManifestation.VIEW_NAME, ExpressionsViewManifestation.class.getName(), ViewType.CENTER, true, EvaluatorComponent.class)); return views; } return Collections.singleton(new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, ViewType.OBJECT)); } EvaluatorComponentProvider(); @Override Collection<ComponentTypeInfo> getComponentTypes(); @Override Collection<ViewInfo> getViews(String componentTypeId); @Override Collection<PolicyInfo> getPolicyInfos(); @Override //Add menu items for creating enums with puis selected in My Directory Collection<MenuItemInfo> getMenuItemInfos(); @Override T getAsset(TypeInfo<?> typeInfo, Class<T> assetClass);  }
@Test public void testViews() { Collection<ViewInfo> views = evaluatorProvider.getViews(EvaluatorComponent.class.getName()); Assert.assertEquals(views.size(), 3); Assert.assertTrue(views.contains(new ViewInfo(ExpressionsViewManifestation.class,"", ViewType.OBJECT))); Assert.assertTrue(views.contains(new ViewInfo(ExpressionsViewManifestation.class,"", ExpressionsViewManifestation.class.getName(), ViewType.CENTER, true, EvaluatorComponent.class))); Assert.assertEquals(evaluatorProvider.getViews("unknowncomponent").size(), 1); Iterator<ViewInfo> it = evaluatorProvider.getViews(EvaluatorComponent.class.getName()).iterator(); Assert.assertEquals(it.next(), new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, ViewType.OBJECT)); Assert.assertEquals(it.next(), new ViewInfo(ExpressionsViewManifestation.class, ExpressionsViewManifestation.VIEW_NAME, ViewType.OBJECT)); views = multiProvider.getViews(MultiComponent.class.getName()); Assert.assertEquals(views.size(), 3); Assert.assertTrue(views.contains(new ViewInfo(MultiViewManifestation.class, MultiViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), ViewType.CENTER, true, MultiComponent.class))); it = multiProvider.getViews(MultiComponent.class.getName()).iterator(); Assert.assertEquals(it.next(), new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), ViewType.OBJECT, false, MultiComponent.class)); Assert.assertEquals(it.next(), new ViewInfo(MultiViewManifestation.class, MultiViewManifestation.VIEW_NAME, ViewType.OBJECT)); Assert.assertEquals(it.next(), new ViewInfo(MultiViewManifestation.class, MultiViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), ViewType.CENTER, true, MultiComponent.class)); }