brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [34/45] git commit: address @aledsage's code review comments, and fix some failing tests (libraries sometimes null, and name not taken from template when app is promoted)
Date Fri, 04 Jul 2014 09:51:16 GMT
address @aledsage's code review comments, and fix some failing tests (libraries sometimes null,
and name not taken from template when app is promoted)


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/e96af92d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/e96af92d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/e96af92d

Branch: refs/heads/master
Commit: e96af92dc69e7dd97d3187d3c296290da9326d58
Parents: 13aa4af
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Jul 3 16:08:48 2014 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Thu Jul 3 16:08:48 2014 +0100

----------------------------------------------------------------------
 .../main/java/brooklyn/catalog/CatalogItem.java |  6 ++-
 .../catalog/internal/BasicBrooklynCatalog.java  |  2 +-
 .../catalog/internal/CatalogItemDo.java         |  6 ++-
 .../internal/CatalogItemDtoAbstract.java        | 53 +-----------------
 .../brooklyn/catalog/internal/CatalogItems.java | 56 ++++++++++++++++++++
 .../catalog/internal/CatalogLibrariesDto.java   |  2 +-
 .../brooklyn/camp/lite/CampYamlLiteTest.java    |  2 +-
 .../catalog/internal/CatalogDtoTest.java        |  6 +--
 .../BrooklynAssemblyTemplateInstantiator.java   | 44 +++++++--------
 .../brooklyn/launcher/BrooklynLauncher.java     |  2 -
 .../rest/transform/CatalogTransformer.java      |  4 +-
 .../rest/resources/CatalogResourceTest.java     |  2 +-
 12 files changed, 95 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/api/src/main/java/brooklyn/catalog/CatalogItem.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/brooklyn/catalog/CatalogItem.java b/api/src/main/java/brooklyn/catalog/CatalogItem.java
index 7cfbdd6..ebcdae8 100644
--- a/api/src/main/java/brooklyn/catalog/CatalogItem.java
+++ b/api/src/main/java/brooklyn/catalog/CatalogItem.java
@@ -5,6 +5,9 @@ import java.util.List;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import com.google.common.annotations.Beta;
+
+@Beta
 public interface CatalogItem<T,SpecT> {
     
     public static enum CatalogItemType {
@@ -24,7 +27,8 @@ public interface CatalogItem<T,SpecT> {
     /** the explicit ID of this item, or the type if not supplied */
     public String getId();
     
-    /** the type name registered in the catalog for this item */ 
+    /** the type name registered in the catalog for this item */
+    @Nonnull
     public String getRegisteredTypeName();
     
     /** the underlying java type of the item represented, or null if not known (e.g. if it
comes from yaml) */

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java b/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
index f4f0150..2f45bb7 100644
--- a/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
+++ b/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java
@@ -208,7 +208,7 @@ public class BasicBrooklynCatalog implements BrooklynCatalog {
         // TODO applications / templates
         // TODO long-term support policies etc
         
-        return CatalogItemDtoAbstract.newEntityFromPlan(name, libraries, plan, yaml);
+        return CatalogItems.newEntityFromPlan(name, libraries, plan, yaml);
     }
 
     private DeploymentPlan makePlanFromYaml(String yaml) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/main/java/brooklyn/catalog/internal/CatalogItemDo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/CatalogItemDo.java b/core/src/main/java/brooklyn/catalog/internal/CatalogItemDo.java
index 65133fe..6939a55 100644
--- a/core/src/main/java/brooklyn/catalog/internal/CatalogItemDo.java
+++ b/core/src/main/java/brooklyn/catalog/internal/CatalogItemDo.java
@@ -75,7 +75,7 @@ public class CatalogItemDo<T,SpecT> implements CatalogItem<T,SpecT>
{
         return itemDto.getVersion();
     }
 
-    @Nonnull
+    @Nonnull  // but it is still null sometimes, see in CatalogDo.loadJavaClass
     @Override
     public CatalogItemLibraries getLibraries() {
         return itemDto.getLibraries();
@@ -97,7 +97,9 @@ public class CatalogItemDo<T,SpecT> implements CatalogItem<T,SpecT>
{
 
             if (mgmt!=null) {
                 Maybe<OsgiManager> osgi = ((ManagementContextInternal)mgmt).getOsgiManager();
-                if (osgi.isPresent()) {
+                if (osgi.isPresent() && getLibraries()!=null) {
+                    // TODO getLibraries() should never be null but sometimes it is still
+                    // e.g. run CatalogResourceTest without the above check
                     List<String> bundles = getLibraries().getBundles();
                     if (bundles!=null && !bundles.isEmpty()) {
                         clazz = osgi.get().tryResolveClass(getJavaType(), bundles);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/main/java/brooklyn/catalog/internal/CatalogItemDtoAbstract.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/CatalogItemDtoAbstract.java b/core/src/main/java/brooklyn/catalog/internal/CatalogItemDtoAbstract.java
index b9b633d..21f0091 100644
--- a/core/src/main/java/brooklyn/catalog/internal/CatalogItemDtoAbstract.java
+++ b/core/src/main/java/brooklyn/catalog/internal/CatalogItemDtoAbstract.java
@@ -1,8 +1,7 @@
 package brooklyn.catalog.internal;
 
-import io.brooklyn.camp.spi.pdp.DeploymentPlan;
-
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import brooklyn.catalog.CatalogItem;
 
@@ -70,59 +69,11 @@ public abstract class CatalogItemDtoAbstract<T,SpecT> implements
CatalogItem<T,S
         return libraries;
     }
 
-    @Override
+    @Nullable @Override
     public String getPlanYaml() {
         return planYaml;
     }
 
-    public static CatalogTemplateItemDto newTemplateFromJava(String javaType, String name)
{
-        return newTemplateFromJava(null, javaType, name, null);
-    }
-    public static CatalogTemplateItemDto newTemplateFromJava(String id, String javaType,
String name, String description) {
-        return newTemplateFromJava(id, javaType, name, description, null);
-    }
-    public static CatalogTemplateItemDto newTemplateFromJava(String id, String javaType,
String name, String description, CatalogLibrariesDto libraries) {
-        return set(new CatalogTemplateItemDto(), id, javaType, javaType, name, description,
libraries);
-    }
-
-    public static CatalogEntityItemDto newEntityFromPlan(String registeredTypeName, CatalogLibrariesDto
libraries, DeploymentPlan plan, String underlyingPlanYaml) {
-        CatalogEntityItemDto target = set(new CatalogEntityItemDto(), null, registeredTypeName,
null, plan.getName(), plan.getDescription(), libraries);
-        target.planYaml = underlyingPlanYaml;
-        return target;
-    }
-    
-    public static CatalogEntityItemDto newEntityFromJava(String javaType, String name) {
-        return newEntityFromJava(null, javaType, name, null);
-    }
-    public static CatalogEntityItemDto newEntityFromJava(String id, String javaType, String
name, String description) {
-        return newEntityFromJava(id, javaType, name, description, null);
-    }
-    public static CatalogEntityItemDto newEntityFromJava(String id, String javaType, String
name, String description, CatalogLibrariesDto libraries) {
-        return set(new CatalogEntityItemDto(), id, javaType, javaType, name, description,
libraries);
-    }
-
-    public static CatalogPolicyItemDto newPolicyFromJava(String javaType, String name) {
-        return newPolicyFromJava(null, javaType, name, null);
-    }
-    public static CatalogPolicyItemDto newPolicyFromJava(String id, String javaType, String
name, String description) {
-        return newPolicyFromJava(id, javaType, name, description, null);
-    }
-    public static CatalogPolicyItemDto newPolicyFromJava(String id, String javaType, String
name, String description, CatalogLibrariesDto libraries) {
-        return set(new CatalogPolicyItemDto(), id, javaType, javaType, name, description,
libraries);
-    }
-
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    private static <T extends CatalogItemDtoAbstract> T set(T target, String id, String
registeredType, String javaType, String name,
-            String description, CatalogLibrariesDto libraries) {
-        target.id = id;
-        target.registeredType = registeredType;
-        target.javaType = javaType;
-        target.name = name;
-        target.description = description;
-        target.libraries = libraries != null ? libraries : new CatalogLibrariesDto();
-        return target;
-    }
-
     @Override
     public String toString() {
         return getClass().getSimpleName()+"["+getId()+"/"+getName()+"]";

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/main/java/brooklyn/catalog/internal/CatalogItems.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/CatalogItems.java b/core/src/main/java/brooklyn/catalog/internal/CatalogItems.java
new file mode 100644
index 0000000..18fc571
--- /dev/null
+++ b/core/src/main/java/brooklyn/catalog/internal/CatalogItems.java
@@ -0,0 +1,56 @@
+package brooklyn.catalog.internal;
+
+import io.brooklyn.camp.spi.pdp.DeploymentPlan;
+
+/** Deliberately package-private. Only for internal use. */
+class CatalogItems {
+
+    public static CatalogTemplateItemDto newTemplateFromJava(String javaType, String name)
{
+        return newTemplateFromJava(null, javaType, name, null);
+    }
+    public static CatalogTemplateItemDto newTemplateFromJava(String id, String javaType,
String name, String description) {
+        return newTemplateFromJava(id, javaType, name, description, null);
+    }
+    public static CatalogTemplateItemDto newTemplateFromJava(String id, String javaType,
String name, String description, CatalogLibrariesDto libraries) {
+        return set(new CatalogTemplateItemDto(), id, javaType, javaType, name, description,
libraries);
+    }
+
+    public static CatalogEntityItemDto newEntityFromPlan(String registeredTypeName, CatalogLibrariesDto
libraries, DeploymentPlan plan, String underlyingPlanYaml) {
+        CatalogEntityItemDto target = set(new CatalogEntityItemDto(), null, registeredTypeName,
null, plan.getName(), plan.getDescription(), libraries);
+        target.planYaml = underlyingPlanYaml;
+        return target;
+    }
+    
+    public static CatalogEntityItemDto newEntityFromJava(String javaType, String name) {
+        return newEntityFromJava(null, javaType, name, null);
+    }
+    public static CatalogEntityItemDto newEntityFromJava(String id, String javaType, String
name, String description) {
+        return newEntityFromJava(id, javaType, name, description, null);
+    }
+    public static CatalogEntityItemDto newEntityFromJava(String id, String javaType, String
name, String description, CatalogLibrariesDto libraries) {
+        return set(new CatalogEntityItemDto(), id, javaType, javaType, name, description,
libraries);
+    }
+
+    public static CatalogPolicyItemDto newPolicyFromJava(String javaType, String name) {
+        return newPolicyFromJava(null, javaType, name, null);
+    }
+    public static CatalogPolicyItemDto newPolicyFromJava(String id, String javaType, String
name, String description) {
+        return newPolicyFromJava(id, javaType, name, description, null);
+    }
+    public static CatalogPolicyItemDto newPolicyFromJava(String id, String javaType, String
name, String description, CatalogLibrariesDto libraries) {
+        return set(new CatalogPolicyItemDto(), id, javaType, javaType, name, description,
libraries);
+    }
+ 
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    private static <T extends CatalogItemDtoAbstract> T set(T target, String id, String
registeredType, String javaType, String name,
+            String description, CatalogLibrariesDto libraries) {
+        target.id = id;
+        target.registeredType = registeredType;
+        target.javaType = javaType;
+        target.name = name;
+        target.description = description;
+        target.libraries = libraries != null ? libraries : new CatalogLibrariesDto();
+        return target;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDto.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDto.java b/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDto.java
index a408921..4df1333 100644
--- a/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDto.java
+++ b/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDto.java
@@ -14,7 +14,7 @@ public class CatalogLibrariesDto implements CatalogItem.CatalogItemLibraries
{
     private List<String> bundles = new CopyOnWriteArrayList<String>();
 
     public void addBundle(String url) {
-        Preconditions.checkNotNull(url, "Cannot add a bundle to a deserialized DTO");
+        Preconditions.checkNotNull(bundles, "Cannot add a bundle to a deserialized DTO");
         bundles.add( Preconditions.checkNotNull(url) );
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java b/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
index 9bbadf7..c1bfefc 100644
--- a/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
+++ b/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
@@ -78,7 +78,7 @@ public class CampYamlLiteTest {
         Assert.assertEquals( map.get("desc"), MockWebPlatform.APPSERVER.getDescription()
);
     }
 
-    @Test(groups="WIP")
+    @Test
     public void testYamlServiceForCatalog() {
         MockWebPlatform.populate(platform, TestAppAssemblyInstantiator.class);
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/core/src/test/java/brooklyn/catalog/internal/CatalogDtoTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/catalog/internal/CatalogDtoTest.java b/core/src/test/java/brooklyn/catalog/internal/CatalogDtoTest.java
index 1989cb2..88bb020 100644
--- a/core/src/test/java/brooklyn/catalog/internal/CatalogDtoTest.java
+++ b/core/src/test/java/brooklyn/catalog/internal/CatalogDtoTest.java
@@ -71,9 +71,9 @@ public class CatalogDtoTest {
         CatalogDo testEntitiesJavaCatalog = new CatalogDo(CatalogDto.newNamedInstance("Test
Entities from Java", null));
         testEntitiesJavaCatalog.setClasspathScanForEntities(CatalogScanningModes.NONE);
         testEntitiesJavaCatalog.addToClasspath(MavenRetriever.localUrl(BrooklynMavenArtifacts.artifact("",
"brooklyn-core", "jar", "tests")));
-        testEntitiesJavaCatalog.addEntry(CatalogItemDtoAbstract.newTemplateFromJava(
+        testEntitiesJavaCatalog.addEntry(CatalogItems.newTemplateFromJava(
                 TestApplication.class.getCanonicalName(), "Test App from JAR"));
-        testEntitiesJavaCatalog.addEntry(CatalogItemDtoAbstract.newEntityFromJava(
+        testEntitiesJavaCatalog.addEntry(CatalogItems.newEntityFromJava(
                 TestEntity.class.getCanonicalName(), "Test Entity from JAR"));
         root.addCatalog(testEntitiesJavaCatalog.dto);
 
@@ -85,7 +85,7 @@ public class CatalogDtoTest {
         CatalogDo osgiCatalog = new CatalogDo(CatalogDto.newNamedInstance("Test Entities
from OSGi",
                 "A catalog whose entries define their libraries as a list of OSGi bundles"));
         osgiCatalog.setClasspathScanForEntities(CatalogScanningModes.NONE);
-        CatalogEntityItemDto osgiEntity = CatalogItemDtoAbstract.newEntityFromJava(TestEntity.class.getCanonicalName(),
"Test Entity from OSGi");
+        CatalogEntityItemDto osgiEntity = CatalogItems.newEntityFromJava(TestEntity.class.getCanonicalName(),
"Test Entity from OSGi");
         // NB: this is not actually an OSGi bundle, but it's okay as we don't instantiate
the bundles ahead of time (currently)
         osgiEntity.libraries.addBundle(MavenRetriever.localUrl(BrooklynMavenArtifacts.artifact("",
"brooklyn-core", "jar", "tests")));
         testEntitiesJavaCatalog.addEntry(osgiEntity);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
b/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
index cc9dd44..7633fb7 100644
--- a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
+++ b/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
@@ -221,30 +221,6 @@ public class BrooklynAssemblyTemplateInstantiator implements AssemblyTemplateSpe
         final ManagementContext mgmt = getBrooklynManagementContext(platform);
 
         Map<Entity, EntitySpec<?>> allEntities = Maps.newLinkedHashMap();
-//<<<<<<< HEAD
-//        /* FIXME there is a subtlety here, and tests failing;
-//         * OT1H we might not want/need the wrapper application if we are creating a single
one,   
-//         * but OTOH we might need a guarantee of an app at root, if we are creating certain
nested entities
-//         * 
-//         * i (alex) think the solution is to use the new createSpec(...) and interrogate
it
-//         * to see if we need the wrapper or not
-//         */
-//        buildEntities(template, rootEntities, allEntities, mgmt);
-//        
-//        EntitySpec<StartableApplication> appSpec;
-//        StartableApplication app;
-//        if(shouldWrapInApp(template, rootEntities)) {
-//            BrooklynComponentTemplateResolver appResolver = BrooklynComponentTemplateResolver.Factory.newInstance(mgmt,
template);
-//            appSpec = appResolver.resolveSpec(StartableApplication.class, BasicApplicationImpl.class);
-//            app = appResolver.newEntity(appSpec);
-//            setEntitiesParent(rootEntities, app);
-//            allEntities.put(app, appSpec);
-//        } else {
-//            Entry<Entity, EntitySpec<?>> entry = rootEntities.entrySet().iterator().next();
-//            app = (StartableApplication)entry.getKey();
-//            appSpec = (EntitySpec<StartableApplication>)entry.getValue();
-//            applyLocations(mgmt, template, app);
-//=======
         StartableApplication rootApp = buildRootApp(template, platform, allEntities);
         initEntities(mgmt, allEntities);
         log.info("CAMP placing '{}' under management", allEntities.get(rootApp));
@@ -277,7 +253,16 @@ public class BrooklynAssemblyTemplateInstantiator implements AssemblyTemplateSpe
         final ManagementContext mgmt = getBrooklynManagementContext(platform);
         
         ResolvableLink<PlatformComponentTemplate> promotedAppTemplate = template.getPlatformComponentTemplates().links().get(0);
-        StartableApplication app = (StartableApplication)buildEntity(null, promotedAppTemplate,
allEntities, mgmt);
+        
+        PlatformComponentTemplate appChildComponentTemplate = promotedAppTemplate.resolve();
+        BrooklynComponentTemplateResolver entityResolver = BrooklynComponentTemplateResolver.Factory.newInstance(mgmt,
appChildComponentTemplate);
+        EntitySpec<?> spec = buildEntitySpecNonHierarchical(null, appChildComponentTemplate,
allEntities, mgmt, entityResolver);
+
+        // and this is needed in case 'name' was set at template level (eg ApplicationResourceTest.testDeployApplicationYaml)
+        if (spec.getDisplayName()==null && template.getName()!=null)
+            spec.displayName(template.getName());
+            
+        StartableApplication app = (StartableApplication) buildEntityHierarchical(spec, appChildComponentTemplate,
allEntities, mgmt, entityResolver);
         
         // TODO i (alex) think we need this because locations defined at the root of the
template could have been lost otherwise?
         applyLocations(mgmt, template, app);
@@ -296,10 +281,19 @@ public class BrooklynAssemblyTemplateInstantiator implements AssemblyTemplateSpe
             Map<Entity, EntitySpec<?>> allEntities, ManagementContext mgmt) {
         PlatformComponentTemplate appChildComponentTemplate = ctl.resolve();
         BrooklynComponentTemplateResolver entityResolver = BrooklynComponentTemplateResolver.Factory.newInstance(mgmt,
appChildComponentTemplate);
+        EntitySpec<?> spec = buildEntitySpecNonHierarchical(parent, appChildComponentTemplate,
allEntities, mgmt, entityResolver);
+        return buildEntityHierarchical(spec, appChildComponentTemplate, allEntities, mgmt,
entityResolver);
+    }
+    private EntitySpec<?> buildEntitySpecNonHierarchical(StartableApplication parent,
PlatformComponentTemplate appChildComponentTemplate,
+            Map<Entity, EntitySpec<?>> allEntities, ManagementContext mgmt, BrooklynComponentTemplateResolver
entityResolver) {
         EntitySpec<? extends Entity> spec = entityResolver.resolveSpec();
         if(parent != null) {
             spec.parent(parent);
         }
+        return spec;
+    }
+    private Entity buildEntityHierarchical(EntitySpec<?> spec, PlatformComponentTemplate
appChildComponentTemplate,
+            Map<Entity, EntitySpec<?>> allEntities, ManagementContext mgmt, BrooklynComponentTemplateResolver
entityResolver) {
         Entity entity = entityResolver.newEntity(spec);
         allEntities.put(entity, spec);
         buildEntityHierarchy(mgmt, allEntities, entity, entityResolver.getChildren(appChildComponentTemplate.getCustomAttributes()));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
index 7d94e9e..64ef089 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
@@ -32,7 +32,6 @@ import brooklyn.entity.Application;
 import brooklyn.entity.basic.ApplicationBuilder;
 import brooklyn.entity.basic.BrooklynShutdownHooks;
 import brooklyn.entity.basic.Entities;
-import brooklyn.entity.basic.EntityInternal;
 import brooklyn.entity.basic.StartableApplication;
 import brooklyn.entity.proxying.EntitySpec;
 import brooklyn.entity.rebind.PersistenceExceptionHandler;
@@ -645,7 +644,6 @@ public class BrooklynLauncher {
             throw Exceptions.propagate(e);
         }
         Application app = instantiator.create(at, campPlatform);
-//        ((EntityInternal)app).addLocations(XXX);
         return app;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/usage/rest-server/src/main/java/brooklyn/rest/transform/CatalogTransformer.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/brooklyn/rest/transform/CatalogTransformer.java
b/usage/rest-server/src/main/java/brooklyn/rest/transform/CatalogTransformer.java
index 4d24974..76cc02a 100644
--- a/usage/rest-server/src/main/java/brooklyn/rest/transform/CatalogTransformer.java
+++ b/usage/rest-server/src/main/java/brooklyn/rest/transform/CatalogTransformer.java
@@ -50,7 +50,7 @@ public class CatalogTransformer {
 
         return new CatalogEntitySummary(item.getId(), item.getName(), 
             item.getRegisteredTypeName(), item.getJavaType(), 
-            item.getRegisteredTypeName()!=null ? item.getRegisteredTypeName() : item.getJavaType(),
+            item.getRegisteredTypeName(),
             item.getPlanYaml(),
                 item.getDescription(), tidyIconLink(b, item, item.getIconUrl()),
                 config, sensors, effectors,
@@ -60,7 +60,7 @@ public class CatalogTransformer {
     public static CatalogItemSummary catalogItemSummary(BrooklynRestResourceUtils b, CatalogItem<?,?>
item) {
         return new CatalogItemSummary(item.getId(), item.getName(), 
                 item.getRegisteredTypeName(), item.getJavaType(), 
-                item.getRegisteredTypeName()!=null ? item.getRegisteredTypeName() : item.getJavaType(),
+                item.getRegisteredTypeName(),
                 item.getPlanYaml(),
                 item.getDescription(), tidyIconLink(b, item, item.getIconUrl()), makeLinks(item));
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e96af92d/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
b/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
index 810e6e3..84e60f3 100644
--- a/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
+++ b/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
@@ -49,7 +49,7 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     String registeredTypeName = "my.catalog.app.id";
     String yaml =
         "name: "+registeredTypeName+"\n"+
-        // TODO name above should be unnecessary when brooklyn.catalog below is working
+        // FIXME name above should be unnecessary when brooklyn.catalog below is working
         "brooklyn.catalog:\n"+
         "- id: " + registeredTypeName + "\n"+
         "- name: My Catalog App\n"+


Mime
View raw message