@Test public void testGetRenderer() { ResourceDefinition resource = new ClusterResourceDefinition(); assertTrue(resource.getRenderer(null) instanceof DefaultRenderer); assertTrue(resource.getRenderer("default") instanceof DefaultRenderer); assertTrue(resource.getRenderer("minimal") instanceof MinimalRenderer); assertTrue(resource.getRenderer("blueprint") instanceof ClusterBlueprintRenderer); try { resource.getRenderer("foo"); fail("Should have thrown an exception due to invalid renderer type"); } catch (IllegalArgumentException e) { } }
@Override public Renderer getRenderer(String name) { if (name != null && name.equals("blueprint")) { return new ClusterBlueprintRenderer(); } else { return super.getRenderer(name); } }
ClusterResourceDefinition extends BaseResourceDefinition { @Override public Renderer getRenderer(String name) { if (name != null && name.equals("blueprint")) { return new ClusterBlueprintRenderer(); } else { return super.getRenderer(name); } } }
ClusterResourceDefinition extends BaseResourceDefinition { @Override public Renderer getRenderer(String name) { if (name != null && name.equals("blueprint")) { return new ClusterBlueprintRenderer(); } else { return super.getRenderer(name); } } ClusterResourceDefinition(); }
ClusterResourceDefinition extends BaseResourceDefinition { @Override public Renderer getRenderer(String name) { if (name != null && name.equals("blueprint")) { return new ClusterBlueprintRenderer(); } else { return super.getRenderer(name); } } ClusterResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Renderer getRenderer(String name); @Override Set<SubResourceDefinition> getSubResourceDefinitions(); @Override Collection<String> getUpdateDirectives(); }
ClusterResourceDefinition extends BaseResourceDefinition { @Override public Renderer getRenderer(String name) { if (name != null && name.equals("blueprint")) { return new ClusterBlueprintRenderer(); } else { return super.getRenderer(name); } } ClusterResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Renderer getRenderer(String name); @Override Set<SubResourceDefinition> getSubResourceDefinitions(); @Override Collection<String> getUpdateDirectives();  }