polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [13/25] zest-java git commit: ZEST-124 - Added more asserts in Entity Store test suite.
Date Fri, 19 Aug 2016 12:18:47 GMT
ZEST-124 - Added more asserts in Entity Store test suite.


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

Branch: refs/heads/ValueSerializationCleaning
Commit: e4736b0fd0128dda819acb8f400b25bacba5abc3
Parents: 79021c9
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Sun Jun 12 16:50:41 2016 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Sun Jun 12 22:51:05 2016 +0800

----------------------------------------------------------------------
 .../test/entity/AbstractEntityStoreTest.java    | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/e4736b0f/core/testsupport/src/main/java/org/apache/zest/test/entity/AbstractEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/zest/test/entity/AbstractEntityStoreTest.java
b/core/testsupport/src/main/java/org/apache/zest/test/entity/AbstractEntityStoreTest.java
index b050570..e1f17c1 100644
--- a/core/testsupport/src/main/java/org/apache/zest/test/entity/AbstractEntityStoreTest.java
+++ b/core/testsupport/src/main/java/org/apache/zest/test/entity/AbstractEntityStoreTest.java
@@ -21,9 +21,12 @@ package org.apache.zest.test.entity;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.Duration;
 import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.Period;
 import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.List;
@@ -112,6 +115,12 @@ public abstract class AbstractEntityStoreTest
         instance.dateTimeValue().set( refDate );
         instance.localDateTimeValue().set( LocalDateTime.of( 2020, 3, 4, 13, 23, 00 ) );
         instance.localDateValue().set( LocalDate.of( 2020, 3, 4 ) );
+        instance.localTimeValue().set( LocalTime.of( 19, 20, 21 ) );
+
+        instance.duractionValue().set( Duration.between( LocalDateTime.of( 2010, 1, 2, 19,
20, 21 ),
+                                                         LocalDateTime.of( 2010, 1, 2, 20,
21, 22 ) ) );
+        instance.periodValue().set( Period.between( LocalDate.of( 2005, 12, 21 ), LocalDate.of(
2007, 1, 23 ) ) );
+
         instance.association().set( instance );
 
         ValueBuilder<Tjabba> valueBuilder4 = moduleInstance.newValueBuilder( Tjabba.class
);
@@ -209,6 +218,18 @@ public abstract class AbstractEntityStoreTest
                         instance.localDateValue().get(),
                         equalTo( LocalDate.of( 2020, 3, 4 ) ) );
 
+            assertThat( "property 'localTimeValue' has correct value",
+                        instance.localTimeValue().get(),
+                        equalTo( LocalTime.of( 19, 20, 21 ) ) );
+
+            assertThat( "property 'periodValue' has correct value",
+                        instance.periodValue().get(),
+                        equalTo( Period.of( 1, 1, 2 ) ) );
+
+            assertThat( "property 'durationValue' has correct value",
+                        instance.duractionValue().get(),
+                        equalTo( Duration.ofSeconds( 3661 ) ) );
+
             assertThat( "property 'name' has correct value",
                         instance.name().get(),
                         equalTo( "Test" ) );
@@ -519,6 +540,15 @@ public abstract class AbstractEntityStoreTest
         Property<LocalDate> localDateValue();
 
         @Optional
+        Property<LocalTime> localTimeValue();
+
+        @Optional
+        Property<Period> periodValue();
+
+        @Optional
+        Property<Duration> duractionValue();
+
+        @Optional
         Property<String> name();
 
         @Optional


Mime
View raw message