apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (APEXMALHAR-2157) Improvements in JSON Formatter
Date Mon, 25 Jul 2016 13:05:20 GMT

    [ https://issues.apache.org/jira/browse/APEXMALHAR-2157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15391846#comment-15391846
] 

ASF GitHub Bot commented on APEXMALHAR-2157:
--------------------------------------------

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

    https://github.com/apache/apex-malhar/pull/348#discussion_r72059197
  
    --- Diff: library/src/test/java/com/datatorrent/lib/formatter/JsonFormatterTest.java ---
    @@ -182,14 +173,19 @@ public void testJSONToPOJONoFieldPOJO()
         Assert.assertEquals(0, validDataSink.collectedTuples.size());
         Assert.assertEquals(1, invalidDataSink.collectedTuples.size());
         Assert.assertEquals(o, invalidDataSink.collectedTuples.get(0));
    +    Assert.assertEquals(1, operator.getIncomingTuplesCount());
    +    Assert.assertEquals(0, operator.getEmittedObjectCount());
    +    Assert.assertEquals(1, operator.getErrorTupleCount());
       }
     
       public static class Test1Pojo
       {
         public int a;
         public long b;
    +    @JsonProperty("c2")
         public String c;
         public List<String> d;
    +    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd")
    --- End diff --
    
    The reason why local test is passing and travis is failing because, the timezones in which
the Date object is generated. The string that you're matching against is based on your local
time zone.
    But when the Date object is created in travis, the build machine is in different time
zone.
    
    Please make the test timezone agnostic.


> Improvements in JSON Formatter
> ------------------------------
>
>                 Key: APEXMALHAR-2157
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2157
>             Project: Apache Apex Malhar
>          Issue Type: Improvement
>            Reporter: shubham pathak
>            Assignee: shubham pathak
>            Priority: Minor
>
> We need following features in existing JSON Formatter
> 1. Ability to provide date format for different date fields in POJO. Current implementation
accepts just one format and applies the same to all date fields.
> 2. Ability to provide JSON field to POJO field mapping.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message