db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5252) make GrantRevokeTest pass in non-English locale
Date Mon, 30 May 2011 15:22:47 GMT

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

Bryan Pendleton commented on DERBY-5252:
----------------------------------------

Since there are only 4 calls to getMessage() in this test, perhaps it would be better to
leave the test running in the default locale (which can be any locale, not just English),
and change those 4 calls to getMessage().

We could either
(a) remove those 4 calls to getMessage entirely, or
(b) add some code like:

      if ( Locale.getDefault().getLanguage().equals("en") )
            assertEquals("'S1.NOSUCH' is not recognized as a procedure.", e.getMessage());

Since the test does a assertSQLState() right before each call to getMessage(), I don't
think that the getMessage() test is the most important part of the test, and maybe
a solution such as this would be fine?

However, I see those 4 getMessage() calls were specifically added in revision 765087 (
http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java?r1=765086&r2=765087&
)
as part of the fix for DERBY-3610.

Knut Anders, Dag: do you have any experience running your system in a locale other than English?
Does the GrantRevokeTest pass for you when run in a non-English locale? What do you think
about
the getMessage() assertions that were added by DERBY-3610? Would it be helpful to guard them
with some sort of locale-specific check?



> make GrantRevokeTest pass in non-English locale
> -----------------------------------------------
>
>                 Key: DERBY-5252
>                 URL: https://issues.apache.org/jira/browse/DERBY-5252
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>         Environment: Chinese Locale,Dos
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc11
>         Attachments: DERBY-5252-setlocale-just-testing.patch
>
>
> D:\derby\test>java junit.textui.TestRunner org.apache.derbyTesting.functionTests
> .tests.lang.GrantRevokeTest
> .......................F.F..F.F.........
> Time: 10.563
> There were 4 failures:
> 1) testGrantOnNonexistantFunction(org.apache.derbyTesting.functionTests.tests.la
> ng.GrantRevokeTest)junit.framework.ComparisonFailure: null expected:<'S1.NOSUCH'
>  [is not recognized as a function.]> but was:<'S1.NOSUCH' [未被识别为函数。]>
>         at org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeTest.test
> GrantOnNonexistantFunction(GrantRevokeTest.java:627)
>         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)
>         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)
>         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)
> 2) testGrantOnNonexistantFunctionForProcedure(org.apache.derbyTesting.functionTe
> sts.tests.lang.GrantRevokeTest)junit.framework.ComparisonFailure: null expected:
> <'S1.P1' [is not recognized as a function.]> but was:<'S1.P1' [未被识别为函数。]
> >
>         at org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeTest.test
> GrantOnNonexistantFunctionForProcedure(GrantRevokeTest.java:636)
>         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)
>         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)
>         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)
> 3) testGrantOnNonexistantProcedure(org.apache.derbyTesting.functionTests.tests.l
> ang.GrantRevokeTest)junit.framework.ComparisonFailure: null expected:<'S1.NOSUCH
> ' [is not recognized as a procedure.]> but was:<'S1.NOSUCH' [未被识别为过程。]>
>         at org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeTest.test
> GrantOnNonexistantProcedure(GrantRevokeTest.java:653)
>         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)
>         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)
>         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)
> 4) testGrantOnNonexistantProcedureForFunction(org.apache.derbyTesting.functionTe
> sts.tests.lang.GrantRevokeTest)junit.framework.ComparisonFailure: null expected:
> <'S1.F2' [is not recognized as a procedure.]> but was:<'S1.F2' [未被识别为过程。
> ]>
>         at org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeTest.test
> GrantOnNonexistantProcedureForFunction(GrantRevokeTest.java:662)
>         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)
>         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)
>         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: 36,  Failures: 4,  Errors: 0
> D:\derby\test>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message