db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4713) Subclasses of ScriptTestCase can not run correctly with the non-English default locale
Date Mon, 28 Jun 2010 10:02:11 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883092#action_12883092
] 

Knut Anders Hatlen commented on DERBY-4713:
-------------------------------------------

Thanks for the patch, Yun.

I don't think we lose expandability by doing this directly in ScriptTestCase (or perhaps better:
in its super-class CanonTestCase?), since we can always add a locale parameter to one of the
constructors if we need support for non-English locales later. That's the approach that was
taken for the input and output encoding. The advantage of doing it in ScriptTestCase is that
it will automatically be done correctly for tests we add later, even if the person who writes
the test forgets to wrap it in a LocaleTestSetup.

I'm curious to know why the new constructor in LocaleTestSetup was needed. Couldn't the existing
constructor be used with Locale.US as argument? I was thinking that preserving country and
variant of the default locale could mean that things like dates and numbers are formatted
differently, and that it would be more robust if we set all the components of the locale to
known values.

> Subclasses of ScriptTestCase can not run correctly with the non-English default locale
> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-4713
>                 URL: https://issues.apache.org/jira/browse/DERBY-4713
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>            Reporter: Yun Lee
>            Assignee: Yun Lee
>         Attachments: derby-4713.patch, derby-4713.stat
>
>
> If the default locale is not English, many subclasses of ScriptTestCase will fail. 
> For example, run NetIjTest (a subclass of ScriptTestcase)  in a Chinese OS, the test
case will fail:
> D:\derby\test>java junit.textui.TestRunner org.apache.derbyTesting.functionTests
> .tests.derbynet.NetIjTest
> .F
> Time: 5.422
> There was 1 failure:
> 1) testclientij(org.apache.derbyTesting.functionTests.tests.derbynet.NetIjTest)j
> unit.framework.ComparisonFailure: Output at line 34 expected:<[ERROR 42X05: Tabl
> e/View 'APP.NOTTHERE' does not exist.]> but was:<[?? 42X05??????APP.NOTTHERE????
> ?]>
>         at org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon
> (CanonTestCase.java:106)
>         at org.apache.derbyTesting.functionTests.util.ScriptTestCase.runTest(Scr
> iptTestCase.java:198)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
> 109)
>         at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>         at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>         at junit.extensions.TestSetup.run(TestSetup.java:27)
>         at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57
> )
>         at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>         at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>         at junit.extensions.TestSetup.run(TestSetup.java:27)
>         at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57
> )
>         at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>         at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>         at junit.extensions.TestSetup.run(TestSetup.java:27)
>         at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>         at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>         at junit.extensions.TestSetup.run(TestSetup.java:27)
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0 
> While, it succeed running with a English-language lcoale.
> D:\derby\test>java -Duser.language=en junit.textui.TestRunner org.apache.derbyTe
> sting.functionTests.tests.derbynet.NetIjTest
> .
> Time: 6.187
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message