@Test public void testGetSubResourceDefinitions() { ResourceDefinition def = new StackServiceResourceDefinition(); Set<SubResourceDefinition> subResources = def.getSubResourceDefinitions(); assertEquals(5, subResources.size()); boolean configReturned = false; boolean componentReturned = false; boolean artifactReturned = false; boolean themesReturned = false; for (SubResourceDefinition subResource : subResources) { Resource.Type type = subResource.getType(); if (type.equals(Resource.Type.StackConfiguration)) { configReturned = true; } else if (type.equals(Resource.Type.StackServiceComponent)) { componentReturned = true; } else if (type.equals(Resource.Type.StackArtifact)) { artifactReturned = true; } else if (type.equals(Resource.Type.Theme)) { themesReturned = true; } } assertTrue(configReturned); assertTrue(componentReturned); assertTrue(artifactReturned); assertTrue(themesReturned); }
@Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); setChildren.add(new SubResourceDefinition(Resource.Type.StackConfiguration)); setChildren.add(new SubResourceDefinition(Resource.Type.StackServiceComponent)); setChildren.add(new SubResourceDefinition(Type.StackArtifact)); setChildren.add(new SubResourceDefinition(Resource.Type.Theme)); setChildren.add(new SubResourceDefinition(Resource.Type.QuickLink)); return setChildren; }
StackServiceResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); setChildren.add(new SubResourceDefinition(Resource.Type.StackConfiguration)); setChildren.add(new SubResourceDefinition(Resource.Type.StackServiceComponent)); setChildren.add(new SubResourceDefinition(Type.StackArtifact)); setChildren.add(new SubResourceDefinition(Resource.Type.Theme)); setChildren.add(new SubResourceDefinition(Resource.Type.QuickLink)); return setChildren; } }
StackServiceResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); setChildren.add(new SubResourceDefinition(Resource.Type.StackConfiguration)); setChildren.add(new SubResourceDefinition(Resource.Type.StackServiceComponent)); setChildren.add(new SubResourceDefinition(Type.StackArtifact)); setChildren.add(new SubResourceDefinition(Resource.Type.Theme)); setChildren.add(new SubResourceDefinition(Resource.Type.QuickLink)); return setChildren; } StackServiceResourceDefinition(Type resourceType);  StackServiceResourceDefinition(); }
StackServiceResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); setChildren.add(new SubResourceDefinition(Resource.Type.StackConfiguration)); setChildren.add(new SubResourceDefinition(Resource.Type.StackServiceComponent)); setChildren.add(new SubResourceDefinition(Type.StackArtifact)); setChildren.add(new SubResourceDefinition(Resource.Type.Theme)); setChildren.add(new SubResourceDefinition(Resource.Type.QuickLink)); return setChildren; } StackServiceResourceDefinition(Type resourceType);  StackServiceResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions(); }
StackServiceResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); setChildren.add(new SubResourceDefinition(Resource.Type.StackConfiguration)); setChildren.add(new SubResourceDefinition(Resource.Type.StackServiceComponent)); setChildren.add(new SubResourceDefinition(Type.StackArtifact)); setChildren.add(new SubResourceDefinition(Resource.Type.Theme)); setChildren.add(new SubResourceDefinition(Resource.Type.QuickLink)); return setChildren; } StackServiceResourceDefinition(Type resourceType);  StackServiceResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }