You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Lev Assinovsky <le...@peterlink.ru> on 2002/03/12 15:12:59 UTC

[collections] Tests failed with jdk1.4 and 1.3.1

Hello!

May be I was doing something wrong but the collections tests failed. :(

(compilation was fine).

I tried two JDK: 1.4 and 1.3.1.

The results were different!

ant is of 1.4, junit3.7 (I didn't find 3.2+)

jdk1.4 results:

---------------- cut here --------------------------------

test:
     [java] Forking /hdc2/archive/j2sdk1.4.0/jre/../bin/java -classpath /hdc2/archive/Jakarta/jakarta-commons/collections/dist
/classes:/archive/junit3.7/junit.jar:/archive/jakarta-ant-1.4.1/lib/xalan.jar:/archive/jakarta-ant-1.4.1/lib/jaxp.jar:/archive
/jakarta-ant-1.4.1/lib/jakarta-ant-1.4.1-optional.jar:/archive/jakarta-ant-1.4.1/lib/crimson.jar:/archive/jakarta-ant-1.4.1/li
b/ant.jar:/opt/j2sdk1.4.0/lib/tools.jar junit.textui.TestRunner org.apache.commons.collections.TestAll
     [java] .........................................
     [java] ......................................E..F.
     [java] F.F........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] ............F........F.....................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] ..........
     [java] Time: 13.193
     [java] There was 1 error:
     [java] 1) testContainsValue(org.apache.commons.collections.TestBeanMap)
     [java] java.lang.ClassCastException: java.lang.String
     [java]     at java.util.AbstractMap.containsValue(AbstractMap.java:107)
     [java]     at org.apache.commons.collections.BeanMap.containsValue(Unknown Source)
     [java]     at org.apache.commons.collections.TestMap.testContainsValue(Unknown Source)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
     [java] There were 5 failures:
     [java] 1) testEntrySetContainsProperMappings(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedEr
ror: entrySet().contains(Object) must return true when map contains the mapping expected:<true> but was:<false>
     [java]     at org.apache.commons.collections.TestMap.testEntrySetContainsProperMappings(Unknown Source)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
     [java] 2) testEntrySetIterator(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: Objects r
eturned from entrySet().iterator() must be instances of Map.Entry.
     [java]     at org.apache.commons.collections.TestMap.testEntrySetIterator(Unknown Source)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
     [java] 3) testEntrySetIteratorRemove(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: ite
rator should throw UnsupportedOperationException if remove is not allowed from the entrySet().iterator()
     [java]     at org.apache.commons.collections.TestMap.testEntrySetIteratorRemove(Unknown Source)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
     [java] 4) testIterator(org.apache.commons.collections.TestHashBag)junit.framework.AssertionFailedError: First should be '
A' expected:<A> but was:<B>
     [java]     at org.apache.commons.collections.TestBag.testIterator(Unknown Source)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
     [java]
     [java] FAILURES!!!
     [java] Tests run: 748,  Failures: 5,  Errors: 1
     [java]
---------------------------------- cut here ---------------------------

Now the results of jdk1.3.1:

------------------------------ cut here -------------------------------

test:
     [java] Forking /archive/jdk1.3.1_02/jre/../bin/java -classpath /archive/commons-collections/dist/classes:/archive/junit3.7/junit.jar:/archive/jakar
a-ant-1.4.1/lib/jaxp.jar:/archive/jakarta-ant-1.4.1/lib/crimson.jar:/archive/jakarta-ant-1.4.1/lib/ant.jar:/archive/jdk1.3.1_02/lib/tools.jar junit.text
i.TestRunner org.apache.commons.collections.TestAll
     [java] .........................................
     [java] ......................................E..F.
     [java] F.F........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] ..........
     [java] Time: 9.651
     [java] There was 1 error:
     [java] 1) testContainsValue(org.apache.commons.collections.TestBeanMap)
     [java] java.lang.ClassCastException: java.lang.String
     [java]     at java.util.AbstractMap.containsValue(AbstractMap.java:107)
     [java]     at org.apache.commons.collections.BeanMap.containsValue(Unknown Source)
     [java]     at org.apache.commons.collections.TestMap.testContainsValue(Unknown Source)
     [java] There were 3 failures:
     [java] 1) testEntrySetContainsProperMappings(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: entrySet().contains(O
ject) must return true when map contains the mapping expected:<true> but was:<false>
     [java]     at org.apache.commons.collections.TestMap.testEntrySetContainsProperMappings(Unknown Source)
     [java] 2) testEntrySetIterator(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: Objects returned from entrySet().it
rator() must be instances of Map.Entry.
     [java]     at org.apache.commons.collections.TestMap.testEntrySetIterator(Unknown Source)
     [java] 3) testEntrySetIteratorRemove(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: iterator should throw Unsuppo
tedOperationException if remove is not allowed from the entrySet().iterator()
     [java]     at org.apache.commons.collections.TestMap.testEntrySetIteratorRemove(Unknown Source)
     [java]
     [java] FAILURES!!!
     [java] Tests run: 748,  Failures: 3,  Errors: 1
     [java]

-------------------------- cut here ----------------------------------------

Actually my intention was to use dbcp, that's why I got nightly

--
Lev Assinovsky                Peterlink Web
Programmer                    St. Petersburg, Russia
Tel/Fax: +7 812 3275343       197022 ul.Chapigina 7а
E-mail: lev@peterlink.ru




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] Tests failed with jdk1.4 and 1.3.1

Posted by "Michael A. Smith" <mi...@iammichael.org>.
On Tue, 12 Mar 2002, Lev Assinovsky wrote:
> Thanks, Michael!
> But what about that exception
>      [java] 1) testContainsValue(org.apache.commons.collections.TestBeanMap)
>      [java] java.lang.ClassCastException: java.lang.String
> What is that?

Haven't had a change to look extensively yet, but I'm guessing something
in either the test or in BeanMap is assuming all the values are the same
type, and they aren't.

> Does it affect DBCP?

DBCP does not use BeanMap as far as I know.

regards,
michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] Tests failed with jdk1.4 and 1.3.1

Posted by Lev Assinovsky <le...@peterlink.ru>.
Thanks, Michael!
But what about that exception
     [java] 1) testContainsValue(org.apache.commons.collections.TestBeanMap)
     [java] java.lang.ClassCastException: java.lang.String
What is that?
Does it affect DBCP?


"Michael A. Smith" wrote:

> On Tue, 12 Mar 2002, Lev Assinovsky wrote:
> >      [java] There were 5 failures:
>
> that's weird, there are only 4 failures listed.
>
> >      [java] 1) testEntrySetContainsProperMappings(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedEr
> > ror: entrySet().contains(Object) must return true when map contains the mapping expected:<true> but was:<false>
> >      [java]     at org.apache.commons.collections.TestMap.testEntrySetContainsProperMappings(Unknown Source)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
> >      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
> >      [java] 2) testEntrySetIterator(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: Objects r
> > eturned from entrySet().iterator() must be instances of Map.Entry.
> >      [java]     at org.apache.commons.collections.TestMap.testEntrySetIterator(Unknown Source)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
> >      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
> >      [java] 3) testEntrySetIteratorRemove(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: ite
> > rator should throw UnsupportedOperationException if remove is not allowed from the entrySet().iterator()
> >      [java]     at org.apache.commons.collections.TestMap.testEntrySetIteratorRemove(Unknown Source)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
> >      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
>
> These first three are the same for jdk 1.3, and are known problems.  I've
> been trying to get to them, but have been swamped with other stuff and
> haven't had the chance yet.
>
> >      [java] 4) testIterator(org.apache.commons.collections.TestHashBag)junit.framework.AssertionFailedError: First should be '
> > A' expected:<A> but was:<B>
> >      [java]     at org.apache.commons.collections.TestBag.testIterator(Unknown Source)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
> >      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
>
> I've seen this as well, and is actually a bad test.  The test is iterating
> over the results and expecting a certain order, however "hash" based
> collections usually do not guaruntee a particular ordering.  In this case,
> the hashing behavior between JDK 1.3 and JDK 1.4 is different so the
> iterator is returning the elements in a different order (thus the test
> fails).
>
> >      [java]
> >      [java] FAILURES!!!
> >      [java] Tests run: 748,  Failures: 5,  Errors: 1
>
> there's that 5 again, but I only saw 4 listed...
>
> [snip]
> > Actually my intention was to use dbcp, that's why I got nightly
>
> The above test failures shouldn't effect dbcp.
>
> regards,
> michael
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Lev Assinovsky                Peterlink Web
Programmer                    St. Petersburg, Russia
Tel/Fax: +7 812 3275343       197022 ul.Chapigina 7а
E-mail: lev@peterlink.ru




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] Tests failed with jdk1.4 and 1.3.1

Posted by "Michael A. Smith" <mi...@iammichael.org>.
On Tue, 12 Mar 2002, Lev Assinovsky wrote:
>      [java] There were 5 failures:

that's weird, there are only 4 failures listed.  

>      [java] 1) testEntrySetContainsProperMappings(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedEr
> ror: entrySet().contains(Object) must return true when map contains the mapping expected:<true> but was:<false>
>      [java]     at org.apache.commons.collections.TestMap.testEntrySetContainsProperMappings(Unknown Source)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
>      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
>      [java] 2) testEntrySetIterator(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: Objects r
> eturned from entrySet().iterator() must be instances of Map.Entry.
>      [java]     at org.apache.commons.collections.TestMap.testEntrySetIterator(Unknown Source)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
>      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
>      [java] 3) testEntrySetIteratorRemove(org.apache.commons.collections.TestBeanMap)junit.framework.AssertionFailedError: ite
> rator should throw UnsupportedOperationException if remove is not allowed from the entrySet().iterator()
>      [java]     at org.apache.commons.collections.TestMap.testEntrySetIteratorRemove(Unknown Source)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
>      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)

These first three are the same for jdk 1.3, and are known problems.  I've 
been trying to get to them, but have been swamped with other stuff and 
haven't had the chance yet.

>      [java] 4) testIterator(org.apache.commons.collections.TestHashBag)junit.framework.AssertionFailedError: First should be '
> A' expected:<A> but was:<B>
>      [java]     at org.apache.commons.collections.TestBag.testIterator(Unknown Source)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
>      [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)

I've seen this as well, and is actually a bad test.  The test is iterating 
over the results and expecting a certain order, however "hash" based 
collections usually do not guaruntee a particular ordering.  In this case, 
the hashing behavior between JDK 1.3 and JDK 1.4 is different so the 
iterator is returning the elements in a different order (thus the test 
fails).  

>      [java]
>      [java] FAILURES!!!
>      [java] Tests run: 748,  Failures: 5,  Errors: 1

there's that 5 again, but I only saw 4 listed...

[snip]
> Actually my intention was to use dbcp, that's why I got nightly

The above test failures shouldn't effect dbcp. 

regards,
michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>