[ 
https://issues.apache.org/jira/browse/CALCITE-3604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16997553#comment-16997553
 ] 

Julian Hyde commented on CALCITE-3604:
--------------------------------------

The behavior of the code must not depend on the default locale. The solution is 
not to fix the test, it is to fix the code in main. Also, the error message 
should not include the names of classes.

Lastly, the commit message should be the same as the JIRA case summary.

> Tests fail caused by localized exception message
> ------------------------------------------------
>
>                 Key: CALCITE-3604
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3604
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>         Environment: OS: Windows7
> JDK: 1.8.0_121
> Locale: zh_CN
>            Reporter: Feng Zhu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When I fetch the recent master branch and build it, the tests added in 
> CALCITE-3552 fail.
> For example: *_SqlXmlFunctionsTest_*_#_*_testExtractValue_*
> {code:java}
> org.apache.calcite.test.SqlXmlFunctionsTest > testExtractValue() FAILED
>     java.lang.AssertionError: extractValue(<a>ccc<b>ddd</b></a>, #)
>     Expected: is org.apache.calcite.runtime.CalciteException: Illegal 
> behavior 'javax.xml.xpath.XPathExpressionException: 
> javax.xml.transform.TransformerException: A location path was expected, but 
> the following token was encountered:  #' EXTRACTVALUE: document: 
> '<a>ccc<b>ddd</b></a>', xpath expression: '#'
>          but: was <org.apache.calcite.runtime.CalciteException: Illegal 
> behavior 'javax.xml.xpath.XPathExpressionException: 
> javax.xml.transform.TransformerException: 需要位置路径, 但遇到以下标记: #' EXTRACTVALUE: 
> document: '<a>ccc<b>ddd</b></a>', xpath expression: '#'>
>         at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
>         at 
> org.apache.calcite.test.SqlXmlFunctionsTest.assertFailed(SqlXmlFunctionsTest.java:70)
>         at 
> org.apache.calcite.test.SqlXmlFunctionsTest.assertExtractValueFailed(SqlXmlFunctionsTest.java:61)
>         at 
> org.apache.calcite.test.SqlXmlFunctionsTest.testExtractValue(SqlXmlFunctionsTest.java:47)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to