db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5414) SysDiagVTIMappingTest.test_5391() failed: java.text.ParseException: Unparseable date: "Thu Sep 15 14:00:16 CEST 2011"
Date Fri, 16 Sep 2011 10:54:09 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-5414:
--------------------------------------

    Attachment: d5414.diff

I'm able to reproduce these failures on Solaris too when I run the test in a non-English locale
(for example: nn_NO.UTF-8, de_DE.UTF-8, ja_JP.eucJP).

The problem seems to be that a SimpleDateFormat instance is used to parse the time strings,
and that instance uses the default system locale. The time strings are however created by
java.util.Date.toString(), which always creates the time strings in the US locale.

The attached patch fixes the failures by creating the SimpleDateFormat instances with locale
explicitly set to Locale.US.

Another question is of course whether it is OK that the timestamp is always in English, or
if it should be localized, or perhaps printed in some standard format that doesn't use names
of days/months at all. But to fix the immediate problem (that the test and the VTI don't manage
to parse the dates), I think the patch is sufficient.

> SysDiagVTIMappingTest.test_5391() failed: java.text.ParseException: Unparseable date:
"Thu Sep 15 14:00:16 CEST 2011"
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5414
>                 URL: https://issues.apache.org/jira/browse/DERBY-5414
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.2.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d5414.diff
>
>
> Seen when testing the 10.8.2.1 release candidate on Windows 7:
> http://dbtg.foundry.sun.com/derby/test/10.8.2.1_RC/logs/jvm1.6/win7/suitesAll/report.txt
> There were 2 errors:
> 1) test_5391(org.apache.derbyTesting.functionTests.tests.lang.SysDiagVTIMappingTest)java.text.ParseException:
Unparseable date: "Thu Sep 15 14:00:16 CEST 2011"
> 	at java.text.DateFormat.parse(DateFormat.java:337)
> 	at org.apache.derbyTesting.functionTests.tests.lang.SysDiagVTIMappingTest.vetTimestamp(SysDiagVTIMappingTest.java:744)
> 	at org.apache.derbyTesting.functionTests.tests.lang.SysDiagVTIMappingTest.test_5391(SysDiagVTIMappingTest.java:728)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	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:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 2) test_5391(org.apache.derbyTesting.functionTests.tests.lang.SysDiagVTIMappingTest)java.text.ParseException:
Unparseable date: "Thu Sep 15 14:00:16 CEST 2011"
> 	at java.text.DateFormat.parse(DateFormat.java:337)
> 	at org.apache.derbyTesting.functionTests.tests.lang.SysDiagVTIMappingTest.vetTimestamp(SysDiagVTIMappingTest.java:744)
> 	at org.apache.derbyTesting.functionTests.tests.lang.SysDiagVTIMappingTest.test_5391(SysDiagVTIMappingTest.java:728)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	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:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	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:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)

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

        

Mime
View raw message