You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2016/06/12 08:50:47 UTC

zest-java git commit: ZEST-124 - Added more asserts in Entity Store test suite.

Repository: zest-java
Updated Branches:
  refs/heads/develop e5df14531 -> 529448658


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/52944865
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/52944865
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/52944865

Branch: refs/heads/develop
Commit: 529448658c1d202388c5482dc3723194fa4d8c64
Parents: e5df145
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sun Jun 12 16:50:41 2016 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sun Jun 12 16:50:41 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/zest-java/blob/52944865/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