You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Bryan Pendleton (JIRA)" <ji...@apache.org> on 2011/06/04 16:33:47 UTC

[jira] [Commented] (DERBY-5217) make ImportExportIJTest pass in non-English locale

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

Bryan Pendleton commented on DERBY-5217:
----------------------------------------

Perhaps we could change LocaleTestSetup as follows:

Index: java/testing/org/apache/derbyTesting/junit/LocaleTestSetup.java
===================================================================
--- java/testing/org/apache/derbyTesting/junit/LocaleTestSetup.java	(revision 1131297)
+++ java/testing/org/apache/derbyTesting/junit/LocaleTestSetup.java	(working copy)
@@ -47,6 +47,9 @@
         (new java.security.PrivilegedAction() {
             public Object run() {
             	Locale.setDefault(newLocale);
+                System.getProperties().setProperty(
+                        "derby.ui.locale",
+                        newLocale.getLanguage());
                 return null;
             }
         }

The idea is that, whenever LocaleTestSetup sets the JDK Locale in a certain way,
it should also set the derby.ui.locale to the same setting.

Perhaps the differing results that you are seeing in different configurations has
to do with whether derby.ui.locale is set in the test or not? I think that the software
checks both the system locale and the derby.ui.locale variable, so if we set
one, we should set both.


> 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-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, morePrints.txt, output-for-more-prints.txt
>
>
> 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