Am 29.04.2011 23:00, schrieb Henri Yandell:
Oops - I built on 1.6 and should have built on 1.5. I'll rebuild from
the tag and see if I get the error you get.

Hen

Sorry, still no luck, I get the same error. The test case only fails if the test class is executed as a whole. It succeeds if it is executed standalone. In the latter case a format object is newly created while it is obtained from the cache in the former case.

I assume that the problem has something to do with the fact that my default locale is German which is also used explicitly by some of the tests. It seems that JDK 1.5 creates a new Locale instance when the default locale is changed. Thus the format object checked by the test has a German locale, but it is not the same instance as passed to the assertSame() condition.

I suggest changing the test to use assertEquals() rather than assertSame(). This works in any case and should be a condition strong enough.

Oliver


On Fri, Apr 29, 2011 at 12:46 PM, Oliver Heger
<oliver.he...@oliver-heger.de>  wrote:
When building with Java 1.5 I get a strange test error:

-------------------------------------------------------------------------------
Test set: org.apache.commons.lang3.time.FastDateFormatTest
-------------------------------------------------------------------------------
Tests run: 15, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.136 sec
<<<  FAILURE!
test_getInstance_String_Locale(org.apache.commons.lang3.time.FastDateFormatTest)
  Time elapsed: 0.007 sec<<<  FAILURE!
junit.framework.AssertionFailedError: expected same:<de_DE>  was not:<de_DE>
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.failNotSame(Assert.java:273)
        at junit.framework.Assert.assertSame(Assert.java:236)
        at junit.framework.Assert.assertSame(Assert.java:243)
        at
org.apache.commons.lang3.time.FastDateFormatTest.test_getInstance_String_Locale(FastDateFormatTest.java:99)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:592)
        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.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:592)
        at
org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at $Proxy0.invoke(Unknown Source)
        at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
        at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

The build with JDK 1.6 does not have this problem. My specific Java version
is
java version "1.5.0_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_21-b01)
Java HotSpot(TM) Client VM (build 1.5.0_21-b01, mixed mode, sharing)

OS is Windows 7. Does anybody else see this error?

Oliver

Am 29.04.2011 08:47, schrieb Henri Yandell:

Lang is ready to consider 3.0 release again.

RC3 is available here:

  http://people.apache.org/~bayard/commons-lang3-3.0-RC3/

Maven artifacts:

  http://people.apache.org/~bayard/commons-lang3-3.0-RC3/maven/

Website:

  http://people.apache.org/~bayard/commons-lang3-3.0-RC3/site/

Note that there is a 2.6->3.0 Clirr report in the site that may prove
useful:


  
http://people.apache.org/~bayard/commons-lang3-3.0-RC3/site/lang2-lang3-clirr--report.html

This vote will close no sooner than in 72 hours time, 0700 GMT 2-May 2011.

================
    [ ] +1
    [ ] -1, with reason
================

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to