Repository: brooklyn-server Updated Branches: refs/heads/master 9eaa969d9 -> a0f884059
Revert "add original failing test from @sjcorbett" This reverts commit d7cbaeed46d7fedf8e49df015baa812352060f45. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/ba2cf5d0 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/ba2cf5d0 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/ba2cf5d0 Branch: refs/heads/master Commit: ba2cf5d0af6a755769a0e1022ac077e81743c591 Parents: e317fc5 Author: graeme.miller <[email protected]> Authored: Tue Mar 14 15:35:38 2017 +0000 Committer: graeme.miller <[email protected]> Committed: Wed Mar 15 11:34:55 2017 +0000 ---------------------------------------------------------------------- rest/rest-server/pom.xml | 6 - .../BrooklynRestApiLauncherTestFixture.java | 2 +- .../entity/RedisClusterIntegrationTest.java | 109 ------------------- 3 files changed, 1 insertion(+), 116 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ba2cf5d0/rest/rest-server/pom.xml ---------------------------------------------------------------------- diff --git a/rest/rest-server/pom.xml b/rest/rest-server/pom.xml index bcd271b..a269b72 100644 --- a/rest/rest-server/pom.xml +++ b/rest/rest-server/pom.xml @@ -153,12 +153,6 @@ </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-locations-jclouds</artifactId> <version>${project.version}</version> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ba2cf5d0/rest/rest-server/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTestFixture.java ---------------------------------------------------------------------- diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTestFixture.java b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTestFixture.java index 642ef87..b84dbcf 100644 --- a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTestFixture.java +++ b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTestFixture.java @@ -47,7 +47,7 @@ import static org.testng.Assert.assertTrue; public abstract class BrooklynRestApiLauncherTestFixture { - protected Server server = null; + Server server = null; @AfterMethod(alwaysRun=true) public void stopServer() throws Exception { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ba2cf5d0/rest/rest-server/src/test/java/org/apache/brooklyn/rest/test/entity/RedisClusterIntegrationTest.java ---------------------------------------------------------------------- diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/test/entity/RedisClusterIntegrationTest.java b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/test/entity/RedisClusterIntegrationTest.java deleted file mode 100644 index 79b162b..0000000 --- a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/test/entity/RedisClusterIntegrationTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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.test.entity; - -import static org.apache.brooklyn.test.Asserts.assertTrue; -import static org.testng.Assert.assertNotNull; - -import java.net.URI; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import org.apache.brooklyn.api.entity.Entity; -import org.apache.brooklyn.api.entity.EntitySpec; -import org.apache.brooklyn.api.mgmt.ManagementContext; -import org.apache.brooklyn.api.mgmt.Task; -import org.apache.brooklyn.core.entity.Attributes; -import org.apache.brooklyn.core.entity.Entities; -import org.apache.brooklyn.core.entity.EntityAsserts; -import org.apache.brooklyn.entity.brooklynnode.BrooklynNode; -import org.apache.brooklyn.entity.nosql.redis.RedisCluster; -import org.apache.brooklyn.entity.nosql.redis.RedisStore; -import org.apache.brooklyn.entity.software.base.SoftwareProcess; -import org.apache.brooklyn.rest.BrooklynRestApiLauncherTestFixture; -import org.apache.brooklyn.util.http.HttpAsserts; -import org.apache.brooklyn.util.http.HttpToolResponse; -import org.apache.brooklyn.util.text.Strings; -import org.apache.brooklyn.util.time.Duration; -import org.apache.brooklyn.util.yaml.Yamls; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableMap; - -public class RedisClusterIntegrationTest extends BrooklynRestApiLauncherTestFixture { - - @BeforeMethod(alwaysRun=true) - public void setUp() throws Exception { - useServerForTest(newServer()); - } - - @Test(groups = "Integration") - public void testDeployRedisCluster() throws InterruptedException, ExecutionException, TimeoutException { - final URI webConsoleUri = URI.create(getBaseUriRest()); - - // Test setup - final EntitySpec<BrooklynNode> spec = EntitySpec.create(BrooklynNode.class); - final ManagementContext mgmt = getManagementContextFromJettyServerAttributes(server); - final BrooklynNode node = mgmt.getEntityManager().createEntity(spec); - node.sensors().set(BrooklynNode.WEB_CONSOLE_URI, webConsoleUri); - - // Deploy it. - final String blueprint = "location: localhost\n" + - "services:\n" + - "- type: org.apache.brooklyn.entity.nosql.redis.RedisCluster"; - HttpToolResponse response = node.http().post( - "/applications", - ImmutableMap.of("Content-Type", "text/yaml"), - blueprint.getBytes()); - HttpAsserts.assertHealthyStatusCode(response.getResponseCode()); - - // Assert application is eventually running and not on fire. - final Entity entity = mgmt.getApplications().iterator().next().getChildren().iterator().next(); - assertTrue(entity instanceof RedisCluster, - "expected " + RedisCluster.class.getName() + ", found: " + entity); - RedisCluster cluster = RedisCluster.class.cast(entity); - Entities.dumpInfo(cluster); - assertDownloadUrl(cluster.getMaster()); - for (Entity slave : cluster.getSlaves().getMembers()) { - assertDownloadUrl(slave); - } - - @SuppressWarnings("unchecked") - String taskId = Strings.toString( ((Map<String,Object>) Yamls.parseAll(response.getContentAsString()).iterator().next()).get("id") ); - Task<?> task = mgmt.getExecutionManager().getTask(taskId); - Assert.assertNotNull(task); - - task.get(Duration.minutes(20)); - - Entities.dumpInfo(cluster); - - EntityAsserts.assertAttributeEquals(entity, SoftwareProcess.SERVICE_UP, true); - } - - private void assertDownloadUrl(Entity entity) { - assertNotNull(entity.config().get(RedisStore.DOWNLOAD_URL), "RedisStore.DOWNLOAD_URL"); - assertNotNull(entity.config().get(SoftwareProcess.DOWNLOAD_URL), "SoftwareProcess.DOWNLOAD_URL"); - assertNotNull(entity.config().get(Attributes.DOWNLOAD_URL), "Attributes.DOWNLOAD_URL"); - } - -} \ No newline at end of file
