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

    https://github.com/apache/incubator-brooklyn/pull/101#discussion_r15683381
  
    --- 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 --
    
    nice


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to