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: Updates to Test framework asserti...
Date Mon, 30 Nov 2015 17:09:14 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1066#discussion_r46171793
  
    --- Diff: usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/BaseTest.java
---
    @@ -47,16 +47,16 @@
         ConfigKey<String> TARGET_ID = ConfigKeys.newStringConfigKey("targetId", "Id
of the entity under test");
     
         /**
    -     * The assertions to be made
    +     * The assertions to be made.
          */
    -    ConfigKey<List<Map<String, Object>>> ASSERTIONS = ConfigKeys.newConfigKey(
    -            new TypeToken<List<Map<String, Object>>>() {},
    -            "assert", "Assertions to be evaluated", new ArrayList<Map<String, Object>>());
    +    ConfigKey<Object> ASSERTIONS = ConfigKeys.newConfigKey(Object.class, "assert",
"Assertions to be evaluated",
    +        new ArrayList<Map<String, Object>>());
    --- End diff --
    
    Personal preference for the default value of the config key to be immutable. Otherwise
if someone modifies it, things get very strange (it changes the default for all other entities
that use it, until Brooklyn is restarted!)
    
    I'd therefore use `ImmutableList.of()` (presumably the generics don't matter, now that
it's change to be a config key of type `Object`).


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