brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [3/4] incubator-brooklyn git commit: Add test for CatalogResource.getEntity(entityId)
Date Thu, 20 Nov 2014 17:01:06 GMT
Add test for CatalogResource.getEntity(entityId)

- The id could be in the form symbolicName or symbolicName:version
  If the latter, then parse it.


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

Branch: refs/heads/master
Commit: 7888f828425646d588f7e2c7ae214ea955a32898
Parents: e84b585
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Nov 18 23:22:00 2014 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu Nov 20 16:59:25 2014 +0000

----------------------------------------------------------------------
 .../brooklyn/rest/resources/CatalogResourceTest.java   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/7888f828/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
b/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
index 5eae763..8e358e1 100644
--- a/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
+++ b/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
@@ -194,6 +194,19 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
   }
 
   @Test
+  @Deprecated
+  //If we move to using a yaml catalog item, the details will be of the wrapping app,
+  //not of the entity itself, so the test won't make sense any more.
+  public void testGetCatalogEntityPlusVersionDetails() {
+      CatalogEntitySummary details = client().resource(
+              URI.create("/v1/catalog/entities/brooklyn.entity.nosql.redis.RedisStore:0.0.0.SNAPSHOT"))
+              .get(CatalogEntitySummary.class);
+      assertTrue(details.toString().contains("redis.port"), "expected more config, only got:
"+details);
+      String expectedIconUrl = "/v1/catalog/icon/" + details.getSymbolicName() + "/" + details.getVersion();
+      assertEquals(details.getIconUrl(), expectedIconUrl, "expected brooklyn URL for icon
image ("+expectedIconUrl+"), but got: "+details.getIconUrl());
+  }
+
+  @Test
   public void testGetCatalogEntityIconDetails() throws IOException {
       String catalogItemId = "testGetCatalogEntityIconDetails";
       addTestCatalogItem(catalogItemId);


Mime
View raw message