brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-server git commit: Break library depdendency
Date Sun, 21 Feb 2016 18:40:01 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 450a0021d -> 6299c3586


Break library depdendency


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

Branch: refs/heads/master
Commit: 46a89f3f75e968d25025d27dcd23c2a6a4520f0b
Parents: a6e14b5
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Sun Feb 21 12:38:36 2016 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Sun Feb 21 13:00:42 2016 +0200

----------------------------------------------------------------------
 .../rest/domain/EntityConfigSummary.java        |   3 ++
 rest/rest-resources/pom.xml                     |  18 -----------
 .../rest/resources/CatalogResourceTest.java     |  21 +++++++------
 .../rest/resources/DummyIconEntity.java         |  31 +++++++++++++++++++
 .../rest/resources/DummyIconEntityImpl.java     |  25 +++++++++++++++
 .../src/test/resources/bridge-small.png         | Bin 0 -> 1187 bytes
 6 files changed, 70 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46a89f3f/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
index 1e1de5b..0f94074 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
@@ -77,6 +77,9 @@ public class EntityConfigSummary extends ConfigSummary {
     @Override
     public String toString() {
         return "EntityConfigSummary{" +
+                "name='" + getName() + '\'' +
+                ", type='" + getType() + '\'' +
+                ", description='" + getDescription() + '\'' +
                 "links=" + links +
                 '}';
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46a89f3f/rest/rest-resources/pom.xml
----------------------------------------------------------------------
diff --git a/rest/rest-resources/pom.xml b/rest/rest-resources/pom.xml
index 2f171f8..498cfde 100644
--- a/rest/rest-resources/pom.xml
+++ b/rest/rest-resources/pom.xml
@@ -154,24 +154,6 @@
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-nosql</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-webapp</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-database</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.hamcrest</groupId>
             <artifactId>hamcrest-all</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46a89f3f/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 f3374dc..1eda124 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
@@ -187,13 +187,13 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     @Test
     public void testFilterListOfEntitiesByName() {
         List<CatalogEntitySummary> entities = client().path("/catalog/entities")
-                .query("fragment", "reDISclusTER").get(new GenericType<List<CatalogEntitySummary>>()
{});
+                .query("fragment", "vaNIllasOFTWAREpROCESS").get(new GenericType<List<CatalogEntitySummary>>()
{});
         assertEquals(entities.size(), 1);
 
         log.info("RedisCluster-like entities are: " + entities);
 
         List<CatalogEntitySummary> entities2 = client().path("/catalog/entities")
-                .query("regex", "[Rr]ed.[sulC]+ter").get(new GenericType<List<CatalogEntitySummary>>()
{});
+                .query("regex", "[Vv]an.[alS]+oftware\\w+").get(new GenericType<List<CatalogEntitySummary>>()
{});
         assertEquals(entities2.size(), 1);
 
         assertEquals(entities, entities2);
@@ -213,9 +213,10 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     // not of the entity itself, so the test won't make sense any more.
     public void testGetCatalogEntityDetails() {
         CatalogEntitySummary details = client()
-                .path(URI.create("/catalog/entities/org.apache.brooklyn.entity.nosql.redis.RedisStore"))
+                .path(URI.create("/catalog/entities/org.apache.brooklyn.rest.resources.DummyIconEntity"))
                 .get(CatalogEntitySummary.class);
-        assertTrue(details.toString().contains("redis.port"), "expected more config, only
got: "+details);
+        assertTrue(details.toString().contains("dummy.config"), "expected more config, only
got: "+details);
+        // No icons in brooklyn-server entities
         String iconUrl = "/catalog/icon/" + details.getSymbolicName();
         assertTrue(details.getIconUrl().contains(iconUrl), "expected brooklyn URL for icon
image, but got: " + details.getIconUrl());
     }
@@ -226,9 +227,9 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     // not of the entity itself, so the test won't make sense any more.
     public void testGetCatalogEntityPlusVersionDetails() {
         CatalogEntitySummary details = client()
-                .path(URI.create("/catalog/entities/org.apache.brooklyn.entity.nosql.redis.RedisStore:0.0.0.SNAPSHOT"))
+                .path(URI.create("/catalog/entities/org.apache.brooklyn.rest.resources.DummyIconEntity:0.0.0.SNAPSHOT"))
                 .get(CatalogEntitySummary.class);
-        assertTrue(details.toString().contains("redis.port"), "expected more config, only
got: "+details);
+        assertTrue(details.toString().contains("dummy.config"), "expected more config, only
got: "+details);
         URI expectedIconUrl = URI.create(getEndpointAddress() + "/catalog/icon/" + details.getSymbolicName()
+ "/" + details.getVersion()).normalize();
         assertEquals(details.getIconUrl(), expectedIconUrl.getPath(), "expected brooklyn
URL for icon image ("+expectedIconUrl+"), but got: "+details.getIconUrl());
     }
@@ -236,7 +237,7 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
     @Test
     public void testGetCatalogEntityIconDetails() throws IOException {
         String catalogItemId = "testGetCatalogEntityIconDetails";
-        addTestCatalogItemRedisAsEntity(catalogItemId);
+        addTestCatalogItemAsEntity(catalogItemId);
         Response response = client().path(URI.create("/catalog/icon/" + catalogItemId + "/"
+ TEST_VERSION))
                 .get();
         response.bufferEntity();
@@ -246,8 +247,8 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
         Assert.assertNotNull(image);
     }
 
-    private void addTestCatalogItemRedisAsEntity(String catalogItemId) {
-        addTestCatalogItem(catalogItemId, null, TEST_VERSION, "org.apache.brooklyn.entity.nosql.redis.RedisStore");
+    private void addTestCatalogItemAsEntity(String catalogItemId) {
+        addTestCatalogItem(catalogItemId, null, TEST_VERSION, "org.apache.brooklyn.rest.resources.DummyIconEntity");
     }
 
     private void addTestCatalogItem(String catalogItemId, String itemType, String version,
String service) {
@@ -257,7 +258,7 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
                 "  name: My Catalog App\n"+
                 (itemType!=null ? "  item_type: "+itemType+"\n" : "")+
                 "  description: My description\n"+
-                "  icon_url: classpath:///redis-logo.png\n"+
+                "  icon_url: classpath:///bridge-small.png\n"+
                 "  version: " + version + "\n"+
                 "\n"+
                 "services:\n"+

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46a89f3f/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntity.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntity.java
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntity.java
new file mode 100644
index 0000000..65aed53
--- /dev/null
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntity.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.rest.resources;
+
+import org.apache.brooklyn.api.catalog.Catalog;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.entity.stock.BasicEntity;
+
+@Catalog(name="DummyTestEntity", description="Dummy entity for testing catalog with icon",
iconUrl="classpath:///bridge-small.png")
+@ImplementedBy(DummyIconEntityImpl.class)
+public interface DummyIconEntity extends BasicEntity {
+    ConfigKey<String> DUMMY_CONFIG = ConfigKeys.newStringConfigKey("dummy.config");
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46a89f3f/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntityImpl.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntityImpl.java
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntityImpl.java
new file mode 100644
index 0000000..da1f396
--- /dev/null
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/DummyIconEntityImpl.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.rest.resources;
+
+import org.apache.brooklyn.entity.stock.BasicEntityImpl;
+
+public class DummyIconEntityImpl extends BasicEntityImpl implements DummyIconEntity {
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46a89f3f/rest/rest-resources/src/test/resources/bridge-small.png
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/resources/bridge-small.png b/rest/rest-resources/src/test/resources/bridge-small.png
new file mode 100644
index 0000000..a446264
Binary files /dev/null and b/rest/rest-resources/src/test/resources/bridge-small.png differ


Mime
View raw message