You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2017/04/19 21:05:23 UTC

nifi git commit: NIFI-3718: Fixed TestAvroRecordReader to handle timezone differences

Repository: nifi
Updated Branches:
  refs/heads/master b93cf7bbd -> 141334c3c


NIFI-3718: Fixed TestAvroRecordReader to handle timezone differences

This closes #1683


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/141334c3
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/141334c3
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/141334c3

Branch: refs/heads/master
Commit: 141334c3c9db76c658af2edcd62652a50ba26a4b
Parents: b93cf7b
Author: Matt Burgess <ma...@apache.org>
Authored: Wed Apr 19 16:17:35 2017 -0400
Committer: Matt Burgess <ma...@apache.org>
Committed: Wed Apr 19 17:04:45 2017 -0400

----------------------------------------------------------------------
 .../test/java/org/apache/nifi/avro/TestAvroRecordReader.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/141334c3/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroRecordReader.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroRecordReader.java b/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroRecordReader.java
index dfbd721..56e2e3d 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroRecordReader.java
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroRecordReader.java
@@ -83,7 +83,7 @@ public class TestAvroRecordReader {
             record.put("timeMicros", millisSinceMidnight * 1000L);
             record.put("timestampMillis", timeLong);
             record.put("timestampMicros", timeLong * 1000L);
-            record.put("date", 17261);
+            record.put("date", 17260);
 
             writer.append(record);
             writer.flush();
@@ -106,7 +106,9 @@ public class TestAvroRecordReader {
             assertEquals(new java.sql.Time(millisSinceMidnight), record.getValue("timeMicros"));
             assertEquals(new java.sql.Timestamp(timeLong), record.getValue("timestampMillis"));
             assertEquals(new java.sql.Timestamp(timeLong), record.getValue("timestampMicros"));
-            assertEquals(new java.sql.Date(timeLong).toString(), record.getValue("date").toString());
+            final DateFormat noTimeOfDayDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            noTimeOfDayDateFormat.setTimeZone(TimeZone.getTimeZone("gmt"));
+            assertEquals(new java.sql.Date(timeLong).toString(), noTimeOfDayDateFormat.format(record.getValue("date")));
         }
     }