You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by gr...@apache.org on 2016/07/04 09:36:20 UTC

[1/3] brooklyn-server git commit: Catalog format more consistent

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 5adbbca1c -> ce1192f9f


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogItemTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogItemTest.java b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogItemTest.java
index d6bfc68..26e1a93 100644
--- a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogItemTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogItemTest.java
@@ -53,7 +53,6 @@ import org.testng.annotations.Test;
 
 import com.google.common.base.Joiner;
 import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
 public class RebindCatalogItemTest extends RebindTestFixtureWithApp {
@@ -112,6 +111,27 @@ public class RebindCatalogItemTest extends RebindTestFixtureWithApp {
     @Test
     public void testAddAndRebindEntity() throws Exception {
         String symbolicName = "rebind-yaml-catalog-item-test";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  items:",
+                "  - id: " + symbolicName,
+                "    version: " + TEST_VERSION,
+                "    itemType: entity",
+                "    item:",
+                "      type: io.camp.mock:AppServer");
+        CatalogEntityItemDto item =
+            CatalogItemBuilder.newEntity(symbolicName, TEST_VERSION)
+                .displayName(symbolicName)
+                .plan(yaml)
+                .build();
+        origManagementContext.getCatalog().addItem(item);
+        LOG.info("Added item to catalog: {}, id={}", item, item.getId());
+        rebindAndAssertCatalogsAreEqual();
+    }
+
+    @Test
+    public void testAddAndRebindEntityLegacyFormat() throws Exception {
+        String symbolicName = "rebind-yaml-catalog-item-test";
         String yaml = 
                 "name: " + symbolicName + "\n" +
                 "brooklyn.catalog:\n" +
@@ -138,16 +158,17 @@ public class RebindCatalogItemTest extends RebindTestFixtureWithApp {
     public void testAddAndRebindPolicy() {
         // Doesn't matter that SamplePolicy doesn't exist
         String symbolicName = "Test Policy";
-        String yaml =
-                "name: " + symbolicName + "\n" +
-                "brooklyn.catalog:\n" +
-                "  id: sample_policy\n" +
-                "  version: " + TEST_VERSION + "\n" +
-                "brooklyn.policies: \n" +
-                "- type: org.apache.brooklyn.core.mgmt.rebind.RebindCatalogItemTest$MyPolicy\n" +
-                "  brooklyn.config:\n" +
-                "    cfg1: 111\n" +
-                "    cfg2: 222";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  items:",
+                "  - id: " + symbolicName,
+                "    version: " + TEST_VERSION,
+                "    itemType: policy",
+                "    item:",
+                "      type: org.apache.brooklyn.core.mgmt.rebind.RebindCatalogItemTest$MyPolicy",
+                "      brooklyn.config:",
+                "        cfg1: 111",
+                "        cfg2: 222");
         CatalogPolicyItemDto item =
                 CatalogItemBuilder.newPolicy(symbolicName, TEST_VERSION)
                     .displayName(symbolicName)
@@ -170,16 +191,17 @@ public class RebindCatalogItemTest extends RebindTestFixtureWithApp {
 
     private void doTestAddAndRebindAndDeleteLocation(boolean suppressPeriodicCheckpointing) throws Exception {
         String symbolicName = "sample_location";
-        String yaml = Joiner.on("\n").join(ImmutableList.of(
-                "name: Test Location",
+        String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
-                "  id: " + symbolicName,
-                "  version: " + TEST_VERSION,
-                "brooklyn.locations:",
-                "- type: "+LocalhostMachineProvisioningLocation.class.getName(),
-                "  brooklyn.config:",
-                "    cfg1: 111",
-                "    cfg2: 222"));
+                "  items:",
+                "  - id: " + symbolicName,
+                "    version: " + TEST_VERSION,
+                "    itemType: location",
+                "    item:",
+                "      type: "+LocalhostMachineProvisioningLocation.class.getName(),
+                "      brooklyn.config:",
+                "        cfg1: 111",
+                "        cfg2: 222");
         CatalogLocationItemDto item =
                 CatalogItemBuilder.newLocation(symbolicName, TEST_VERSION)
                     .displayName(symbolicName)
@@ -245,12 +267,14 @@ public class RebindCatalogItemTest extends RebindTestFixtureWithApp {
         //the store is unable to delete still locked files so the bug doesn't manifest.
         //TODO investigate if locked files not caused by unclosed streams!
         String symbolicName = "rebind-yaml-catalog-item-test";
-        String yaml = 
-                "name: " + symbolicName + "\n" +
-                "brooklyn.catalog:\n" +
-                "  version: " + TEST_VERSION + "\n" +
-                "services:\n" +
-                "- type: io.camp.mock:AppServer";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  items:",
+                "  - id: " + symbolicName,
+                "    version: " + TEST_VERSION,
+                "    itemType: entity",
+                "    item:",
+                "      type: io.camp.mock:AppServer");
         BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) origManagementContext.getCatalog();
         CatalogEntityItemDto item =
                 CatalogItemBuilder.newEntity(symbolicName, TEST_VERSION)
@@ -266,12 +290,14 @@ public class RebindCatalogItemTest extends RebindTestFixtureWithApp {
     @Test
     public void testRebindAfterItemDeprecated() {
         String symbolicName = "rebind-yaml-catalog-item-test";
-        String yaml =
-                "name: " + symbolicName + "\n" +
-                "brooklyn.catalog:\n" +
-                "  version: " + TEST_VERSION + "\n" +
-                "services:\n" +
-                "- type: io.camp.mock:AppServer";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  items:",
+                "  - id: " + symbolicName,
+                "    version: " + TEST_VERSION,
+                "    itemType: entity",
+                "    item:",
+                "      type: io.camp.mock:AppServer");
         CatalogEntityItemDto item =
                 CatalogItemBuilder.newEntity(symbolicName, TEST_VERSION)
                     .displayName(symbolicName)

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/karaf/apache-brooklyn/src/main/resources/etc/default.catalog.bom
----------------------------------------------------------------------
diff --git a/karaf/apache-brooklyn/src/main/resources/etc/default.catalog.bom b/karaf/apache-brooklyn/src/main/resources/etc/default.catalog.bom
index 4cc4522..6902a1f 100644
--- a/karaf/apache-brooklyn/src/main/resources/etc/default.catalog.bom
+++ b/karaf/apache-brooklyn/src/main/resources/etc/default.catalog.bom
@@ -17,7 +17,7 @@
 
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
     items:
     - id: server-template
       itemType: template

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/launcher/src/test/resources/7zip-catalog.yaml
----------------------------------------------------------------------
diff --git a/launcher/src/test/resources/7zip-catalog.yaml b/launcher/src/test/resources/7zip-catalog.yaml
index 55c4389..06e751b 100644
--- a/launcher/src/test/resources/7zip-catalog.yaml
+++ b/launcher/src/test/resources/7zip-catalog.yaml
@@ -18,11 +18,11 @@
 #
 brooklyn.catalog:
   id: org.apache.brooklyn.windows.7zip
-  version: 1.0
+  version: "1.0"
+  itemType: template
   description: A Windows Server, with 7Zip installed
   displayName: 7Zip
   iconUrl: http://www.7-zip.org/7ziplogo.png
-  itemType: template
 
   item:
     services:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/launcher/src/test/resources/rebind-test-catalog-additions.bom
----------------------------------------------------------------------
diff --git a/launcher/src/test/resources/rebind-test-catalog-additions.bom b/launcher/src/test/resources/rebind-test-catalog-additions.bom
index f4fa777..c0f2a47 100644
--- a/launcher/src/test/resources/rebind-test-catalog-additions.bom
+++ b/launcher/src/test/resources/rebind-test-catalog-additions.bom
@@ -17,7 +17,8 @@
 # under the License.
 #
 brooklyn.catalog:
-  version: test-version
+  version: "test-version"
+  itemType: entity
   items:
 
   # Do not scan classpath with for classes with a @Catalog annotation

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/launcher/src/test/resources/rebind-test-catalog.bom
----------------------------------------------------------------------
diff --git a/launcher/src/test/resources/rebind-test-catalog.bom b/launcher/src/test/resources/rebind-test-catalog.bom
index f19e4c4..8096f16 100644
--- a/launcher/src/test/resources/rebind-test-catalog.bom
+++ b/launcher/src/test/resources/rebind-test-catalog.bom
@@ -17,7 +17,8 @@
 # under the License.
 #
 brooklyn.catalog:
-  version: test-version
+  version: "test-version"
+  itemType: entity
   items:
 
   # Do not scan classpath with for classes with a @Catalog annotation

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/policy/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/policy/src/main/resources/catalog.bom b/policy/src/main/resources/catalog.bom
index d8c7d79..bfa81dd 100644
--- a/policy/src/main/resources/catalog.bom
+++ b/policy/src/main/resources/catalog.bom
@@ -16,7 +16,8 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: policy
     items:
     - id: org.apache.brooklyn.policy.ha.ConnectionFailureDetector
       item:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LocationResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LocationResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LocationResource.java
index 8f4251c..f5cf487 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LocationResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LocationResource.java
@@ -147,16 +147,17 @@ public class LocationResource extends AbstractBrooklynRestResource implements Lo
     @Override
     public Response create(LocationSpec locationSpec) {
         String name = locationSpec.getName();
+        
         ImmutableList.Builder<String> yaml = ImmutableList.<String>builder().add(
                 "brooklyn.catalog:",
-                "  symbolicName: "+name,
-                "",
-                "brooklyn.locations:",
-                "- type: "+locationSpec.getSpec());
+                "  id: " + name,
+                "  itemType: location",
+                "  item:",
+                "    type: "+locationSpec.getSpec());
         if (locationSpec.getConfig().size() > 0) {
-            yaml.add("  brooklyn.config:");
+            yaml.add("    brooklyn.config:");
             for (Map.Entry<String, ?> entry : locationSpec.getConfig().entrySet()) {
-                yaml.add("    " + entry.getKey() + ": " + entry.getValue());
+                yaml.add("      " + entry.getKey() + ": " + entry.getValue());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java
index ea49b47..bcf8d25 100644
--- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.brooklyn.rest.resources;
 
+import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.collect.Iterables.find;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
@@ -78,6 +79,7 @@ import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import com.google.common.base.Joiner;
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 import com.google.common.collect.ImmutableMap;
@@ -698,17 +700,21 @@ public class ApplicationResourceTest extends BrooklynRestResourceTest {
     }
 
     private void addTestCatalogItem(String catalogItemId, String itemType, String version, String service) {
-        String yaml =
-                "brooklyn.catalog:\n"+
-                "  id: " + catalogItemId + "\n"+
-                "  name: My Catalog App\n"+
-                (itemType!=null ? "  item_type: "+itemType+"\n" : "")+
-                "  description: My description\n"+
-                "  icon_url: classpath:///redis-logo.png\n"+
-                "  version: " + version + "\n"+
-                "\n"+
-                "services:\n"+
-                "- type: " + service + "\n";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + catalogItemId,
+                "  version: " + version,
+                "  itemType: " + checkNotNull(itemType, "itemType"),
+                "  name: My Catalog App",
+                "  description: My description",
+                "  icon_url: classpath:///redis-logo.png",
+                "  item:",
+                (itemType.equals("template")
+                        ?
+                            "    services:\n" +
+                            "    - type: " + service
+                        :
+                            "    type: " + service));
 
         client().path("/catalog").post(yaml);
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/CatalogResourceTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/CatalogResourceTest.java b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/CatalogResourceTest.java
index 1eda124..af5d705 100644
--- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/CatalogResourceTest.java
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/CatalogResourceTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.brooklyn.rest.resources;
 
+import static com.google.common.base.Preconditions.checkNotNull;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
@@ -81,18 +82,18 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
 
         String symbolicName = "my.catalog.entity.id";
         String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;
-        String yaml =
-                "brooklyn.catalog:\n"+
-                "  id: " + symbolicName + "\n"+
-                "  name: My Catalog App\n"+
-                "  description: My description\n"+
-                "  icon_url: classpath:/org/apache/brooklyn/test/osgi/entities/icon.gif\n"+
-                "  version: " + TEST_VERSION + "\n"+
-                "  libraries:\n"+
-                "  - url: " + bundleUrl + "\n"+
-                "\n"+
-                "services:\n"+
-                "- type: org.apache.brooklyn.core.test.entity.TestEntity\n";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: entity",
+                "  name: My Catalog App",
+                "  description: My description",
+                "  icon_url: classpath:/org/apache/brooklyn/test/osgi/entities/icon.gif",
+                "  libraries:",
+                "  - url: " + bundleUrl,
+                "  item:",
+                "    type: org.apache.brooklyn.core.test.entity.TestEntity");
 
         Response response = client().path("/catalog")
                 .post(yaml);
@@ -139,7 +140,7 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     }
 
     @Test
-    // osgi may fail in IDE, typically works on CLI though
+    // osgi may fail in IDE, typically works on mvn CLI though
     public void testRegisterOsgiPolicyTopLevelSyntax() {
         TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
 
@@ -147,17 +148,17 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
         String policyType = "org.apache.brooklyn.test.osgi.entities.SimplePolicy";
         String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;
 
-        String yaml =
-                "brooklyn.catalog:\n"+
-                "  id: " + symbolicName + "\n"+
-                "  name: My Catalog App\n"+
-                "  description: My description\n"+
-                "  version: " + TEST_VERSION + "\n" +
-                "  libraries:\n"+
-                "  - url: " + bundleUrl + "\n"+
-                "\n"+
-                "brooklyn.policies:\n"+
-                "- type: " + policyType;
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: policy",
+                "  name: My Catalog App",
+                "  description: My description",
+                "  libraries:",
+                "  - url: " + bundleUrl,
+                "  item:",
+                "    type: " + policyType);
 
         CatalogPolicySummary entityItem = Iterables.getOnlyElement( client().path("/catalog")
                 .post(yaml, new GenericType<Map<String,CatalogPolicySummary>>() {}).values() );
@@ -248,21 +249,21 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     }
 
     private void addTestCatalogItemAsEntity(String catalogItemId) {
-        addTestCatalogItem(catalogItemId, null, TEST_VERSION, "org.apache.brooklyn.rest.resources.DummyIconEntity");
+        addTestCatalogItem(catalogItemId, "entity", TEST_VERSION, "org.apache.brooklyn.rest.resources.DummyIconEntity");
     }
 
     private void addTestCatalogItem(String catalogItemId, String itemType, String version, String service) {
-        String yaml =
-                "brooklyn.catalog:\n"+
-                "  id: " + catalogItemId + "\n"+
-                "  name: My Catalog App\n"+
-                (itemType!=null ? "  item_type: "+itemType+"\n" : "")+
-                "  description: My description\n"+
-                "  icon_url: classpath:///bridge-small.png\n"+
-                "  version: " + version + "\n"+
-                "\n"+
-                "services:\n"+
-                "- type: " + service + "\n";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + catalogItemId,
+                "  version: " + TEST_VERSION,
+                "  itemType: " + checkNotNull(itemType),
+                "  name: My Catalog App",
+                "  description: My description",
+                "  icon_url: classpath:///bridge-small.png",
+                "  version: " + version,
+                "  item:",
+                "    type: " + service);
 
         client().path("/catalog").post(yaml);
     }
@@ -314,12 +315,12 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: location",
                 "  name: My Catalog Location",
                 "  description: My description",
-                "  version: " + TEST_VERSION,
-                "",
-                "brooklyn.locations:",
-                "- type: " + locationType);
+                "  item:",
+                "    type: " + locationType);
 
         // Create location item
         Map<String, CatalogLocationSummary> items = client().path("/catalog")
@@ -362,17 +363,15 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     @Test
     public void testDeleteCustomEntityFromCatalog() {
         String symbolicName = "my.catalog.app.id.to.subsequently.delete";
-        String yaml =
-                "name: "+symbolicName+"\n"+
-                // FIXME name above should be unnecessary when brooklyn.catalog below is working
-                "brooklyn.catalog:\n"+
-                "  id: " + symbolicName + "\n"+
-                "  name: My Catalog App To Be Deleted\n"+
-                "  description: My description\n"+
-                "  version: " + TEST_VERSION + "\n"+
-                "\n"+
-                "services:\n"+
-                "- type: org.apache.brooklyn.core.test.entity.TestEntity\n";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: entity",
+                "  name: My Catalog App To Be Deleted",
+                "  description: My description",
+                "  item:",
+                "    type: org.apache.brooklyn.core.test.entity.TestEntity");
 
         client().path("/catalog")
                 .post(yaml);
@@ -474,35 +473,35 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
 
     @Test
     public void testAddUnreachableItem() {
-        addInvalidCatalogItem("http://0.0.0.0/can-not-connect");
+        addAddCatalogItemWithInvalidBundleUrl("http://0.0.0.0/can-not-connect");
     }
 
     @Test
     public void testAddInvalidItem() {
         //equivalent to HTTP response 200 text/html
-        addInvalidCatalogItem("classpath://not-a-jar-file.txt");
+        addAddCatalogItemWithInvalidBundleUrl("classpath://not-a-jar-file.txt");
     }
 
     @Test
     public void testAddMissingItem() {
         //equivalent to HTTP response 404 text/html
-        addInvalidCatalogItem("classpath://missing-jar-file.txt");
+        addAddCatalogItemWithInvalidBundleUrl("classpath://missing-jar-file.txt");
     }
 
-    private void addInvalidCatalogItem(String bundleUrl) {
+    private void addAddCatalogItemWithInvalidBundleUrl(String bundleUrl) {
         String symbolicName = "my.catalog.entity.id";
-        String yaml =
-                "brooklyn.catalog:\n"+
-                "  id: " + symbolicName + "\n"+
-                "  name: My Catalog App\n"+
-                "  description: My description\n"+
-                "  icon_url: classpath:/org/apache/brooklyn/test/osgi/entities/icon.gif\n"+
-                "  version: " + TEST_VERSION + "\n"+
-                "  libraries:\n"+
-                "  - url: " + bundleUrl + "\n"+
-                "\n"+
-                "services:\n"+
-                "- type: org.apache.brooklyn.core.test.entity.TestEntity\n";
+        String yaml = Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: entity",
+                "  name: My Catalog App",
+                "  description: My description",
+                "  icon_url: classpath:/org/apache/brooklyn/test/osgi/entities/icon.gif",
+                "  libraries:",
+                "  - url: " + bundleUrl,
+                "  item:",
+                "    type: org.apache.brooklyn.core.test.entity.TestEntity");
 
         Response response = client().path("/catalog")
                 .post(yaml);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java
index 2a00215..c0131b2 100644
--- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java
@@ -99,12 +99,12 @@ public class LocationResourceTest extends BrooklynRestResourceTest {
                 "brooklyn.catalog:",
                 "  symbolicName: "+locationName,
                 "  version: " + locationVersion,
-                "",
-                "brooklyn.locations:",
-                "- type: "+"aws-ec2:us-east-1",
-                "  brooklyn.config:",
-                "    identity: bob",
-                "    credential: CR3dential"));
+                "  itemType: location",
+                "  item:",
+                "    type: "+"aws-ec2:us-east-1",
+                "    brooklyn.config:",
+                "      identity: bob",
+                "      credential: CR3dential"));
 
         
         Response response = client().path("/catalog")

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/rest/rest-server/src/test/resources/vanilla-software-process-with-resource.yaml
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/test/resources/vanilla-software-process-with-resource.yaml b/rest/rest-server/src/test/resources/vanilla-software-process-with-resource.yaml
index c0ce54f..26faa40 100644
--- a/rest/rest-server/src/test/resources/vanilla-software-process-with-resource.yaml
+++ b/rest/rest-server/src/test/resources/vanilla-software-process-with-resource.yaml
@@ -22,7 +22,10 @@
 
 brooklyn.catalog:
   id: vanilla-software-resource-test
-  version: 1.0
+  version: "1.0"
+  itemType: tempalte
+  libraries:
+  - classpath://brooklyn/osgi/brooklyn-test-osgi-entities.jar
   item:
     services:
     - type: org.apache.brooklyn.entity.stock.BasicApplication
@@ -34,6 +37,3 @@ brooklyn.catalog:
           # Contained in library jar.
           runtimeFiles:
             classpath://org/apache/brooklyn/test/osgi/resources/message.txt: message.txt
-
-  libraries:
-  - classpath://brooklyn/osgi/brooklyn-test-osgi-entities.jar

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/server-cli/src/main/resources/brooklyn/default.catalog.bom
----------------------------------------------------------------------
diff --git a/server-cli/src/main/resources/brooklyn/default.catalog.bom b/server-cli/src/main/resources/brooklyn/default.catalog.bom
index f5bc2a5..b5b687d 100644
--- a/server-cli/src/main/resources/brooklyn/default.catalog.bom
+++ b/server-cli/src/main/resources/brooklyn/default.catalog.bom
@@ -3,13 +3,14 @@
 # and templates to get started using Brooklyn
 
 brooklyn.catalog:
-  version: 0.10.0-SNAPSHOT  # BROOKLYN_VERSION
+  version: "0.10.0-SNAPSHOT"  # BROOKLYN_VERSION
   items:
 
   # load everything in the classpath with a @Catalog annotation
   - scanJavaAnnotations: true
 
   - id: server
+    itemType: entity
     description: |
       Provision a server, with customizable provisioning.properties and credentials installed, 
       but no other special software process or scripts executed.
@@ -18,6 +19,7 @@ brooklyn.catalog:
       name: Server
 
   - id: vanilla-bash-server
+    itemType: entity
     description: |
       Provision a server, with customizable provisioning.properties and credentials installed, 
       but no other special software process or scripts executed.
@@ -28,6 +30,7 @@ brooklyn.catalog:
       name: Server with Launch Script (bash)
 
   - id: load-balancer
+    itemType: entity
     description: |
       Create a load balancer which will point at members in the group entity
       referred to by the config key "serverPool". 
@@ -38,6 +41,7 @@ brooklyn.catalog:
       name: Load Balancer (nginx)
 
   - id: cluster
+    itemType: entity
     description: |
       Create a cluster of entities, resizable, with starting size "initialSize",
       and using a spec supplied in the "memberSpec" key.

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/server-cli/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/server-cli/src/main/resources/catalog.bom b/server-cli/src/main/resources/catalog.bom
index ec9e3d1..6bfb7a4 100644
--- a/server-cli/src/main/resources/catalog.bom
+++ b/server-cli/src/main/resources/catalog.bom
@@ -3,12 +3,13 @@
 # and templates to get started using Brooklyn
 
 brooklyn.catalog:
-  version: 0.10.0-SNAPSHOT  # BROOKLYN_VERSION
+  version: "0.10.0-SNAPSHOT"  # BROOKLYN_VERSION
   items:
 
   # load everything in the classpath with a @Catalog annotation
 
   - id: server
+    itemType: entity
     description: |
       Provision a server, with customizable provisioning.properties and credentials installed, 
       but no other special software process or scripts executed.
@@ -17,6 +18,7 @@ brooklyn.catalog:
       name: Server
 
   - id: vanilla-bash-server
+    itemType: entity
     description: |
       Provision a server, with customizable provisioning.properties and credentials installed, 
       but no other special software process or scripts executed.
@@ -27,6 +29,7 @@ brooklyn.catalog:
       name: Server with Launch Script (bash)
 
   - id: load-balancer
+    itemType: entity
     description: |
       Create a load balancer which will point at members in the group entity
       referred to by the config key "serverPool". 
@@ -37,6 +40,7 @@ brooklyn.catalog:
       name: Load Balancer (nginx)
 
   - id: cluster
+    itemType: entity
     description: |
       Create a cluster of entities, resizable, with starting size "initialSize",
       and using a spec supplied in the "memberSpec" key.

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/server-cli/src/test/java/org/apache/brooklyn/cli/CliTest.java
----------------------------------------------------------------------
diff --git a/server-cli/src/test/java/org/apache/brooklyn/cli/CliTest.java b/server-cli/src/test/java/org/apache/brooklyn/cli/CliTest.java
index 947c541..c069f9e 100644
--- a/server-cli/src/test/java/org/apache/brooklyn/cli/CliTest.java
+++ b/server-cli/src/test/java/org/apache/brooklyn/cli/CliTest.java
@@ -465,6 +465,7 @@ public class CliTest {
                 "brooklyn.catalog:",
                 "  id: "+itemName,
                 "  version: "+itemVersion,
+                "  itemType: entity",
                 "  item:",
                 "    services:",
                 "    - type: org.apache.brooklyn.entity.stock.BasicApplication");

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/software/base/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/software/base/src/main/resources/catalog.bom b/software/base/src/main/resources/catalog.bom
index 39367eb..99211ac 100644
--- a/software/base/src/main/resources/catalog.bom
+++ b/software/base/src/main/resources/catalog.bom
@@ -16,7 +16,8 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: entity
     items:
     - id: org.apache.brooklyn.entity.machine.MachineEntity
       item:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/software/base/src/test/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
index 773a492..4d4c92e 100644
--- a/software/base/src/test/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
+++ b/software/base/src/test/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
@@ -260,9 +260,9 @@ services:
                 "brooklyn.catalog:",
                 "  id: BrooklynNodeIntegrationTest.mycatalog",
                 "  version: 1.0",
+                "  itemType: entity",
                 "  item:",
-                "    services:",
-                "    - type: org.apache.brooklyn.entity.stock.BasicApplication");
+                "    type: org.apache.brooklyn.entity.stock.BasicApplication");
 
         EntitySpec<BrooklynNode> spec = newBrooklynNodeSpecForTest()
                 .configure(BrooklynNode.BROOKLYN_CATALOG_INITIAL_BOM_REMOTE_PATH, pseudoBrooklynCatalogFile.getAbsolutePath())

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/test-framework/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/test-framework/src/main/resources/catalog.bom b/test-framework/src/main/resources/catalog.bom
index f912b4f..1b4db38 100644
--- a/test-framework/src/main/resources/catalog.bom
+++ b/test-framework/src/main/resources/catalog.bom
@@ -16,8 +16,12 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: entity
     items:
+    - id: org.apache.brooklyn.test.framework.TestSshCommand
+      item:
+        type: org.apache.brooklyn.test.framework.TestSshCommand
     - id: org.apache.brooklyn.test.framework.SimpleShellCommandTest
       item:
         type: org.apache.brooklyn.test.framework.SimpleShellCommandTest

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/utils/common/dependencies/osgi/entities/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/resources/catalog.bom b/utils/common/dependencies/osgi/entities/src/main/resources/catalog.bom
index 3531e4c..d1e0f12 100644
--- a/utils/common/dependencies/osgi/entities/src/main/resources/catalog.bom
+++ b/utils/common/dependencies/osgi/entities/src/main/resources/catalog.bom
@@ -17,7 +17,8 @@
 
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: entity
     description: For testing loading catalog.bom with catalog scan
     displayName: I Haz Catalog
     items:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-back-catalog.bom
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-back-catalog.bom b/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-back-catalog.bom
index d41663b..8752870 100644
--- a/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-back-catalog.bom
+++ b/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-back-catalog.bom
@@ -18,6 +18,7 @@
 
 brooklyn.catalog:
   version: 0.1.2
+  itemType: entity
   displayName: I Haz Catalog
   libraries:
     # References a bundle which doesn't contain SimpleEntity on purpose

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-parent-catalog.bom
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-parent-catalog.bom b/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-parent-catalog.bom
index c19e305..e7c1983 100644
--- a/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-parent-catalog.bom
+++ b/utils/common/dependencies/osgi/entities/src/main/resources/yaml-ref-parent-catalog.bom
@@ -18,6 +18,7 @@
 
 brooklyn.catalog:
   version: 0.1.2
+  itemType: entity
   displayName: I Haz Catalog
   libraries:
     # References a bundle which doesn't contain SimpleEntity on purpose

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/utils/common/dependencies/osgi/more-entities-v1/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/src/main/resources/catalog.bom b/utils/common/dependencies/osgi/more-entities-v1/src/main/resources/catalog.bom
index ee9ce03..1998110 100644
--- a/utils/common/dependencies/osgi/more-entities-v1/src/main/resources/catalog.bom
+++ b/utils/common/dependencies/osgi/more-entities-v1/src/main/resources/catalog.bom
@@ -16,7 +16,8 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: entity
     items:
     - id: org.apache.brooklyn.test.osgi.entities.more.MoreEntity
       item:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/resources/catalog.bom b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/resources/catalog.bom
index ee9ce03..1998110 100644
--- a/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/resources/catalog.bom
+++ b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/resources/catalog.bom
@@ -16,7 +16,8 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: entity
     items:
     - id: org.apache.brooklyn.test.osgi.entities.more.MoreEntity
       item:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/utils/common/dependencies/osgi/more-entities-v2/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/src/main/resources/catalog.bom b/utils/common/dependencies/osgi/more-entities-v2/src/main/resources/catalog.bom
index 40a860f..7813046 100644
--- a/utils/common/dependencies/osgi/more-entities-v2/src/main/resources/catalog.bom
+++ b/utils/common/dependencies/osgi/more-entities-v2/src/main/resources/catalog.bom
@@ -16,23 +16,27 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
     items:
     - id: org.apache.brooklyn.test.osgi.entities.more.MorePolicy
+      itemType: policy
       item:
         type: org.apache.brooklyn.test.osgi.entities.more.MorePolicy
         name: More Policy
         description: Cataliog item OSGi test policy
     - id: org.apache.brooklyn.test.osgi.entities.more.MoreLocation
+      itemType: location
       item:
         type: org.apache.brooklyn.test.osgi.entities.more.MoreLocation
         name: More Location
         description: Cataliog item OSGi test location
     - id: org.apache.brooklyn.test.osgi.entities.more.MoreEntity
+      itemType: entity
       item:
         type: org.apache.brooklyn.test.osgi.entities.more.MoreEntity
         name: More Entity v2
     - id: org.apache.brooklyn.test.osgi.entities.more.MoreTemplate
+      itemType: template
       item:
         type: org.apache.brooklyn.test.osgi.entities.more.MoreTemplate
         name: More Template


[3/3] brooklyn-server git commit: This closes #222

Posted by gr...@apache.org.
This closes #222

* github/pr/222:
  Catalog format more consistent


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

Branch: refs/heads/master
Commit: ce1192f9f16d130a8b4ba8f9e66864b661db1f82
Parents: 5adbbca 057760e
Author: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Authored: Mon Jul 4 10:36:15 2016 +0100
Committer: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Committed: Mon Jul 4 10:36:15 2016 +0100

----------------------------------------------------------------------
 .../camp/brooklyn/ApplicationsYamlTest.java     |  40 ++--
 .../brooklyn/ConfigInheritanceYamlTest.java     |   2 +-
 .../ConfigLocationInheritanceYamlTest.java      |   6 +-
 .../camp/brooklyn/EntitiesYamlTest.java         |  10 +-
 .../camp/brooklyn/ExternalConfigYamlTest.java   |  15 +-
 .../LocationExternalConfigYamlTest.java         |   2 +-
 .../camp/brooklyn/ReferencedYamlTest.java       |  24 ++-
 .../brooklyn/catalog/CatalogYamlAppTest.java    |  41 ++--
 .../brooklyn/catalog/CatalogYamlCombiTest.java  |  27 ++-
 .../catalog/CatalogYamlEntityNameTest.java      |   9 +-
 .../brooklyn/catalog/CatalogYamlEntityTest.java | 193 ++++++++++---------
 .../catalog/CatalogYamlLocationTest.java        |  24 +--
 .../brooklyn/catalog/CatalogYamlPolicyTest.java |  21 +-
 .../brooklyn/catalog/CatalogYamlRebindTest.java |   3 +-
 .../catalog/CatalogYamlTemplateTest.java        |  16 +-
 .../catalog/CatalogYamlVersioningTest.java      |  14 +-
 .../catalog/SpecParameterParsingTest.java       |   2 +
 .../catalog/SpecParameterUnwrappingTest.java    |  88 +++++----
 .../brooklyn/test/lite/CampYamlLiteTest.java    |  23 +--
 core/src/main/resources/catalog.bom             |   3 +-
 .../internal/StaticTypePlanTransformer.java     |   3 +-
 .../core/mgmt/rebind/RebindCatalogItemTest.java |  90 ++++++---
 .../src/main/resources/etc/default.catalog.bom  |   2 +-
 launcher/src/test/resources/7zip-catalog.yaml   |   4 +-
 .../resources/rebind-test-catalog-additions.bom |   3 +-
 .../src/test/resources/rebind-test-catalog.bom  |   3 +-
 policy/src/main/resources/catalog.bom           |   3 +-
 .../rest/resources/LocationResource.java        |  13 +-
 .../rest/resources/ApplicationResourceTest.java |  28 +--
 .../rest/resources/CatalogResourceTest.java     | 133 +++++++------
 .../rest/resources/LocationResourceTest.java    |  12 +-
 .../vanilla-software-process-with-resource.yaml |   8 +-
 .../main/resources/brooklyn/default.catalog.bom |   6 +-
 server-cli/src/main/resources/catalog.bom       |   6 +-
 .../java/org/apache/brooklyn/cli/CliTest.java   |   1 +
 software/base/src/main/resources/catalog.bom    |   3 +-
 .../BrooklynNodeIntegrationTest.java            |   4 +-
 test-framework/src/main/resources/catalog.bom   |   6 +-
 .../entities/src/main/resources/catalog.bom     |   3 +-
 .../main/resources/yaml-ref-back-catalog.bom    |   1 +
 .../main/resources/yaml-ref-parent-catalog.bom  |   1 +
 .../src/main/resources/catalog.bom              |   3 +-
 .../src/main/resources/catalog.bom              |   3 +-
 .../src/main/resources/catalog.bom              |   6 +-
 44 files changed, 521 insertions(+), 387 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ce1192f9/policy/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --cc policy/src/main/resources/catalog.bom
index a86ea5b,bfa81dd..ee966c9
--- a/policy/src/main/resources/catalog.bom
+++ b/policy/src/main/resources/catalog.bom
@@@ -16,10 -16,10 +16,11 @@@
  # under the License.
  
  brooklyn.catalog:
-     version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+     version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+     itemType: policy
      items:
      - id: org.apache.brooklyn.policy.ha.ConnectionFailureDetector
 +      itemType: policy
        item:
          type: org.apache.brooklyn.policy.ha.ConnectionFailureDetector
          name: Connection Failure Detector

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ce1192f9/test-framework/src/main/resources/catalog.bom
----------------------------------------------------------------------


[2/3] brooklyn-server git commit: Catalog format more consistent

Posted by gr...@apache.org.
Catalog format more consistent


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

Branch: refs/heads/master
Commit: 057760ee42c3e6112e6636b229ebdcb72fffa51b
Parents: a941963
Author: Aled Sage <al...@gmail.com>
Authored: Thu Jun 23 09:05:26 2016 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Jun 28 20:33:14 2016 +0100

----------------------------------------------------------------------
 .../camp/brooklyn/ApplicationsYamlTest.java     |  40 ++--
 .../brooklyn/ConfigInheritanceYamlTest.java     |   2 +-
 .../ConfigLocationInheritanceYamlTest.java      |   6 +-
 .../camp/brooklyn/EntitiesYamlTest.java         |  10 +-
 .../camp/brooklyn/ExternalConfigYamlTest.java   |  15 +-
 .../LocationExternalConfigYamlTest.java         |   2 +-
 .../camp/brooklyn/ReferencedYamlTest.java       |  24 ++-
 .../brooklyn/catalog/CatalogYamlAppTest.java    |  41 ++--
 .../brooklyn/catalog/CatalogYamlCombiTest.java  |  27 ++-
 .../catalog/CatalogYamlEntityNameTest.java      |   9 +-
 .../brooklyn/catalog/CatalogYamlEntityTest.java | 193 ++++++++++---------
 .../catalog/CatalogYamlLocationTest.java        |  24 +--
 .../brooklyn/catalog/CatalogYamlPolicyTest.java |  21 +-
 .../brooklyn/catalog/CatalogYamlRebindTest.java |   3 +-
 .../catalog/CatalogYamlTemplateTest.java        |  16 +-
 .../catalog/CatalogYamlVersioningTest.java      |  14 +-
 .../catalog/SpecParameterParsingTest.java       |   2 +
 .../catalog/SpecParameterUnwrappingTest.java    |  88 +++++----
 .../brooklyn/test/lite/CampYamlLiteTest.java    |  23 +--
 core/src/main/resources/catalog.bom             |   3 +-
 .../internal/StaticTypePlanTransformer.java     |   3 +-
 .../core/mgmt/rebind/RebindCatalogItemTest.java |  90 ++++++---
 .../src/main/resources/etc/default.catalog.bom  |   2 +-
 launcher/src/test/resources/7zip-catalog.yaml   |   4 +-
 .../resources/rebind-test-catalog-additions.bom |   3 +-
 .../src/test/resources/rebind-test-catalog.bom  |   3 +-
 policy/src/main/resources/catalog.bom           |   3 +-
 .../rest/resources/LocationResource.java        |  13 +-
 .../rest/resources/ApplicationResourceTest.java |  28 +--
 .../rest/resources/CatalogResourceTest.java     | 133 +++++++------
 .../rest/resources/LocationResourceTest.java    |  12 +-
 .../vanilla-software-process-with-resource.yaml |   8 +-
 .../main/resources/brooklyn/default.catalog.bom |   6 +-
 server-cli/src/main/resources/catalog.bom       |   6 +-
 .../java/org/apache/brooklyn/cli/CliTest.java   |   1 +
 software/base/src/main/resources/catalog.bom    |   3 +-
 .../BrooklynNodeIntegrationTest.java            |   4 +-
 test-framework/src/main/resources/catalog.bom   |   6 +-
 .../entities/src/main/resources/catalog.bom     |   3 +-
 .../main/resources/yaml-ref-back-catalog.bom    |   1 +
 .../main/resources/yaml-ref-parent-catalog.bom  |   1 +
 .../src/main/resources/catalog.bom              |   3 +-
 .../src/main/resources/catalog.bom              |   3 +-
 .../src/main/resources/catalog.bom              |   6 +-
 44 files changed, 521 insertions(+), 387 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java
index 7a14f94..bcda335 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java
@@ -152,10 +152,11 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: simple",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  displayName: catalogLevel",
                 "  item:",
-                "    services:",
-                "    - type: " + BasicApplication.class.getName());
+                "    type: " + BasicApplication.class.getName());
+        
         Entity app = createAndStartApplication(
                 "name: topLevel",
                 "services:",
@@ -169,12 +170,13 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: simple",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  displayName: catalogLevel",
                 "  item:",
-                "    services:",
-                "    - type: " + BasicApplication.class.getName(),
-                "      defaultDisplayName: defaultServiceName",
-                "      displayName: explicitServiceName");
+                "    type: " + BasicApplication.class.getName(),
+                "    defaultDisplayName: defaultServiceName",
+                "    displayName: explicitServiceName");
+        
         Entity app = createAndStartApplication(
                 "name: topLevel",
                 "services:",
@@ -188,10 +190,11 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: simple",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  displayName: catalogLevel",
                 "  item:",
-                "    services:",
-                "    - type: " + BasicApplication.class.getName());
+                "    type: " + BasicApplication.class.getName());
+        
         Entity app = createAndStartApplication(
                 "services:",
                 "- type: simple:" + TEST_VERSION,
@@ -205,10 +208,11 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: simple",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  displayName: catalogLevel",
                 "  item:",
-                "    services:",
-                "    - type: " + BasicApplication.class.getName());
+                "    type: " + BasicApplication.class.getName());
+        
         Entity app = createAndStartApplication(
                 "services:",
                 "- type: simple:" + TEST_VERSION);
@@ -221,11 +225,12 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: simple",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  displayName: catalogLevel",
                 "  item:",
-                "    services:",
-                "    - type: " + BasicApplication.class.getName(),
-                "      name: catalogServiceLevel");
+                "    type: " + BasicApplication.class.getName(),
+                "    name: catalogServiceLevel");
+        
         Entity app = createAndStartApplication(
                 "services:",
                 "- type: simple:" + TEST_VERSION);
@@ -238,8 +243,10 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: simple",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  item:",
                 "    type: " + BasicEntity.class.getName());
+
         Entity app = createAndStartApplication(
                 "services:",
                 "- type: simple:" + TEST_VERSION);
@@ -258,6 +265,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  items:",
                 "  - id: app1",
                 "    name: My App 1",
@@ -291,6 +299,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml1 = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  name: My name in top-level metadata",
                 "  items:",
                 "  - id: app1",
@@ -302,6 +311,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml2 = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  name: My name in top-level metadata",
                 "  items:",
                 "  - id: app2",
@@ -312,6 +322,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml3 = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  items:",
                 "  - id: app3a",
                 "    name: My name in item 3a metadata",
@@ -343,6 +354,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  name: My name in top-level",
                 "  items:",
                 "  - id: app1",
@@ -360,6 +372,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  items:",
                 "  - id: app1",
                 "    name: My name in item metadata",
@@ -377,6 +390,7 @@ public class ApplicationsYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  version: 0.1.2",
+                "  itemType: entity",
                 "  items:",
                 "  - id: app1",
                 "    item:",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigInheritanceYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigInheritanceYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigInheritanceYamlTest.java
index 4a4721b..f562142 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigInheritanceYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigInheritanceYamlTest.java
@@ -122,8 +122,8 @@ public class ConfigInheritanceYamlTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: localhost-stub",
-                "  name: Localhost (stubbed-SSH)",
                 "  itemType: location",
+                "  name: Localhost (stubbed-SSH)",
                 "  item:",
                 "    type: localhost",
                 "    brooklyn.config:",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java
index 6fba27f..ff5dcae 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java
@@ -181,8 +181,8 @@ public class ConfigLocationInheritanceYamlTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: jclouds-config-test-with-conf",
-                "  name: stubbed-jclouds-gce",
                 "  itemType: location",
+                "  name: stubbed-jclouds-gce",
                 "  item:",
                 "    type: jclouds-config-test:"+CLOUD_PROVIDER+":"+CLOUD_REGION,
                 "    brooklyn.config:",
@@ -257,8 +257,8 @@ public class ConfigLocationInheritanceYamlTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: jclouds-config-test-with-tempateOptions-mapVal",
-                "  name: stubbed-jclouds-gce",
                 "  itemType: location",
+                "  name: stubbed-jclouds-gce",
                 "  item:",
                 "    type: jclouds-config-test:"+CLOUD_PROVIDER+":"+CLOUD_REGION,
                 "    brooklyn.config:",
@@ -326,8 +326,8 @@ public class ConfigLocationInheritanceYamlTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: extending-jclouds-config-test-with-conf",
-                "  name: jclouds-config-test-with-conf",
                 "  itemType: location",
+                "  name: jclouds-config-test-with-conf",
                 "  item:",
                 "    type: jclouds-config-test:"+CLOUD_PROVIDER+":"+CLOUD_REGION,
                 "    brooklyn.config:",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
index e87a3f3..906225e 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
@@ -516,9 +516,10 @@ public class EntitiesYamlTest extends AbstractYamlTest {
     public void testScopeReferences() throws Exception {
         addCatalogItems(
                 "brooklyn.catalog:",
+                "  itemType: entity",
                 "  items:",
-                "  -  id: ref_child",
-                "     item:",
+                "  - id: ref_child",
+                "    item:",
                 "      type: " + ReferencingYamlTestEntity.class.getName(),
                 "      test.reference.root: $brooklyn:root()",
                 "      test.reference.scope_root: $brooklyn:scopeRoot()",
@@ -527,8 +528,8 @@ public class EntitiesYamlTest extends AbstractYamlTest {
                 "        test.reference.root: $brooklyn:root()",
                 "        test.reference.scope_root: $brooklyn:scopeRoot()",
 
-                "  -  id: ref_parent",
-                "     item:",
+                "  - id: ref_parent",
+                "    item:",
                 "      type: " + ReferencingYamlTestEntity.class.getName(),
                 "      test.reference.root: $brooklyn:root()",
                 "      test.reference.scope_root: $brooklyn:scopeRoot()",
@@ -538,6 +539,7 @@ public class EntitiesYamlTest extends AbstractYamlTest {
                 "        test.reference.scope_root: $brooklyn:scopeRoot()",
                 "        brooklyn.children:",
                 "        - type: ref_child");
+        
         Entity app = createAndStartApplication(
                 "brooklyn.config:",
                 "  test.reference.root: $brooklyn:root()",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ExternalConfigYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ExternalConfigYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ExternalConfigYamlTest.java
index a5f98b3..b42d67b 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ExternalConfigYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ExternalConfigYamlTest.java
@@ -132,8 +132,8 @@ public class ExternalConfigYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "    id: $brooklyn:external(\"myprovider\", \"myCatalogId\")",
-                "    itemType: $brooklyn:external(\"myprovider\", \"myCatalogItemType\")",
                 "    version: $brooklyn:external(\"myprovider\", \"myCatalogVersion\")",
+                "    itemType: $brooklyn:external(\"myprovider\", \"myCatalogItemType\")",
                 "    description: $brooklyn:external(\"myprovider\", \"myCatalogDescription\")",
                 "    displayName: $brooklyn:external(\"myprovider\", \"myCatalogDisplayName\")",
                 "    iconUrl: $brooklyn:external(\"myprovider\", \"myCatalogIconUrl\")",
@@ -141,8 +141,7 @@ public class ExternalConfigYamlTest extends AbstractYamlTest {
                 "    - $brooklyn:external(\"myprovider\", \"myCatalogLibraryUrl\")",
                 "",
                 "    item:",
-                "      services:",
-                "      - type: brooklyn.entity.database.mysql.MySqlNode");
+                "      type: brooklyn.entity.database.mysql.MySqlNode");
 
         catalog.addItems(yaml);
 
@@ -163,8 +162,8 @@ public class ExternalConfigYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "    id: myid",
-                "    itemType: template",
                 "    version: 1.2",
+                "    itemType: template",
                 "    description: myDescription",
                 "    displayName: myDisplayName",
                 "    iconUrl: classpath:///myIconUrl.png",
@@ -174,8 +173,7 @@ public class ExternalConfigYamlTest extends AbstractYamlTest {
                 "      url: $brooklyn:external(\"myprovider\", \"myCatalogLibraryUrl\")",
                 "",
                 "    item:",
-                "      services:",
-                "      - type: brooklyn.entity.database.mysql.MySqlNode");
+                "      type: brooklyn.entity.database.mysql.MySqlNode");
 
         catalog.addItems(yaml);
 
@@ -193,8 +191,8 @@ public class ExternalConfigYamlTest extends AbstractYamlTest {
         String yaml = Joiner.on("\n").join(
                 "brooklyn.catalog:",
                 "  id: osgi.test",
-                "  itemType: template",
                 "  version: 1.3",
+                "  itemType: template",
                 "  description: CentOS 6.6 With GUI - 1.3",
                 "  displayName: CentOS 6.6",
                 "  iconUrl: classpath:///centos.png",
@@ -202,8 +200,7 @@ public class ExternalConfigYamlTest extends AbstractYamlTest {
                 "  - " + LIBRARY_URL,
                 "",
                 "  item:",
-                "    services:",
-                "    - type: brooklyn.entity.database.mysql.MySqlNode");
+                "    type: brooklyn.entity.database.mysql.MySqlNode");
 
         catalog.addItems(yaml);
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationExternalConfigYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationExternalConfigYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationExternalConfigYamlTest.java
index 6d3f38b..2f4e8cd 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationExternalConfigYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationExternalConfigYamlTest.java
@@ -79,7 +79,7 @@ public class LocationExternalConfigYamlTest extends AbstractYamlRebindTest {
         ImmutableList.Builder<String> yamlL = ImmutableList.<String>builder().add(
                 "brooklyn.catalog:",
                 "  id: l1",
-                "  item.type: location",
+                "  itemType: location",
                 "  item:",
                 "    type: localhost",
                 "    brooklyn.config:",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java
index 0ebbc56..79402f2 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java
@@ -105,8 +105,9 @@ public class ReferencedYamlTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: yaml.reference",
             "  version: " + TEST_VERSION,
-            "services:",
-            "- type: classpath://yaml-ref-entity.yaml");
+            "  itemType: entity",
+            "  item:",
+            "    type: classpath://yaml-ref-entity.yaml");
         
         String entityName = "YAML -> catalog item -> yaml url";
         Entity app = createAndStartApplication(
@@ -125,10 +126,11 @@ public class ReferencedYamlTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: yaml.reference",
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
-            "services:",
-            "- type: classpath://yaml-ref-osgi-entity.yaml");
+            "  item:",
+            "    type: classpath://yaml-ref-osgi-entity.yaml");
         
         String entityName = "YAML -> catalog item -> yaml url (osgi)";
         Entity app = createAndStartApplication(
@@ -145,8 +147,9 @@ public class ReferencedYamlTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: yaml.basic",
             "  version: " + TEST_VERSION,
-            "services:",
-            "- type: org.apache.brooklyn.entity.stock.BasicEntity");
+            "  itemType: entity",
+            "  item:",
+            "    type: org.apache.brooklyn.entity.stock.BasicEntity");
         
         String entityName = "YAML -> yaml url -> catalog item";
         Entity app = createAndStartApplication(
@@ -161,6 +164,7 @@ public class ReferencedYamlTest extends AbstractYamlTest {
     public void testYamlUrlReferencingCallerCatalogItem() throws Exception {
         addCatalogItems(
             "brooklyn.catalog:",
+            "  itemType: entity",
             "  items:",
             "  - id: yaml.standalone",
             "    version: " + TEST_VERSION,
@@ -195,11 +199,11 @@ public class ReferencedYamlTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + parentCatalogId,
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
-            "",
-            "services:",
-            "- type: classpath://yaml-ref-bundle-without-libraries.yaml");
+            "  item:",
+            "    type: classpath://yaml-ref-bundle-without-libraries.yaml");
 
         Entity app = createAndStartApplication(
             "services:",
@@ -245,6 +249,7 @@ public class ReferencedYamlTest extends AbstractYamlTest {
             "  - " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  items:",
             "  - id: yaml.nested.catalog.simple",
+            "    itemType: entity",
             "    item:",
             "      type: " + OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_ENTITY,
             "  - include: classpath://yaml-ref-back-catalog.bom");
@@ -272,6 +277,7 @@ public class ReferencedYamlTest extends AbstractYamlTest {
             "  - include: classpath://yaml-ref-parent-catalog.bom",
             "    items:",
             "    - id: yaml.nested.catalog.nested",
+            "      itemType: entity",
             "      item:",
             "        type: " + OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_ENTITY);
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java
index 10575c5..cc9066c 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java
@@ -22,6 +22,7 @@ import org.testng.annotations.Test;
 
 import org.apache.brooklyn.camp.brooklyn.AbstractYamlTest;
 import org.apache.brooklyn.camp.brooklyn.ApplicationsYamlTest;
+import org.apache.brooklyn.entity.stock.BasicEntity;
 
 /**
  * Also see related tests in {@link ApplicationsYamlTest}.
@@ -51,14 +52,15 @@ public class CatalogYamlAppTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: org.apache.brooklyn.entity.stock.BasicEntity",
                 "  version: "+TEST_VERSION,
-                "services:",
-                "- type: org.apache.brooklyn.entity.stock.BasicApplication",
-                "  brooklyn.config:",
-                "    memberSpec:",
-                "      $brooklyn:entitySpec:",
-                "      - type: org.apache.brooklyn.entity.stock.BasicApplication",
-                "        brooklyn.children:",
-                "        - type: org.apache.brooklyn.entity.stock.BasicEntity");
+                "  itemType: entity",
+                "  item:",
+                "    type: org.apache.brooklyn.entity.stock.BasicApplication",
+                "    brooklyn.config:",
+                "      memberSpec:",
+                "        $brooklyn:entitySpec:",
+                "        - type: org.apache.brooklyn.entity.stock.BasicApplication",
+                "          brooklyn.children:",
+                "          - type: org.apache.brooklyn.entity.stock.BasicEntity");
 
         try {
             // Use the blueprint from the catalog that has the circular reference.
@@ -67,8 +69,9 @@ public class CatalogYamlAppTest extends AbstractYamlTest {
                     "brooklyn.catalog:",
                     "  id: another.app.in.the.catalog",
                     "  version: "+TEST_VERSION,
-                    "services:",
-                    "- type: org.apache.brooklyn.entity.stock.BasicEntity");
+                    "  itemType: entity",
+                    "  item:",
+                    "    type: " + BasicEntity.class.getName());
             deleteCatalogEntity("another.app.in.the.catalog");
         } finally {
             deleteCatalogEntity("org.apache.brooklyn.entity.stock.BasicEntity");
@@ -82,12 +85,13 @@ public class CatalogYamlAppTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: org.apache.brooklyn.entity.stock.BasicApplication",
                 "  version: "+TEST_VERSION,
-                "services:",
-                "- type: org.apache.brooklyn.entity.stock.BasicApplication",
-                "  brooklyn.config:",
-                "    memberSpec:",
-                "      $brooklyn:entitySpec:",
-                "      - type: org.apache.brooklyn.entity.stock.BasicApplication");
+                "  itemType: entity",
+                "  item:",
+                "    type: org.apache.brooklyn.entity.stock.BasicApplication",
+                "    brooklyn.config:",
+                "      memberSpec:",
+                "        $brooklyn:entitySpec:",
+                "        - type: org.apache.brooklyn.entity.stock.BasicApplication");
 
         try {
             // Use the blueprint from the catalog that has the circular reference.
@@ -95,8 +99,9 @@ public class CatalogYamlAppTest extends AbstractYamlTest {
                     "brooklyn.catalog:",
                     "  id: another.app.in.the.catalog",
                     "  version: "+TEST_VERSION,
-                    "services:",
-                    "- type: org.apache.brooklyn.entity.stock.BasicApplication");
+                    "  itemType: entity",
+                    "  item:",
+                    "    type: org.apache.brooklyn.entity.stock.BasicApplication");
             deleteCatalogEntity("another.app.in.the.catalog");
         } finally {
             deleteCatalogEntity("org.apache.brooklyn.entity.stock.BasicApplication");

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlCombiTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlCombiTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlCombiTest.java
index 8ce0023..56c51ce 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlCombiTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlCombiTest.java
@@ -46,17 +46,14 @@ public class CatalogYamlCombiTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  version: "+TEST_VERSION,
             "  items:",
-            
-            "  - itemType: entity",
+            "  - id: A",
+            "    itemType: entity",
             "    item:",
-            // TODO inclusion of the above information gives a better error message when no transformers
-//            "  - item:",
-            
-            "      id: A",
             "      type: "+BasicEntity.class.getName(),
             "      brooklyn.config: { a: 1, b: 0 }",
-            "  - item:",
-            "      id: B",
+            "  - id: B",
+            "    itemType: entity",
+            "    item:",
             "      type: A",
             "      brooklyn.config: { b: 1 }");
 
@@ -92,22 +89,24 @@ public class CatalogYamlCombiTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  version: "+TEST_VERSION,
-            "  id: Z",
+            "  itemType: location",
             "  items:",
-            "  - item: ",
+            "  - id: Z",
+            "    item: ",
             "      type: localhost",
             "      brooklyn.config: { z: 9 }");
         addCatalogItems(
             "brooklyn.catalog:",
             "  version: "+TEST_VERSION,
             "  items:",
-            "  - item_type: policy", 
+            "  - id: A",
+            "    itemType: policy", 
             "    item:",
-            "      id: A",
             "      type: "+ServiceRestarter.class.getName(),
             "      brooklyn.config: { a: 99 }",
-            "  - item:",
-            "      id: B",
+            "  - id: B",
+            "    itemType: entity",
+            "    item:",
             "      type: "+BasicStartable.class.getName(),
             "      location: Z",
             "      brooklyn.policies:",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityNameTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityNameTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityNameTest.java
index 23a0c6c..391d937 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityNameTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityNameTest.java
@@ -37,8 +37,9 @@ public class CatalogYamlEntityNameTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
-            "  name: nameInItemMetadata",
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
+            "  name: nameInItemMetadata",
             "  item:",
             "    type: "+ BasicEntity.class.getName());
 
@@ -95,8 +96,9 @@ public class CatalogYamlEntityNameTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
-            "  name: nameInItemMetadata",
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
+            "  name: nameInItemMetadata",
             "  item:",
             "    type: "+ BasicEntity.class.getName(),
             "    brooklyn.config:",
@@ -176,8 +178,9 @@ public class CatalogYamlEntityNameTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
-            "  name: nameInItemMetadata",
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
+            "  name: nameInItemMetadata",
             "  item:",
             "    type: "+ BasicEntity.class.getName());
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
index a75c325..484c160 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
@@ -26,6 +26,7 @@ import static org.testng.Assert.fail;
 import java.io.InputStream;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.brooklyn.api.catalog.BrooklynCatalog;
 import org.apache.brooklyn.api.entity.Entity;
@@ -51,6 +52,8 @@ import org.apache.brooklyn.util.osgi.OsgiTestResources;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Iterables;
 
 
@@ -70,6 +73,7 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + symbolicName,
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  item:",
             "    type: "+ BasicEntity.class.getName());
 
@@ -91,18 +95,19 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
         deleteCatalogEntity(symbolicName);
     }
 
+    // Legacy / backwards compatibility: should always specify itemType
     @Test
-    public void testAddCatalogItemTypeAsString() throws Exception {
+    public void testAddCatalogItemAsStringWithoutItemType() throws Exception {
         TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
 
         String symbolicName = "my.catalog.app.id.load";
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            "  version: " + TEST_VERSION,
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",
-            "  version: " + TEST_VERSION,
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  item: " + SIMPLE_ENTITY_TYPE);
@@ -121,11 +126,11 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",
-            "  version: " + TEST_VERSION,
-            "  item_type: entity",
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  item: " + SIMPLE_ENTITY_TYPE);
@@ -137,7 +142,7 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
     }
 
     @Test
-    public void testAddCatalogItemTopLevelSyntax() throws Exception {
+    public void testAddCatalogItemLegacySyntax() throws Exception {
         TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
 
         String symbolicName = "my.catalog.app.id.load";
@@ -160,14 +165,16 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
         deleteCatalogEntity(symbolicName);
     }
 
+    // Legacy / backwards compatibility: should use id
     @Test
-    public void testAddCatalogItemWithoutVersion() throws Exception {
+    public void testAddCatalogItemUsingNameInsteadOfIdWithoutVersion() throws Exception {
         TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
 
         String id = "unversioned.app";
         addCatalogItems(
             "brooklyn.catalog:",
             "  name: " + id,
+            "  itemType: entity",
             "  libraries:",
             "  - " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  item:",
@@ -177,14 +184,16 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
         mgmt().getCatalog().deleteCatalogItem(id, "0.0.0.SNAPSHOT");
     }
 
+    // Legacy / backwards compatibility: should use id
     @Test
-    public void testAddCatalogItemWithInlinedVersion() throws Exception {
+    public void testAddCatalogItemUsingNameInsteadOfIdWithInlinedVersion() throws Exception {
         TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
 
         String id = "inline_version.app";
         addCatalogItems(
             "brooklyn.catalog:",
             "  name: " + id+":"+TEST_VERSION,
+            "  itemType: entity",
             "  libraries:",
             "  - " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "services:",
@@ -225,7 +234,9 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
         String referencedSymbolicName = "my.catalog.app.id.referenced";
         String referrerSymbolicName = "my.catalog.app.id.referring";
-        addCatalogOSGiEntities(referencedSymbolicName, SIMPLE_ENTITY_TYPE, referrerSymbolicName, ver(referencedSymbolicName));
+        addCatalogOSGiEntities(ImmutableMap.of(
+                referencedSymbolicName, SIMPLE_ENTITY_TYPE, 
+                referrerSymbolicName, ver(referencedSymbolicName)));
 
         RegisteredType referrer = mgmt().getTypeRegistry().get(referrerSymbolicName, TEST_VERSION);
         String planYaml = RegisteredTypes.getImplementationDataStringForSpec(referrer);
@@ -377,23 +388,23 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + firstItemId,
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
-            "",
-            "services:",
-            "- type: " + SIMPLE_ENTITY_TYPE);
+            "  item:",
+            "    type: " + SIMPLE_ENTITY_TYPE);
         deleteCatalogEntity(firstItemId);
 
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + secondItemId,
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  libraries:",
             "  - name: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_NAME,
             "    version: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_VERSION,
-            "",
-            "services:",
-            "- type: " + SIMPLE_ENTITY_TYPE);
+            "  item:",
+            "    type: " + SIMPLE_ENTITY_TYPE);
 
         deleteCatalogEntity(secondItemId);
     }
@@ -407,12 +418,12 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: my.catalog.app.id.non_existing.ref",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  libraries:",
                 "  - name: " + nonExistentId,
                 "    version: " + nonExistentVersion,
-                "",
-                "services:",
-                "- type: " + SIMPLE_ENTITY_TYPE);
+                "  item:",
+                "    type: " + SIMPLE_ENTITY_TYPE);
             fail();
         } catch (IllegalStateException e) {
             Assert.assertEquals(e.getMessage(), "Bundle from null failed to install: Bundle CatalogBundleDto{symbolicName=" + nonExistentId + ", version=" + nonExistentVersion + ", url=null} not previously registered, but URL is empty.");
@@ -426,11 +437,11 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: my.catalog.app.id.non_existing.ref",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  libraries:",
                 "  - name: io.brooklyn.brooklyn-test-osgi-entities",
-                "",
-                "services:",
-                "- type: " + SIMPLE_ENTITY_TYPE);
+                "  item:",
+                "    type: " + SIMPLE_ENTITY_TYPE);
             fail();
         } catch (NullPointerException e) {
             Assert.assertEquals(e.getMessage(), "both name and version are required");
@@ -440,11 +451,11 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: my.catalog.app.id.non_existing.ref",
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  libraries:",
                 "  - version: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_VERSION,
-                "",
-                "services:",
-                "- type: " + SIMPLE_ENTITY_TYPE);
+                "  item:",
+                "    type: " + SIMPLE_ENTITY_TYPE);
             fail();
         } catch (NullPointerException e) {
             Assert.assertEquals(e.getMessage(), "both name and version are required");
@@ -460,13 +471,13 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + itemId,
             "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  libraries:",
             "  - name: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_NAME,
             "    version: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_VERSION,
             "    url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
-            "",
-            "services:",
-            "- type: " + SIMPLE_ENTITY_TYPE);
+            "  item:",
+            "    type: " + SIMPLE_ENTITY_TYPE);
         deleteCatalogEntity(itemId);
     }
 
@@ -486,13 +497,14 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + firstItemId,
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  libraries:",
                 "  - name: " + nonExistentId,
                 "    version: " + nonExistentVersion,
                 "    url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
                 "",
-                "services:",
-                "- type: " + SIMPLE_ENTITY_TYPE);
+                "  item:",
+                "    type: " + SIMPLE_ENTITY_TYPE);
             fail();
         } catch (IllegalStateException e) {
             assertEquals(e.getMessage(), "Bundle from " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL + " failed to install: " +
@@ -567,18 +579,18 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + symbolicName,
             "  version: " + TEST_VERSION,
-            "",
-            "services:",
-            "- type: org.apache.brooklyn.entity.stock.BasicEntity");
+            "  itemType: entity",
+            "  item:",
+            "    type: org.apache.brooklyn.entity.stock.BasicEntity");
 
         try {
             addCatalogItems(
                     "brooklyn.catalog:",
                     "  id: " + symbolicName,
                     "  version: " + TEST_VERSION + "-update",
-                    "",
-                    "services:",
-                    "- type: " + symbolicName);
+                    "  itemType: entity",
+                    "  item:",
+                    "    type: " + symbolicName);
             fail("Catalog addition expected to fail due to non-existent java type " + symbolicName);
         } catch (IllegalStateException e) {
             assertTrue(e.toString().contains("recursive"), "Unexpected error message: "+e);
@@ -592,9 +604,9 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + symbolicName,
             "  version: " + TEST_VERSION,
-            "",
-            "services:",
-            "- type: org.apache.brooklyn.entity.stock.BasicEntity");
+            "  itemType: entity",
+            "  item:",
+            "    type: org.apache.brooklyn.entity.stock.BasicEntity");
 
         String versionedId = CatalogUtils.getVersionedId(symbolicName, TEST_VERSION);
         try {
@@ -602,9 +614,9 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + symbolicName,
                 "  version: " + TEST_VERSION + "-update",
-                "",
-                "services:",
-                "- type: " + versionedId);
+                "  itemType: entity",
+                "  item:",
+                "    type: " + versionedId);
             fail("Catalog addition expected to fail due to non-existent java type " + versionedId);
         } catch (IllegalStateException e) {
             assertTrue(e.toString().contains("recursive"), "Unexpected error message: "+e);
@@ -620,26 +632,26 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + symbolicName + ".caller",
                 "  version: " + TEST_VERSION + "pre",
-                "",
-                "services:",
-                "- type: "+BasicEntity.class.getName());
+                "  itemType: entity",
+                "  item:",
+                "    type: "+BasicEntity.class.getName());
 
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: " + symbolicName + ".callee",
                 "  version: " + TEST_VERSION,
-                "",
-                "services:",
-                "- type: " + symbolicName + ".caller");
+                "  itemType: entity",
+                "  item:",
+                "    type: " + symbolicName + ".caller");
 
         try {
             addCatalogItems(
                     "brooklyn.catalog:",
                     "  id: " + symbolicName + ".caller",
                     "  version: " + TEST_VERSION,
-                    "",
-                    "services:",
-                    "- type: " + symbolicName + ".callee");
+                    "  itemType: entity",
+                    "  item:",
+                    "    type: " + symbolicName + ".callee");
             fail();
         } catch (IllegalStateException e) {
             assertTrue(e.toString().contains("recursive"), "Unexpected error message: "+e);
@@ -655,30 +667,31 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + symbolicName + ".caller",
                 "  version: " + TEST_VERSION + "pre",
-                "",
-                "services:",
-                "- type: org.apache.brooklyn.entity.stock.BasicEntity");
+                "  itemType: entity",
+                "  item:",
+                "    type: org.apache.brooklyn.entity.stock.BasicEntity");
 
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: " + symbolicName + ".callee",
                 "  version: " + TEST_VERSION,
-                "",
-                "services:",
-                "- type: " + symbolicName + ".caller");
+                "  itemType: entity",
+                "  item:",
+                "    type: " + symbolicName + ".caller");
 
         try {
+            // TODO Only passes if include "services:" and if itemType=entity, rather than "template"!
+            // Being a child is important, triggers the case where: we allow retrying with other transformers.
             addCatalogItems(
                     "brooklyn.catalog:",
                     "  id: " + symbolicName + ".caller",
                     "  version: " + TEST_VERSION,
-                    "",
-                    "services:",
-                    "- type: org.apache.brooklyn.entity.stock.BasicEntity",
-                    // Being a child is important, triggers the case where
-                    // we allow retrying with other transformers.
-                    "  brooklyn.children:",
-                    "  - type: " + symbolicName + ".callee");
+                    "  itemType: entity",
+                    "  item:",
+                    "    services:",
+                    "    - type: org.apache.brooklyn.entity.stock.BasicEntity",
+                    "      brooklyn.children:",
+                    "      - type: " + symbolicName + ".callee");
             fail();
         } catch (IllegalStateException e) {
             assertTrue(e.toString().contains("recursive"), "Unexpected error message: "+e);
@@ -692,9 +705,9 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + symbolicName,
                 "  version: " + TEST_VERSION,
-                "",
-                "services:",
-                "- type: org.apache.brooklyn.entity.stock.BasicEntity");
+                "  itemType: entity",
+                "  item:",
+                "    type: org.apache.brooklyn.entity.stock.BasicEntity");
 
         createAndStartApplication(
                 "services:",
@@ -714,9 +727,9 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                     "brooklyn.catalog:",
                     "  id: " + SIMPLE_ENTITY_TYPE,
                     "  version: " + TEST_VERSION + "-update",
-                    "",
-                    "services:",
-                    "- type: " + SIMPLE_ENTITY_TYPE);
+                    "  itemType: entity",
+                    "  item:",
+                    "    type: " + SIMPLE_ENTITY_TYPE);
             fail("Catalog addition expected to fail due to non-existent java type " + SIMPLE_ENTITY_TYPE);
         } catch (IllegalStateException e) {
             assertTrue(e.toString().contains("recursive"), "Unexpected error message: "+e);
@@ -816,29 +829,30 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + id,
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  item:",
+                "    type: " + BasicApplication.class.getName(),
                 "    brooklyn.parameters:",
                 "    - name: test.myconf",
                 "      type:  string",
                 "      default: myval",
-                "    services:",
-                "    - type: " + BasicApplication.class.getName(),
+                "    brooklyn.config:",
+                "      myconf2: $brooklyn:config(\"test.myconf\")",
+                "      myconf2.from.root: $brooklyn:root().config(\"test.myconf\")",
+                "    brooklyn.children:",
+                "    - type: "+BasicEntity.class.getName(),
                 "      brooklyn.config:",
-                "        myconf2: $brooklyn:config(\"test.myconf\")",
-                "        myconf2.from.root: $brooklyn:root().config(\"test.myconf\")",
-                "      brooklyn.children:",
-                "      - type: "+BasicEntity.class.getName(),
-                "        brooklyn.config:",
-                "          myconf3: $brooklyn:config(\"test.myconf\")",
-                "          myconf3.from.root: $brooklyn:root().config(\"test.myconf\")");
+                "        myconf3: $brooklyn:config(\"test.myconf\")",
+                "        myconf3.from.root: $brooklyn:root().config(\"test.myconf\")");
 
         RegisteredType catalogItem = mgmt().getTypeRegistry().get(id, version);
         assertEquals(catalogItem.getVersion(), version);
         
-        String yaml = "name: simple-app-yaml\n" +
-                "location: localhost\n" +
-                "services: \n" +
-                "  - type: "+id+":"+version;
+        String yaml = Joiner.on("\n").join(
+                "name: simple-app-yaml",
+                "location: localhost",
+                "services:",
+                "  - type: "+id+":"+version);
         Entity app = createAndStartApplication(yaml);
         Entity child = Iterables.getOnlyElement(app.getChildren());
         ConfigKey<?> configKey = app.getEntityType().getConfigKey("test.myconf");
@@ -880,10 +894,11 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",
-            "  version: " + TEST_VERSION,
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL +
             (extraLib ? "\n"+"  - url: "+OsgiStandaloneTest.BROOKLYN_OSGI_TEST_A_0_1_0_URL : ""),
@@ -891,7 +906,7 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "    type: " + serviceType);
     }
 
-    private void addCatalogOSGiEntities(String ...namesAndTypes) {
+    private void addCatalogOSGiEntities(Map<String, String> idAndTypes) {
         List<String> lines = MutableList.of(
             "brooklyn.catalog:",
             "  name: My Catalog App",
@@ -902,23 +917,25 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  items:");
         
-        for (int i=0; i<namesAndTypes.length; i+=2) {
+        for (Map.Entry<String, String> entry : idAndTypes.entrySet()) {
             lines.addAll(MutableList.of(
-            "  - id: " + namesAndTypes[i],
+            "  - id: " + entry.getKey(),
             "    item:",
-            "      type: " + namesAndTypes[i+1]));
+            "      type: " + entry.getValue()));
         }
             
         addCatalogItems(lines);
     }
+    
     private void addCatalogChildOSGiEntityWithServicesBlock(String symbolicName, String serviceType) {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",
-            "  version: " + TEST_VERSION,
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  item:",
@@ -927,10 +944,12 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
             "      brooklyn.children:",
             "      - type: " + serviceType);
     }
+    
     private void addCatalogChildOSGiEntity(String symbolicName, String serviceType) {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            "  itemType: entity",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
index 1e35af1..091e972 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
@@ -94,21 +94,21 @@ public class CatalogYamlLocationTest extends AbstractYamlTest {
     }
 
     @Test
-    public void testAddCatalogItemTopLevelItemSyntax() throws Exception {
+    public void testAddCatalogItemLegacySyntax() throws Exception {
         assertEquals(countCatalogLocations(), 0);
 
         String symbolicName = "my.catalog.location.id.load";
-        addCatalogLocationTopLevelItemSyntax(symbolicName, LOCALHOST_LOCATION_TYPE, null);
+        addCatalogLocationLegacySyntax(symbolicName, LOCALHOST_LOCATION_TYPE, null);
         assertAdded(symbolicName, LOCALHOST_LOCATION_TYPE);
         removeAndAssert(symbolicName);
     }
 
     @Test
-    public void testAddCatalogItemOsgiTopLevelItemSyntax() throws Exception {
+    public void testAddCatalogItemOsgiLegacySyntax() throws Exception {
         assertEquals(countCatalogLocations(), 0);
 
         String symbolicName = "my.catalog.location.id.load";
-        addCatalogLocationTopLevelItemSyntax(symbolicName, SIMPLE_LOCATION_TYPE, getOsgiLibraries());
+        addCatalogLocationLegacySyntax(symbolicName, SIMPLE_LOCATION_TYPE, getOsgiLibraries());
         assertAdded(symbolicName, SIMPLE_LOCATION_TYPE);
         assertOsgi(symbolicName);
         removeAndAssert(symbolicName);
@@ -164,18 +164,18 @@ public class CatalogYamlLocationTest extends AbstractYamlTest {
     }
 
     @Test
-    public void testLaunchApplicationReferencingLocationClassTopLevelItemSyntax() throws Exception {
+    public void testLaunchApplicationReferencingLocationClassLegacySyntax() throws Exception {
         String symbolicName = "my.catalog.location.id.launch";
-        addCatalogLocationTopLevelItemSyntax(symbolicName, LOCALHOST_LOCATION_TYPE, null);
+        addCatalogLocationLegacySyntax(symbolicName, LOCALHOST_LOCATION_TYPE, null);
         runLaunchApplicationReferencingLocation(symbolicName, LOCALHOST_LOCATION_TYPE);
 
         deleteCatalogEntity(symbolicName);
     }
 
     @Test
-    public void testLaunchApplicationReferencingLocationSpecTopLevelSyntax() throws Exception {
+    public void testLaunchApplicationReferencingLocationSpecLegacySyntax() throws Exception {
         String symbolicName = "my.catalog.location.id.launch";
-        addCatalogLocationTopLevelItemSyntax(symbolicName, LOCALHOST_LOCATION_SPEC, null);
+        addCatalogLocationLegacySyntax(symbolicName, LOCALHOST_LOCATION_SPEC, null);
         runLaunchApplicationReferencingLocation(symbolicName, LOCALHOST_LOCATION_TYPE);
 
         deleteCatalogEntity(symbolicName);
@@ -384,15 +384,15 @@ public class CatalogYamlLocationTest extends AbstractYamlTest {
         ImmutableList.Builder<String> yaml = ImmutableList.<String>builder().add(
                 "brooklyn.catalog:",
                 "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: location",
                 "  name: My Catalog Location",
-                "  description: My description",
-                "  version: " + TEST_VERSION);
+                "  description: My description");
         if (libraries!=null && libraries.size() > 0) {
             yaml.add("  libraries:")
                 .addAll(Lists.transform(libraries, StringFunctions.prepend("  - url: ")));
         }
         yaml.add(
-                "  item.type: location",
                 "  item:",
                 "    type: " + locationType,
                 "    brooklyn.config:",
@@ -403,7 +403,7 @@ public class CatalogYamlLocationTest extends AbstractYamlTest {
         addCatalogItems(yaml.build());
     }
 
-    private void addCatalogLocationTopLevelItemSyntax(String symbolicName, String locationType, List<String> libraries) {
+    private void addCatalogLocationLegacySyntax(String symbolicName, String locationType, List<String> libraries) {
         ImmutableList.Builder<String> yaml = ImmutableList.<String>builder().add(
                 "brooklyn.catalog:",
                 "  id: " + symbolicName,

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
index beb2840..573bb7c 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
@@ -60,7 +60,7 @@ public class CatalogYamlPolicyTest extends AbstractYamlTest {
         assertEquals(countCatalogPolicies(), 0);
 
         String symbolicName = "my.catalog.policy.id.load";
-        addCatalogOsgiPolicyTopLevelSyntax(symbolicName, SIMPLE_POLICY_TYPE);
+        addCatalogOsgiPolicyLegacySyntax(symbolicName, SIMPLE_POLICY_TYPE);
 
         RegisteredType item = mgmt().getTypeRegistry().get(symbolicName, TEST_VERSION);
         assertEquals(item.getSymbolicName(), symbolicName);
@@ -97,7 +97,7 @@ public class CatalogYamlPolicyTest extends AbstractYamlTest {
     @Test
     public void testLaunchApplicationReferencingPolicyTopLevelSyntax() throws Exception {
         String symbolicName = "my.catalog.policy.id.launch";
-        addCatalogOsgiPolicyTopLevelSyntax(symbolicName, SIMPLE_POLICY_TYPE);
+        addCatalogOsgiPolicyLegacySyntax(symbolicName, SIMPLE_POLICY_TYPE);
         Entity app = createAndStartApplication(
             "name: simple-app-yaml",
             "location: localhost",
@@ -128,17 +128,17 @@ public class CatalogYamlPolicyTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + referrerSymbolicName,
+            "  version: " + TEST_VERSION,
+            "  itemType: entity",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",
-            "  version: " + TEST_VERSION,
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
-            "",
-            "services:",
-            "- type: " + SIMPLE_ENTITY_TYPE,
-            "  brooklyn.policies:",
-            "  - type: " + ver(referencedSymbolicName));
+            "  item:",
+            "    type: " + SIMPLE_ENTITY_TYPE,
+            "    brooklyn.policies:",
+            "    - type: " + ver(referencedSymbolicName));
 
         String yaml = "name: simple-app-yaml\n" +
                       "location: localhost\n" +
@@ -160,10 +160,11 @@ public class CatalogYamlPolicyTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            "  version: " + TEST_VERSION,
+            "  itemType: policy",
             "  name: My Catalog Policy",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",
-            "  version: " + TEST_VERSION,
             "  libraries:",
             "  - url: " + OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL,
             "  item:",
@@ -173,7 +174,7 @@ public class CatalogYamlPolicyTest extends AbstractYamlTest {
             "      config2: config2");
     }
 
-    private void addCatalogOsgiPolicyTopLevelSyntax(String symbolicName, String policyType) {
+    private void addCatalogOsgiPolicyLegacySyntax(String symbolicName, String policyType) {
         TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
 
         addCatalogItems(

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
index 747f630..b91cd11 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
@@ -134,6 +134,7 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest {
                 "brooklyn.catalog:",
                 "  id: " + appSymbolicName,
                 "  version: %s",
+                "  itemType: entity",
                 "  item:",
                 "    type: "+ BasicEntity.class.getName(),
                 "    brooklyn.enrichers:",
@@ -147,7 +148,7 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest {
                 "brooklyn.catalog:",
                 "  id: " + locSymbolicName,
                 "  version: %s",
-                "  item.type: location",
+                "  itemType: location",
                 "  item:",
                 "    type: localhost");
         

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
index 3c9d8a4..954d38d 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
@@ -91,7 +91,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: t1",
-                "  item_type: template",
+                "  itemType: template",
                 "  name: myT1",
                 "  item:",
                 "    services:",
@@ -99,7 +99,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: t2",
-                "  item_type: template",
+                "  itemType: template",
                 "  name: myT2",
                 "  item:",
                 "    services:",
@@ -128,7 +128,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: t1",
-                "  item_type: template",
+                "  itemType: template",
                 "  name: myT1",
                 "  item:",
                 "    services:",
@@ -136,7 +136,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: t2",
-                "  item_type: template",
+                "  itemType: template",
                 "  name: myT2",
                 "  item:",
                 "    services:",
@@ -164,7 +164,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: t1",
-                "  item_type: template",
+                "  itemType: template",
                 "  name: myT1",
                 "  item:",
                 "    services:",
@@ -172,7 +172,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  id: t2",
-                "  item_type: template",
+                "  itemType: template",
                 "  name: myT2",
                 "  item:",
                 "    services:",
@@ -232,7 +232,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
               "      type: org.apache.brooklyn.entity.stock.BasicApplication",
               "      brooklyn.config: { foo: bar }",
               "  - id: app1r",
-              "    item_type: template",
+              "    itemType: template",
               "    item:",
               "      services:",
               "      - type: app1",
@@ -261,7 +261,7 @@ public class CatalogYamlTemplateTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: t1",
-            "  item_type: template",
+            "  itemType: template",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: classpath://path/to/myicon.jpg",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlVersioningTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlVersioningTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlVersioningTest.java
index e740383..7fb4b68 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlVersioningTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlVersioningTest.java
@@ -205,10 +205,12 @@ public class CatalogYamlVersioningTest extends AbstractYamlTest {
     }
 
     private void doTestVersionedReferenceJustAdded(boolean isVersionImplicitSyntax) throws Exception {
-        addCatalogItems(            "brooklyn.catalog:",
-            "  version: 0.9",
+        addCatalogItems(
+            "brooklyn.catalog:",
+            "  itemType: entity",
             "  items:",
             "  - id: referrent",
+            "    version: 0.9",
             "    item:",
             "      type: "+BasicEntity.class.getName(),
             "  - id: referrent",
@@ -269,13 +271,13 @@ public class CatalogYamlVersioningTest extends AbstractYamlTest {
         addCatalogItems(
             "brooklyn.catalog:",
             "  id: " + symbolicName,
+            (version != null ? "  version: " + version : ""),
+            "  itemType: entity",
             "  name: My Catalog App",
             "  description: My description",
             "  icon_url: "+iconUrl,
-            (version != null ? "  version: " + version : ""),
-            "",
-            "services:",
-            "- type: " + type);
+            "  item:",
+            "    type: " + type);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterParsingTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterParsingTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterParsingTest.java
index 6ecfcd8..e738b9b 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterParsingTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterParsingTest.java
@@ -59,6 +59,7 @@ public class SpecParameterParsingTest  extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: test.inputs",
                 "  version: 0.0.1",
+                "  itemType: entity",
                 "  item: ",
                 "    type: "+ BasicApplication.class.getName(),
                 "    brooklyn.parameters:",
@@ -96,6 +97,7 @@ public class SpecParameterParsingTest  extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: test.inputs",
                 "  version: 0.0.1",
+                "  itemType: entity",
                 "  libraries:",
                 "  - classpath://" + OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_PATH,
                 "  item: ",

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
index e129229..d563395 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
@@ -20,6 +20,7 @@ package org.apache.brooklyn.camp.brooklyn.catalog;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.fail;
 
 import java.util.Iterator;
 import java.util.List;
@@ -29,8 +30,10 @@ import org.apache.brooklyn.api.entity.Application;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.EntitySpec;
 import org.apache.brooklyn.api.internal.AbstractBrooklynObjectSpec;
+import org.apache.brooklyn.api.location.Location;
 import org.apache.brooklyn.api.objs.BrooklynObject;
 import org.apache.brooklyn.api.objs.SpecParameter;
+import org.apache.brooklyn.api.policy.Policy;
 import org.apache.brooklyn.camp.brooklyn.AbstractYamlTest;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.config.ConfigKeys;
@@ -84,13 +87,15 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
 
     @Test(dataProvider = "brooklynTypes")
     public void testParameters(Class<? extends BrooklynObject> testClass) {
-        addCatalogItems("brooklyn.catalog:",
-                        "  id: " + SYMBOLIC_NAME,
-                        "  version: " + TEST_VERSION,
-                        "  item:",
-                        "    type: " + testClass.getName(),
-                        "    brooklyn.parameters:",
-                        "    - simple");
+        addCatalogItems(
+                "brooklyn.catalog:",
+                "  id: " + SYMBOLIC_NAME,
+                "  version: " + TEST_VERSION,
+                "  itemType: " + inferItemType(testClass),
+                "  item:",
+                "    type: " + testClass.getName(),
+                "    brooklyn.parameters:",
+                "    - simple");
 
         ConfigKey<String> SIMPLE_CONFIG = ConfigKeys.newStringConfigKey("simple");
         SpecParameter<String> SIMPLE_PARAM = new BasicSpecParameter<>("simple", true, SIMPLE_CONFIG);
@@ -105,6 +110,7 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
             "brooklyn.catalog:",
             "  id: " + SYMBOLIC_NAME,
             "  version: " + TEST_VERSION,
+            "  itemType: " + inferItemType(testClass),
             "  item:",
             "    type: "+ testClass.getName());
 
@@ -119,6 +125,7 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + SYMBOLIC_NAME,
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  item:",
                 "    services:",
                 "    - type: " + ConfigEntityForTest.class.getName(),
@@ -142,6 +149,7 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  version: " + TEST_VERSION,
+                "  itemType: " + inferItemType(type),
                 "  items:",
                 "  - id: paramItem",
                 "    item:",
@@ -165,6 +173,7 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  version: " + TEST_VERSION,
+                "  itemType: " + inferItemType(type),
                 "  items:",
                 "  - id: paramItem",
                 "    item:",
@@ -192,13 +201,13 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + SYMBOLIC_NAME,
                 "  version: " + TEST_VERSION,
-                "  items:",
-                "  - item:",
-                "      type: " + ConfigEntityForTest.class.getName(),
-                "      brooklyn.children:",
-                "      - type: " + ConfigEntityForTest.class.getName(),
-                "        brooklyn.parameters:",
-                "        - simple");
+                "  itemType: entity",
+                "  item:",
+                "    type: " + ConfigEntityForTest.class.getName(),
+                "    brooklyn.children:",
+                "    - type: " + ConfigEntityForTest.class.getName(),
+                "      brooklyn.parameters:",
+                "      - simple");
 
         CatalogItem<?, ?> item = catalog.getCatalogItem(SYMBOLIC_NAME, TEST_VERSION);
         @SuppressWarnings({ "rawtypes", "unchecked"})
@@ -213,12 +222,12 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
         addCatalogItems(
                 "brooklyn.catalog:",
                 "  version: " + TEST_VERSION,
-                "  items:",
-                "  - id: " + SYMBOLIC_NAME,
-                "    item:",
-                "      type: " + BasicApplication.class.getName(),
-                "      brooklyn.parameters:",
-                "      - simple");
+                "  id: " + SYMBOLIC_NAME,
+                "  itemType: entity",
+                "  item:",
+                "    type: " + BasicApplication.class.getName(),
+                "    brooklyn.parameters:",
+                "    - simple");
 
         EntitySpec<? extends Application> spec = createAppSpec(
                 "services:",
@@ -234,13 +243,13 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
     public void testAppSpecInheritsCatalogRootParameters() {
         addCatalogItems(
                 "brooklyn.catalog:",
+                "  id: " + SYMBOLIC_NAME,
                 "  version: " + TEST_VERSION,
-                "  items:",
-                "  - id: " + SYMBOLIC_NAME,
-                "    item:",
-                "      type: " + BasicApplication.class.getName(),
-                "      brooklyn.parameters:",
-                "      - simple");
+                "  itemType: entity",
+                "  item:",
+                "    type: " + BasicApplication.class.getName(),
+                "    brooklyn.parameters:",
+                "    - simple");
 
         EntitySpec<? extends Application> spec = createAppSpec(
                 "services:",
@@ -255,14 +264,14 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
     public void testAppSpecInheritsCatalogRootParametersWithServices() {
         addCatalogItems(
                 "brooklyn.catalog:",
+                "  id: " + SYMBOLIC_NAME,
                 "  version: " + TEST_VERSION,
-                "  items:",
-                "  - id: " + SYMBOLIC_NAME,
-                "    item:",
-                "      brooklyn.parameters:",
-                "      - simple",
-                "      services:",
-                "      - type: " + BasicApplication.class.getName());
+                "  itemType: entity",
+                "  item:",
+                "    brooklyn.parameters:",
+                "    - simple",
+                "    services:",
+                "    - type: " + BasicApplication.class.getName());
 
         EntitySpec<? extends Application> spec = createAppSpec(
                 "services:",
@@ -288,6 +297,7 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
                 "      services:",
                 "      - type: basic-app",
                 "  - id: basic-app",
+                "    itemType: entity",
                 "    item:",
                 "      type: " + ConfigAppForTest.class.getName());
         EntitySpec<? extends Application> spec = createAppSpec(
@@ -305,6 +315,7 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
                 "brooklyn.catalog:",
                 "  id: " + SYMBOLIC_NAME,
                 "  version: " + TEST_VERSION,
+                "  itemType: entity",
                 "  item:",
                 "    type: " + BasicApplication.class.getName(),
                 "    brooklyn.parameters:",
@@ -376,4 +387,15 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
         return EntityManagementUtils.createEntitySpecForApplication(mgmt(), joinLines(lines));
     }
 
+    private String inferItemType(Class<? extends BrooklynObject> testClass) {
+        if (Entity.class.isAssignableFrom(testClass)) {
+            return "entity";
+        } else if (Policy.class.isAssignableFrom(testClass)) {
+            return "policy";
+        } else if (Location.class.isAssignableFrom(testClass)) {
+            return "location";
+        } else {
+            throw new IllegalArgumentException("Class" + testClass + " not an entity, policy or location");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/test/lite/CampYamlLiteTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/test/lite/CampYamlLiteTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/test/lite/CampYamlLiteTest.java
index 4749fa8..89cbe88 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/test/lite/CampYamlLiteTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/test/lite/CampYamlLiteTest.java
@@ -216,17 +216,18 @@ public class CampYamlLiteTest {
     }
 
     private String getSampleMyCatalogAppYaml(String symbolicName, String bundleUrl) {
-        return "brooklyn.catalog:\n" +
-                "  id: " + symbolicName + "\n" +
-                "  name: My Catalog App\n" +
-                "  description: My description\n" +
-                "  icon_url: classpath:/org/apache/brooklyn/test/osgi/entities/icon.gif\n" +
-                "  version: " + TEST_VERSION + "\n" +
-                "  libraries:\n" +
-                "  - url: " + bundleUrl + "\n" +
-                "\n" +
-                "services:\n" +
-                "- type: io.camp.mock:AppServer\n";
+        return Joiner.on("\n").join(
+                "brooklyn.catalog:",
+                "  id: " + symbolicName,
+                "  version: " + TEST_VERSION,
+                "  itemType: entity",
+                "  name: My Catalog App",
+                "  description: My description",
+                "  icon_url: classpath:/org/apache/brooklyn/test/osgi/entities/icon.gif",
+                "  libraries:",
+                "  - url: " + bundleUrl,
+                "  item:",
+                "    type: io.camp.mock:AppServer");
     }
 
     private void assertMgmtHasSampleMyCatalogApp(String symbolicName, String bundleUrl) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/core/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/core/src/main/resources/catalog.bom b/core/src/main/resources/catalog.bom
index de388c3..75404d5 100644
--- a/core/src/main/resources/catalog.bom
+++ b/core/src/main/resources/catalog.bom
@@ -16,7 +16,8 @@
 # under the License.
 
 brooklyn.catalog:
-    version: 0.10.0-SNAPSHOT # BROOKLYN_VERSION
+    version: "0.10.0-SNAPSHOT" # BROOKLYN_VERSION
+    itemType: entity
     items:
     - id: org.apache.brooklyn.entity.group.QuarantineGroup
       item:

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/057760ee/core/src/test/java/org/apache/brooklyn/core/catalog/internal/StaticTypePlanTransformer.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/StaticTypePlanTransformer.java b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/StaticTypePlanTransformer.java
index b7255e2..a1bfa98 100644
--- a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/StaticTypePlanTransformer.java
+++ b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/StaticTypePlanTransformer.java
@@ -39,7 +39,8 @@ import org.apache.brooklyn.util.text.Identifiers;
  * <pre> {@code
  *  brooklyn.catalog:
  *    id: test.inputs
- *    version: 0.0.1
+ *    version: "0.0.1"
+ *    itemType: entity
  *    item: <specId>
  * } </pre>
  * <p>