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 Houx Zhang <ho...@gmail.com> on 2011/03/26 16:15:42 UTC

how to deal with test failure in Chinese locale

Hi, all. When I ran
org.apache.derbyTesting.functionTests.tests.tools._Suite, I found 11
failure. i.e. for SysinfoCPCheckTest, I've got error message below:

D:\derby\test>java junit.textui.TestRunner
org.apache.derbyTesting.functionTests
.tests.tools.SysinfoCPCheckTest
.F
Time: 0.265
There was 1 failure:
1)
testClassPathChecker(org.apache.derbyTesting.functionTests.tests.tools.Sysinf
oCPCheckTest)junit.framework.ComparisonFailure: null expected:<[Testing for
pres
ence of all Derby-related libraries; typically, only some are needed.]> but
was:
<[测试所有与 Derby 相关的库是否存在;通常只需要其中的某些库。]>
        at
org.apache.derbyTesting.functionTests.tests.tools.SysinfoCPCheckTest.
testClassPathChecker(SysinfoCPCheckTest.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
112)

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0

I seems derby testing can not work well in Chinese Locale, maybe all other
nonEnglish locales. Following the Derby wiki,  I have tried to use
"LocaleTestSetup' to decorate the test case in Locale.English and it pass
successfully!

As mentioned above, there are still some more testcases (maybe a lot of) can
not work in nonEnglish locale. How to deal with this problem? A not so smart
method is to decorate them individually in Locale.English, maybe a better
method is to add a decoration into the root of the regression test or add a
new system property to resolve it thoroughly.

Wish for your reply, thanks!

Regards
-- 
Houx Zhang

Re: how to deal with test failure in Chinese locale

Posted by Houx Zhang <ho...@gmail.com>.
Hi, Kathey. Thanks for your encourage.  I have  created Derby-5515 to focus
on this issue.

在 2011年3月27日 上午12:56,Kathey Marsden <km...@sbcglobal.net>写道:

>
> As for a system property, try running with -Duser.language=en and see if
> the test passes.
> I thought as you suggest we had something in setup to force the right
> language but obviously we do not. The only related issue I see on a
> quick search of Jira is
> https://issues.apache.org/jira/browse/DERBY-4260. Special handling may
> be needed for spawned processes.
>
> Making the Junit tests pass regardless of the user locale would be a
> great part of a GSoC project.
> Perhaps there is an issue for this, that I am just missing.
>
> KAthey
>
>
>


-- 
Houx Zhang

Re: how to deal with test failure in Chinese locale

Posted by Kathey Marsden <km...@sbcglobal.net>.
On 3/26/2011 8:15 AM, Houx Zhang wrote:
> Hi, all. When I ran
> org.apache.derbyTesting.functionTests.tests.tools._Suite, I found 11
> failure. i.e. for SysinfoCPCheckTest, I've got error message below:
>
> D:\derby\test>java junit.textui.TestRunner
> org.apache.derbyTesting.functionTests
> .tests.tools.SysinfoCPCheckTest
> .F
> Time: 0.265
> There was 1 failure:
> 1)
> testClassPathChecker(org.apache.derbyTesting.functionTests.tests.tools.Sysinf
> oCPCheckTest)junit.framework.ComparisonFailure: null
> expected:<[Testing for pres
> ence of all Derby-related libraries; typically, only some are
> needed.]> but was:
> <[测试所有与 Derby 相关的库是否存在;通常只需要其中的某些库。]>
> at org.apache.derbyTesting.functionTests.tests.tools.SysinfoCPCheckTest.
> testClassPathChecker(SysinfoCPCheckTest.java:157)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
> 112)
>
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0
>
> I seems derby testing can not work well in Chinese Locale, maybe all
> other nonEnglish locales. Following the Derby wiki, I have tried to
> use "LocaleTestSetup' to decorate the test case in Locale.English and
> it pass successfully!
>
> As mentioned above, there are still some more testcases (maybe a lot
> of) can not work in nonEnglish locale. How to deal with this problem?
> A not so smart method is to decorate them individually in
> Locale.English, maybe a better method is to add a decoration into the
> root of the regression test or add a new system property to resolve it
> thoroughly.
>
As for a system property, try running with -Duser.language=en and see if
the test passes.
I thought as you suggest we had something in setup to force the right
language but obviously we do not. The only related issue I see on a
quick search of Jira is
https://issues.apache.org/jira/browse/DERBY-4260. Special handling may
be needed for spawned processes.

Making the Junit tests pass regardless of the user locale would be a
great part of a GSoC project.
Perhaps there is an issue for this, that I am just missing.

KAthey