cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject cayenne git commit: null unit test
Date Sat, 07 Jan 2017 15:12:50 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master b2d210e69 -> 9374d402e


null unit test


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/9374d402
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/9374d402
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/9374d402

Branch: refs/heads/master
Commit: 9374d402e642a77fbed2e30ae0ddcad15be48489
Parents: b2d210e
Author: Andrus Adamchik <andrus@objectstyle.com>
Authored: Sat Jan 7 18:12:35 2017 +0300
Committer: Andrus Adamchik <andrus@objectstyle.com>
Committed: Sat Jan 7 18:12:35 2017 +0300

----------------------------------------------------------------------
 .../org/apache/cayenne/java8/Java8TimeIT.java   | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/9374d402/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java b/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
index 0d78fd8..e837044 100644
--- a/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
+++ b/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
@@ -19,23 +19,38 @@
 
 package org.apache.cayenne.java8;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.java8.db.LocalDateTestEntity;
 import org.apache.cayenne.java8.db.LocalDateTimeTestEntity;
 import org.apache.cayenne.java8.db.LocalTimeTestEntity;
 import org.apache.cayenne.query.ObjectSelect;
+import org.junit.Assert;
 import org.junit.Test;
 
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 public class Java8TimeIT extends RuntimeBase {
 
 	@Test
+	public void testJava8LocalDate_Null() {
+		ObjectContext context = runtime.newContext();
+
+		LocalDateTestEntity localDateTestEntity = context.newObject(LocalDateTestEntity.class);
+		localDateTestEntity.setDate(null);
+
+		context.commitChanges();
+
+		LocalDateTestEntity testRead = ObjectSelect.query(LocalDateTestEntity.class).selectOne(context);
+
+		Assert.assertNull(testRead.getDate());
+	}
+
+	@Test
 	public void testJava8LocalDate() {
 		ObjectContext context = runtime.newContext();
 


Mime
View raw message