[ https://issues.apache.org/jira/browse/CALCITE-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hong Shen updated CALCITE-3291: ------------------------------- Description: When I run mvn test, I find some testcase failed. {code} [ERROR] Tests run: 39, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.017 s <<< FAILURE! - in org.apache.calcite.test.SqlFunctionsTest [ERROR] testMd5(org.apache.calcite.test.SqlFunctionsTest) Time elapsed: 0.009 s <<< ERROR! java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' of org/apache/calcite/runtime/SqlFunctions.md5 must not be null at org.apache.calcite.test.SqlFunctionsTest.testMd5(SqlFunctionsTest.java:882) [ERROR] testSha1(org.apache.calcite.test.SqlFunctionsTest) Time elapsed: 0.007 s <<< ERROR! java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' of org/apache/calcite/runtime/SqlFunctions.sha1 must not be null at org.apache.calcite.test.SqlFunctionsTest.testSha1(SqlFunctionsTest.java:896) {/code} The code is {code} @Test public void testMd5() { assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(""))); assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(ByteString.of("", 16)))); assertThat("902fbdd2b1df0c4f70b4a5d23525e932", is(md5("ABC"))); assertThat("902fbdd2b1df0c4f70b4a5d23525e932", is(md5(new ByteString("ABC".getBytes(UTF_8))))); try { String o = md5((String) null); fail("Expected NPE, got " + o); } catch (NullPointerException e) { // ok } } {/code} It should catch java.lang.IllegalArgumentException, but not NullPointerException. I will add a patch to fix it. was: When I run mvn test, I find some testcase failed. {code} [ERROR] Tests run: 39, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.017 s <<< FAILURE! - in org.apache.calcite.test.SqlFunctionsTest [ERROR] testMd5(org.apache.calcite.test.SqlFunctionsTest) Time elapsed: 0.009 s <<< ERROR! java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' of org/apache/calcite/runtime/SqlFunctions.md5 must not be null at org.apache.calcite.test.SqlFunctionsTest.testMd5(SqlFunctionsTest.java:882) [ERROR] testSha1(org.apache.calcite.test.SqlFunctionsTest) Time elapsed: 0.007 s <<< ERROR! java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' of org/apache/calcite/runtime/SqlFunctions.sha1 must not be null at org.apache.calcite.test.SqlFunctionsTest.testSha1(SqlFunctionsTest.java:896) {/code} The code is {code} @Test public void testMd5() { assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(""))); assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(ByteString.of("", 16)))); assertThat("902fbdd2b1df0c4f70b4a5d23525e932", is(md5("ABC"))); assertThat("902fbdd2b1df0c4f70b4a5d23525e932", is(md5(new ByteString("ABC".getBytes(UTF_8))))); try { String o = md5((String) null); fail("Expected NPE, got " + o); } catch (NullPointerException e) { // ok } } {/code} It should catch java.lang.IllegalArgumentException, but not NullPointerException. I will add a patch to fix it. > SqlFunctionsTest failed > ----------------------- > > Key: CALCITE-3291 > URL: https://issues.apache.org/jira/browse/CALCITE-3291 > Project: Calcite > Issue Type: Test > Components: core > Reporter: Hong Shen > Priority: Minor > > When I run mvn test, I find some testcase failed. > {code} > [ERROR] Tests run: 39, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: > 0.017 s <<< FAILURE! - in org.apache.calcite.test.SqlFunctionsTest > [ERROR] testMd5(org.apache.calcite.test.SqlFunctionsTest) Time elapsed: > 0.009 s <<< ERROR! > java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' > of org/apache/calcite/runtime/SqlFunctions.md5 must not be null > at > org.apache.calcite.test.SqlFunctionsTest.testMd5(SqlFunctionsTest.java:882) > > [ERROR] testSha1(org.apache.calcite.test.SqlFunctionsTest) Time elapsed: > 0.007 s <<< ERROR! > java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' > of org/apache/calcite/runtime/SqlFunctions.sha1 must not be null > at > org.apache.calcite.test.SqlFunctionsTest.testSha1(SqlFunctionsTest.java:896) > {/code} > The code is > {code} > @Test public void testMd5() { > assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(""))); > assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(ByteString.of("", > 16)))); > assertThat("902fbdd2b1df0c4f70b4a5d23525e932", is(md5("ABC"))); > assertThat("902fbdd2b1df0c4f70b4a5d23525e932", > is(md5(new ByteString("ABC".getBytes(UTF_8))))); > try { > String o = md5((String) null); > fail("Expected NPE, got " + o); > } catch (NullPointerException e) { > // ok > } > } > {/code} > It should catch java.lang.IllegalArgumentException, but not > NullPointerException. I will add a patch to fix it. -- This message was sent by Atlassian Jira (v8.3.2#803003)