polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [05/50] zest-java git commit: ValueSerialization tests: better DateTime construction for equality test
Date Tue, 28 Jul 2015 12:55:02 GMT
ValueSerialization tests: better DateTime construction for equality test


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/eaeba9ca
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/eaeba9ca
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/eaeba9ca

Branch: refs/heads/master
Commit: eaeba9cac092c059b91afa93ab5989aa44a6bdc6
Parents: 3e3e89d
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon Jul 20 16:48:14 2015 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon Jul 20 16:48:14 2015 +0200

----------------------------------------------------------------------
 .../qi4j/test/value/AbstractPlainValueSerializationTest.java    | 2 ++
 .../test/value/AbstractValueCompositeSerializationTest.java     | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/eaeba9ca/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
index a99b1f2..218cca6 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
@@ -190,6 +190,8 @@ public abstract class AbstractPlainValueSerializationTest
     @Test
     public void givenDateTimeValueWhenSerializingAndDeserializingExpectEquals()
     {
+        // We specify the TimeZone explicitely here so that serialized/deserialized is equals
+        // See https://github.com/JodaOrg/joda-time/issues/106
         String serialized = valueSerialization.serialize( new DateTime( "2020-03-04T13:24:35",
forOffsetHours( 1 ) ) );
         assertThat( serialized, equalTo( "2020-03-04T13:24:35.000+01:00" ) );
         DateTime deserialized = valueSerialization.deserialize( DateTime.class, serialized
);

http://git-wip-us.apache.org/repos/asf/zest-java/blob/eaeba9ca/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
index 4bece76..71135a0 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
@@ -24,6 +24,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
 import org.joda.time.LocalDateTime;
 import org.junit.Before;
@@ -152,7 +153,9 @@ public abstract class AbstractValueCompositeSerializationTest
         proto.string2().set( "/Foo/bar" );
         proto.number().set( 42L );
         proto.date().set( new Date() );
-        proto.dateTime().set( new DateTime() );
+        // We specify the TimeZone explicitely here so that serialized/deserialized is equals
+        // See https://github.com/JodaOrg/joda-time/issues/106
+        proto.dateTime().set( new DateTime( "2020-03-04T13:24:35", DateTimeZone.forOffsetHours(
1 ) ) );
         proto.localDate().set( new LocalDate() );
         proto.localDateTime().set( new LocalDateTime() );
         proto.entityReference().set( EntityReference.parseEntityReference( "12345" ) );


Mime
View raw message