You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2014/07/10 15:04:40 UTC

[GitHub] incubator-brooklyn pull request: Fix failing tests

Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/61#discussion_r14763837
  
    --- Diff: core/src/test/java/brooklyn/entity/group/DynamicClusterTest.java ---
    @@ -514,10 +514,18 @@ public void defaultRemovalStrategyShutsDownNewestFirstWhenResizing() throws Exce
             assertEquals(cluster.getCurrentSize(), (Integer)2);
             assertEquals(ImmutableSet.copyOf(cluster.getMembers()), ImmutableSet.copyOf(creationOrder), "actual="+cluster.getMembers());
     
    +        Collection<Entity> preStopMembers = ImmutableList.copyOf(cluster.getMembers());
    +
             // Now stop one
             cluster.resize(1);
             assertEquals(cluster.getCurrentSize(), (Integer)1);
    -        assertEquals(ImmutableList.copyOf(cluster.getMembers()), creationOrder.subList(0, 1));
    +
    +        //Make sure we stopped the entity with the earliest creation time
    +        //Could be multiple entities with identical creation time, pick any.
    +        Entity remainingEntity = cluster.getMembers().iterator().next();
    +        for(Entity entity : preStopMembers) {
    +            assertTrue(entity.getCreationTime() >= remainingEntity.getCreationTime());
    +        }
    --- End diff --
    
    Perhaps we should change the implementation to respect the insertion order instead of changing the test?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---