brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Fix enrichers too much rebinded
Date Thu, 31 Jul 2014 21:25:11 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/101#discussion_r15671049
  
    --- Diff: software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppRebindTest.java
---
    @@ -117,7 +119,58 @@ public void testRebindToKilledJavaApp() throws Exception {
             VanillaJavaApp javaProcess2 = (VanillaJavaApp) Iterables.find(app.getChildren(),
Predicates.instanceOf(VanillaJavaApp.class));
             EntityTestUtils.assertAttributeEqualsEventually(javaProcess2, VanillaJavaApp.SERVICE_UP,
false);
             
    -        // check that it was quick (previously it hung for 
    +        // check that it was quick (previously it hung)
             assertTrue(rebindTime < 30*1000, "rebindTime="+rebindTime);
         }
    +    
    +    
    +    @Test(groups="Integration")
    +    public void testEnrichersOnRebindJavaApp() throws Exception {
    +        VanillaJavaApp javaProcess = app.addChild(EntitySpec.create(VanillaJavaApp.class,
EnrichedVanillaJavaAppImpl.class)
    +            .configure("main", MAIN_CLASS.getCanonicalName()).configure("classpath",
ImmutableList.of(BROOKLYN_THIS_CLASSPATH)));
    +
    +        Entities.manage(javaProcess);
    +        app.start(ImmutableList.of(loc));
    +
    +        EntityTestUtils.assertAttributeEventuallyNonNull(javaProcess, EnrichedVanillaJavaAppImpl.AVG1);
    +        EntityTestUtils.assertAttributeEventuallyNonNull(javaProcess, EnrichedVanillaJavaAppImpl.AVG2);
    +        LOG.info("Got avg "+javaProcess.getAttribute(EnrichedVanillaJavaAppImpl.AVG1));
    +
    +        rebind();
    +        VanillaJavaApp javaProcess2 = (VanillaJavaApp) Iterables.find(app.getChildren(),
Predicates.instanceOf(VanillaJavaApp.class));
    +
    +        // check sensors working
    +        EntityTestUtils.assertAttributeEventually(javaProcess2, EnrichedVanillaJavaAppImpl.PROCESS_CPU_TIME,

    --- End diff --
    
    Could use `EntityTestUtils.assertAttributeChangesEventually`


---
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.
---

Mime
View raw message