[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] brooklyn-server pull request #982: Improve coercions esp with generics


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

    https://github.com/apache/brooklyn-server/pull/982#discussion_r214640867
  
    --- Diff: utils/common/src/test/java/org/apache/brooklyn/util/text/StringEscapesTest.java ---
    @@ -115,4 +117,80 @@ public void testJavaLists() {
                 JavaStringEscapes.unwrapJsonishListIfPossible("\"\",,x,\"\""));
         }
     
    +    @Test
    +    public void testJavaListString() {
    +        Assert.assertEquals(MutableList.of("hello", "world"),
    +            JavaStringEscapes.unwrapQuotedJavaStringList("\"hello\", \"world\"", ","));
    +        try {
    +            JavaStringEscapes.unwrapQuotedJavaStringList("\"hello\", world", ",");
    +            Assert.fail("Should have thrown");
    +        } catch (Exception e) { /* expected */ }
    +        
    +        Assert.assertEquals(MutableList.of("hello", "world"),
    +            JavaStringEscapes.unwrapJsonishListStringIfPossible("\"hello\", \"world\""));
    --- End diff --
    
    Minor: I'd follow the java convention (and the Brooklyn convention) for indents: 8 spaces. The 4 spaces looks too much like a new code block, rather than a continuation of the previous line.


---