@Test (dataProvider="assetTestCases") public void testAssets(ComponentProvider provider, TypeInfo<?> info, Class<?> assetType, boolean expected) { if (expected) { Assert.assertNotNull(provider.getAsset(info, assetType)); } else { Assert.assertNull(provider.getAsset(info, assetType)); } }
@Override public <T> T getAsset(TypeInfo<?> typeInfo, Class<T> assetClass) { if (assetClass.isAssignableFrom(ImageIcon.class)) { if (typeInfo.getTypeClass().equals(ExpressionsViewManifestation.class)) { return assetClass.cast(VIEW_ICON); } } if (assetClass.isAssignableFrom(CreateWizardUI.class)) { if (typeInfo.getTypeClass().equals(EvaluatorComponent.class)) { return assetClass.cast(new EvaluatorWizardUI()); } } return super.getAsset(typeInfo, assetClass); }
EvaluatorComponentProvider extends AbstractComponentProvider { @Override public <T> T getAsset(TypeInfo<?> typeInfo, Class<T> assetClass) { if (assetClass.isAssignableFrom(ImageIcon.class)) { if (typeInfo.getTypeClass().equals(ExpressionsViewManifestation.class)) { return assetClass.cast(VIEW_ICON); } } if (assetClass.isAssignableFrom(CreateWizardUI.class)) { if (typeInfo.getTypeClass().equals(EvaluatorComponent.class)) { return assetClass.cast(new EvaluatorWizardUI()); } } return super.getAsset(typeInfo, assetClass); } }
EvaluatorComponentProvider extends AbstractComponentProvider { @Override public <T> T getAsset(TypeInfo<?> typeInfo, Class<T> assetClass) { if (assetClass.isAssignableFrom(ImageIcon.class)) { if (typeInfo.getTypeClass().equals(ExpressionsViewManifestation.class)) { return assetClass.cast(VIEW_ICON); } } if (assetClass.isAssignableFrom(CreateWizardUI.class)) { if (typeInfo.getTypeClass().equals(EvaluatorComponent.class)) { return assetClass.cast(new EvaluatorWizardUI()); } } return super.getAsset(typeInfo, assetClass); } EvaluatorComponentProvider(); }
EvaluatorComponentProvider extends AbstractComponentProvider { @Override public <T> T getAsset(TypeInfo<?> typeInfo, Class<T> assetClass) { if (assetClass.isAssignableFrom(ImageIcon.class)) { if (typeInfo.getTypeClass().equals(ExpressionsViewManifestation.class)) { return assetClass.cast(VIEW_ICON); } } if (assetClass.isAssignableFrom(CreateWizardUI.class)) { if (typeInfo.getTypeClass().equals(EvaluatorComponent.class)) { return assetClass.cast(new EvaluatorWizardUI()); } } return super.getAsset(typeInfo, assetClass); } 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); }
EvaluatorComponentProvider extends AbstractComponentProvider { @Override public <T> T getAsset(TypeInfo<?> typeInfo, Class<T> assetClass) { if (assetClass.isAssignableFrom(ImageIcon.class)) { if (typeInfo.getTypeClass().equals(ExpressionsViewManifestation.class)) { return assetClass.cast(VIEW_ICON); } } if (assetClass.isAssignableFrom(CreateWizardUI.class)) { if (typeInfo.getTypeClass().equals(EvaluatorComponent.class)) { return assetClass.cast(new EvaluatorWizardUI()); } } return super.getAsset(typeInfo, assetClass); } 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);  }