streams-commits 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] (STREAMS-519) Support parsing dates with micro and nano precision with StreamsJacksonMapper
Date Mon, 30 Oct 2017 22:03:01 GMT

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

ASF GitHub Bot commented on STREAMS-519:
----------------------------------------

steveblackmon closed pull request #402: STREAMS-519: Support parsing dates with micro and
nano precision with StreamsJacksonMapper (https://issues.apache.org/jira/browse/STREAMS-519)
URL: https://github.com/apache/streams/pull/402
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/streams-pojo/src/test/java/org/apache/streams/pojo/test/RFC3339UtilsTest.java
b/streams-pojo/src/test/java/org/apache/streams/pojo/test/RFC3339UtilsTest.java
index bce756aec..947a11335 100644
--- a/streams-pojo/src/test/java/org/apache/streams/pojo/test/RFC3339UtilsTest.java
+++ b/streams-pojo/src/test/java/org/apache/streams/pojo/test/RFC3339UtilsTest.java
@@ -69,6 +69,26 @@ public void validUTCSubSecondMultiDigit() {
   }
 
   @Test
+  public void validUTCMicroSecond() {
+    DateTime parsed = parseUTC("2014-12-25T12:00:00.235235Z");
+    assertThat(parsed.minuteOfHour().get(), is(equalTo(0)));
+    assertThat(parsed.hourOfDay().get(), is(equalTo(12)));
+    assertThat(parsed.dayOfMonth().get(), is(equalTo(25)));
+    assertThat(parsed.monthOfYear().get(), is(equalTo(12)));
+    assertThat(parsed.millisOfSecond().get(), is(equalTo(235)));
+  }
+
+  @Test
+  public void validUTCNanoSecond() {
+    DateTime parsed = parseUTC("2014-12-25T12:00:00.123456789Z");
+    assertThat(parsed.minuteOfHour().get(), is(equalTo(0)));
+    assertThat(parsed.hourOfDay().get(), is(equalTo(12)));
+    assertThat(parsed.dayOfMonth().get(), is(equalTo(25)));
+    assertThat(parsed.monthOfYear().get(), is(equalTo(12)));
+    assertThat(parsed.millisOfSecond().get(), is(equalTo(123)));
+  }
+
+  @Test
   public void validEST() {
     DateTime parsed = parseUTC("2014-12-25T12:00:00-05:00");
     assertThat(parsed.minuteOfHour().get(), is(equalTo(0)));


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Support parsing dates with micro and nano precision with StreamsJacksonMapper
> -----------------------------------------------------------------------------
>
>                 Key: STREAMS-519
>                 URL: https://issues.apache.org/jira/browse/STREAMS-519
>             Project: Streams
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
>            Assignee: Steve Blackmon
>
> StreamsJacksonMapper does not currently seem to support parsing dates with greater than
millisecond precision.  Not surprising as Joda supports millis as its smallest interval, but
it should be possible at least to parse a date with greater precision without throwing an
exception.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message