You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Hong Shen (Jira)" <ji...@apache.org> on 2019/08/27 07:32:00 UTC

[jira] [Closed] (CALCITE-3291) SqlFunctionsTest failed

     [ https://issues.apache.org/jira/browse/CALCITE-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hong Shen closed CALCITE-3291.
------------------------------
    Resolution: Won't Fix

When run testcase SqlFunctionsTest in IDEA, it failed with java.lang.IllegalArgumentException. but when  run mvn clean test again, the testcase SqlFunctionsTest successed. Maybe it's not a bug.



> 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
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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)