[
https://issues.apache.org/jira/browse/DERBY-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-5217:
--------------------------------------
Attachment: d5217-resetLocalizedResourceCache.diff
I see that Bryan suggested using
LocalizedResource.resetLocalizedResourceCache() to get IJ to pick up the
changes in the locale. I'm not sure if you've tried that already, but it looks
like it's doing the right thing.
I made an attempt with calling that method in ScriptTestCase's setUp() and
tearDown() methods. This seemed to take care of changing the language of IJ's
messages. The error messages from the Derby engine still used the wrong
language, since the language of those messages seems to be determined when the
database is created, which could happen before ImportExportIJTest runs. To
address that, I wrapped ImportExportIJTest in a LocaleTestSetup and made the
test create a fresh database instead of using the default test database. With
these changes (see the attached patch d5217-resetLocalizedResourceCache.diff),
the full tools suite ran without failures in my environment with the locale set
to zh_CN.UTF-8.
> make ImportExportIJTest pass in non-English locale
> --------------------------------------------------
>
> Key: DERBY-5217
> URL: https://issues.apache.org/jira/browse/DERBY-5217
> Project: Derby
> Issue Type: Sub-task
> Components: Test
> Reporter: Houx Zhang
> Assignee: Houx Zhang
> Labels: gsoc2011
> Attachments: DERBY-5217-1.patch, DERBY-5217-LocaleTestSetup.patch,
> DERBY-5217-StandardException.patch, DERBY-5217-SystemPropertyTestSetup.patch,
> DERBY-5217-log-LocalizedResource.patch, DERBY-5217-log-locale.patch,
> DERBY-5217-log-setMessageLocale-DOS.txt,
> DERBY-5217-log-setMessageLocale-eclipse.txt,
> DERBY-5217-log-setMessageLocale.patch,
> d5217-resetLocalizedResourceCache.diff, morePrints.txt,
> output-for-more-prints.txt, setDerbyUILocale.patch
>
>
> ImportExportIJTest fails in Chinese locale, just like below:
> D:\derby\test>java junit.textui.TestRunner
> org.apache.derbyTesting.functionTests
> .tests.tools.ImportExportIJTest
> .F
> Time: 7.937
> There was 1 failure:
> 1)
> importExportIJ(org.apache.derbyTesting.functionTests.tests.tools.ImportExport
> IJTest)junit.framework.ComparisonFailure: Output at line 22 expected:<ERROR
> 42Y5
> 5: ['DROP TABLE' cannot be performed on 'T1' because it does not exist.]> but
> wa
> s:<ERROR 42Y55: [?DROP TABLE?????T1????????????]>
> at
> org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon
> (CanonTestCase.java:109)
> at
> org.apache.derbyTesting.functionTests.util.ScriptTestCase.runTest(Scr
> iptTestCase.java:201)
> at
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
> 112)
> 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)
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira