[
https://issues.apache.org/jira/browse/DERBY-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030534#comment-13030534
]
Bryan Pendleton commented on DERBY-5217:
----------------------------------------
Hello Houx,
I'm not terribly familiar with how the ij tool performs its localization, so we
will have
to do some exploring of the code together.
It looks like org/apache/derby/iapi/tools/i18n/LocalizedResource.java is a very
important class for the ij localization support.
I think that the LocalizedResource gets set up in ij at about line 91 of
utilMain.java,
by this code:
LocalizedResource langUtil = LocalizedResource.getInstance();
Also, I see this interesting comment in LocalizedResource.java:
// Resets the 'local' field to null. This is not needed for normal
// operations, however, when executing sql files in our junit tests, we use
// the same jvm and thus the locale will get loaded only once, resulting
// in trouble when testing the localization for ij.
public static void resetLocalizedResourceCache()
{
local=null;
}
Perhaps ImportExportIJTest is not calling resetLocalizedResourceCache
when it should?
It looks like LocalizedResource has a useful toString() method that
will print out lots of information about the localization configuration.
Can you add some code to utilMain.java to do something like:
System.out.println("ij localization = " + langUtil.toString());
so we can see what localization the ij tool is using during the test?
thanks,
bryan
> 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-LocaleTestSetup.patch,
> DERBY-5217-SystemPropertyTestSetup.patch, DERBY-5217-log-locale.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