You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by jo...@apache.org on 2019/05/13 20:11:30 UTC

[cayenne] 02/02: Add failing test for 'less than NULL'

This is an automated email from the ASF dual-hosted git repository.

johnthuss pushed a commit to branch cayenne42testing3
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit d44708010b3ed37f94f6dce4570a27de499120ba
Author: John Huss <jo...@apache.org>
AuthorDate: Mon May 13 15:11:06 2019 -0500

    Add failing test for 'less than NULL'
---
 .../src/test/java/org/apache/cayenne/exp/ExpressionIT.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionIT.java
index b2d8749..3e61669 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionIT.java
@@ -23,6 +23,7 @@ import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.query.ObjectSelect;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
@@ -125,4 +126,14 @@ public class ExpressionIT extends ServerCase {
 		assertNull(e4.first(paintingList));
 	}
 
+    @Test
+	public void testLessThanNull() {
+		Artist a1 = context.newObject(Artist.class);
+		a1.setArtistName("Picasso");
+		context.commitChanges();
+		
+		List<Artist> artists = ObjectSelect.query(Artist.class, Artist.ARTIST_NAME.lt((String)null)).select(context);
+		assertTrue("Less than 'NULL' never matches anything", artists.isEmpty());
+    }
+    
 }