cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject cayenne git commit: SQLSelect unit tests
Date Wed, 21 Jan 2015 16:36:43 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 3b619d4e0 -> 8434e5f2d


SQLSelect unit tests


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

Branch: refs/heads/master
Commit: 8434e5f2d01d4a052d6816e3a317830c46e698a5
Parents: 3b619d4
Author: aadamchik <aadamchik@apache.org>
Authored: Wed Jan 21 19:36:33 2015 +0300
Committer: aadamchik <aadamchik@apache.org>
Committed: Wed Jan 21 19:36:33 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/cayenne/query/SQLSelectIT.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/8434e5f2/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
index c17f153..f0c3760 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
@@ -246,4 +246,19 @@ public class SQLSelectIT extends ServerCase {
 		assertEquals(2l, ids.get(0).longValue());
 		assertEquals(3l, ids.get(1).longValue());
 	}
+
+	@Test
+	public void test_ParamsArray_Multiple_OptionalChunks() throws Exception {
+
+		createArtistsDataSet();
+
+		List<Long> ids = SQLSelect
+				.scalarQuery(
+						Long.class,
+						"SELECT ARTIST_ID FROM ARTIST #chain('OR' 'WHERE') #chunk($a) ARTIST_NAME = #bind($a)
#end #chunk($b) ARTIST_NAME = #bind($b) #end #end ORDER BY ARTIST_ID")
+				.paramsArray(null, null, "artist2", "artist2").select(context);
+
+		assertEquals(1, ids.size());
+		assertEquals(2l, ids.get(0).longValue());
+	}
 }


Mime
View raw message