Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6634

org.apache.harmony.text.tests.java.text.DateFormatTest.test_getDateTimeInstanceII fails on windows

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      windows xp sp3, 32bit, Simplified Chinese

      Description

      The reason is from java.text.DateFormat:
      public final static DateFormat getDateTimeInstance(int dateStyle,
      int timeStyle, Locale locale)

      { checkTimeStyle(timeStyle); checkDateStyle(dateStyle); com.ibm.icu.text.DateFormat icuFormat = com.ibm.icu.text.DateFormat.getDateTimeInstance(dateStyle, timeStyle, locale); return new SimpleDateFormat(locale, (com.ibm.icu.text.SimpleDateFormat)icuFormat); }

      If the value of dateStyle is DateFormat.LONG and the value of timeStyle is DateFormat.SHORT, the toPattern() method of SimpleDateFormat will lose one space character (' ') between the date part and the time part. But RI will pass the test by giving correct output.

      The stack trace is here:
      junit.framework.AssertionFailedError: Wrong default
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.assertTrue(Assert.java:20)
      at org.apache.harmony.text.tests.java.text.DateFormatTest.testDateTime(DateFormatTest.java:208)
      at org.apache.harmony.text.tests.java.text.DateFormatTest.test_getDateTimeInstanceII(DateFormatTest.java:230)
      at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
      at java.lang.reflect.Method.invoke(Method.java:316)
      at junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:466)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lucaca Jonathan Lu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: