brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] git commit: Fix rest-server ApplicationResourceIntegrationTest
Date Fri, 31 Oct 2014 11:02:59 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 92c197202 -> 9eb58518c


Fix rest-server ApplicationResourceIntegrationTest


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

Branch: refs/heads/master
Commit: 518cb58d2296badb82f306bf86a9d54726086476
Parents: 36b8182
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Wed Oct 29 11:53:57 2014 +0000
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Wed Oct 29 11:53:57 2014 +0000

----------------------------------------------------------------------
 .../ApplicationResourceIntegrationTest.java     | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/518cb58d/usage/rest-server/src/test/java/brooklyn/rest/resources/ApplicationResourceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/brooklyn/rest/resources/ApplicationResourceIntegrationTest.java
b/usage/rest-server/src/test/java/brooklyn/rest/resources/ApplicationResourceIntegrationTest.java
index 0d4c7e9..7cf761f 100644
--- a/usage/rest-server/src/test/java/brooklyn/rest/resources/ApplicationResourceIntegrationTest.java
+++ b/usage/rest-server/src/test/java/brooklyn/rest/resources/ApplicationResourceIntegrationTest.java
@@ -54,15 +54,14 @@ public class ApplicationResourceIntegrationTest extends BrooklynRestResourceTest
     @SuppressWarnings("unused")
     private static final Logger log = LoggerFactory.getLogger(ApplicationResourceIntegrationTest.class);
 
-    private final ApplicationSpec redisSpec = ApplicationSpec.builder().name("redis-app").
-            entities(ImmutableSet.of(new EntitySpec("redis-ent", "brooklyn.entity.nosql.redis.RedisStore"))).
-            locations(ImmutableSet.of("localhost")).
-            build();
+    private final ApplicationSpec redisSpec = ApplicationSpec.builder().name("redis-app")
+            .entities(ImmutableSet.of(new EntitySpec("redis-ent", "brooklyn.entity.nosql.redis.RedisStore")))
+            .locations(ImmutableSet.of("localhost"))
+            .build();
 
     @Test(groups="Integration")
     public void testDeployRedisApplication() throws InterruptedException, TimeoutException
{
-        ClientResponse response = client().resource("/v1/applications/createLegacy")
-                .post(ClientResponse.class, redisSpec);
+        ClientResponse response = clientDeploy(redisSpec);
 
         assertEquals(response.getStatus(), 201);
         assertEquals(getManagementContext().getApplications().size(), 1);
@@ -74,16 +73,14 @@ public class ApplicationResourceIntegrationTest extends BrooklynRestResourceTest
     @Test(groups="Integration", dependsOnMethods = "testDeployRedisApplication")
     public void testListEntities() {
         Set<EntitySummary> entities = client().resource("/v1/applications/redis-app/entities")
-                .get(new GenericType<Set<EntitySummary>>() {
-                });
+                .get(new GenericType<Set<EntitySummary>>() {});
 
         for (EntitySummary entity : entities) {
             client().resource(entity.getLinks().get("self")).get(ClientResponse.class);
             // TODO assertions on the above call?
 
             Set<EntitySummary> children = client().resource(entity.getLinks().get("children"))
-                    .get(new GenericType<Set<EntitySummary>>() {
-                    });
+                    .get(new GenericType<Set<EntitySummary>>() {});
             assertEquals(children.size(), 0);
         }
     }
@@ -91,8 +88,7 @@ public class ApplicationResourceIntegrationTest extends BrooklynRestResourceTest
     @Test(groups="Integration", dependsOnMethods = "testDeployRedisApplication")
     public void testListSensorsRedis() {
         Set<SensorSummary> sensors = client().resource("/v1/applications/redis-app/entities/redis-ent/sensors")
-                .get(new GenericType<Set<SensorSummary>>() {
-                });
+                .get(new GenericType<Set<SensorSummary>>() {});
         assertTrue(sensors.size() > 0);
         SensorSummary uptime = Iterables.find(sensors, new Predicate<SensorSummary>()
{
             @Override


Mime
View raw message