# ignite-437: fix null test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c2d761a3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c2d761a3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c2d761a3 Branch: refs/heads/ignite-611 Commit: c2d761a35cb1fb89b77d421c18ab5e3e622d9a13 Parents: 94c3a90 Author: Artem Shutak <ashu...@gridgain.com> Authored: Fri Mar 20 19:02:10 2015 +0300 Committer: Artem Shutak <ashu...@gridgain.com> Committed: Fri Mar 20 19:02:10 2015 +0300 ---------------------------------------------------------------------- .../query/h2/sql/IgniteVsH2QueryTest.java | 25 ++++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2d761a3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java index c76c1e5..8085b20 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java @@ -451,6 +451,14 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest { return res; } + /** + * Do a smart setting of given object at statement. + * + * @param st Statment. + * @param idx Index. + * @param arg Argument. + * @throws SQLException If exception. + */ private void setObjectSmart(PreparedStatement st, int idx, Object arg) throws SQLException { if (arg == null) st.setNull(idx, Types.NULL); @@ -516,11 +524,18 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ - public void testPersonWIthNullLastName() throws Exception { - List<List<?>> rs = compareQueryRes0("select id from \"part\".Person where lastname = ?", null); - - // To ensure we found something (not 0). - assertEquals(1, rs.size()); + public void testParamSubstitution() throws Exception { + compareQueryRes0("select ? from \"part\".Person", "Some arg"); + } + + /** + * @throws Exception If failed. + */ + public void testNullParamSubstitution() throws Exception { + List<List<?>> rs1 = compareQueryRes0("select id from \"part\".Person where lastname is ?", null); + + // Ensure we find something. + assertNotSame(0, rs1.size()); } /**