Fix NnginxClusterIntegrationTest
- if use initialSize=0, then serviceUp behaves differently when
cluster is empty. So don’t do that.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/ace92f67
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/ace92f67
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/ace92f67
Branch: refs/heads/master
Commit: ace92f678d5b68b5a4e7dee974693d62777b0f99
Parents: 7edbe3f
Author: Aled Sage <al...@gmail.com>
Authored: Thu Oct 23 18:45:42 2014 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Oct 23 19:41:06 2014 +0100
----------------------------------------------------------------------
.../entity/proxy/nginx/NginxClusterIntegrationTest.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ace92f67/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
index dfbce80..afb7977 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
@@ -156,19 +156,21 @@ public class NginxClusterIntegrationTest extends BrooklynAppLiveTestSupport {
@Test(groups = "Integration")
public void testClusterIsUpIffHasChildLoadBalancer() {
+ // Note the up-quorum-check behaves different for initialSize==0 (if explicit value not given):
+ // it would accept a size==0 as being serviceUp=true. Therefore don't do that!
loadBalancerCluster = app.createAndManageChild(EntitySpec.create(LoadBalancerCluster.class)
.configure(LoadBalancerCluster.MEMBER_SPEC, nginxSpec)
- .configure("initialSize", 0)
+ .configure("initialSize", 1)
.configure(NginxController.DOMAIN_NAME, "localhost"));
app.start(ImmutableList.of(localhostProvisioningLoc));
- EntityTestUtils.assertAttributeEqualsContinually(loadBalancerCluster, Startable.SERVICE_UP, false);
+ EntityTestUtils.assertAttributeEqualsContinually(loadBalancerCluster, Startable.SERVICE_UP, true);
- loadBalancerCluster.resize(1);
- EntityTestUtils.assertAttributeEqualsEventually(loadBalancerCluster, Startable.SERVICE_UP, true);
-
loadBalancerCluster.resize(0);
EntityTestUtils.assertAttributeEqualsEventually(loadBalancerCluster, Startable.SERVICE_UP, false);
+
+ loadBalancerCluster.resize(1);
+ EntityTestUtils.assertAttributeEqualsEventually(loadBalancerCluster, Startable.SERVICE_UP, true);
}
// Warning: test is a little brittle for if a previous run leaves something on these required ports