brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #835: Tasks subsystem improvements - adjuncts, ...
Date Thu, 05 Oct 2017 16:03:25 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/835#discussion_r142982817
  
    --- Diff: core/src/test/java/org/apache/brooklyn/core/mgmt/internal/LocalSubscriptionManagerTest.java
---
    @@ -170,4 +181,84 @@ public void run() {
             if (threadException.get() != null) throw threadException.get();
         }
     
    +    @Test
    +    // same test as in PolicySubscriptionTest, but for entities / simpler
    +    public void testSubscriptionReceivesInitialValueEventsInOrder() {
    +        RecordingSensorEventListener<Object> listener = new RecordingSensorEventListener<>();
    +        
    +        entity.sensors().set(TestEntity.NAME, "myname");
    +        entity.sensors().set(TestEntity.SEQUENCE, 123);
    +        entity.sensors().emit(TestEntity.MY_NOTIF, -1);
    +
    +        // delivery should be in subscription order, so 123 then 456
    +        entity.subscriptions().subscribe(ImmutableMap.of("notifyOfInitialValue", true),
entity, TestEntity.SEQUENCE, listener);
    +        // wait for the above delivery - otherwise it might get dropped
    +        Asserts.succeedsEventually(MutableMap.of("timeout", Duration.seconds(5)), ()
-> { 
    --- End diff --
    
    ooh handy forgot about this!


---

Mime
View raw message