Re: [jgap-users] 3.2.2 Tests failing with Java 1.6
Brought to you by:
klausikm
From: Klaus M. <jg...@kl...> - 2007-10-18 09:27:44
|
Daniel, after somke investigations here is my final answer: Soem tests fail with Java 6 that don't fail with Java 5. The reason is the order in which the Map implementations in Java 6 store the elements. This order is different from Java 5. This is no fault but some unit tests rely on a specific order. The solution will be to avoid relying on order when coping with Map implementations. However, some logic uses Map's internally. This is more difficult to test. Once, there was a suggestion to use a third party Map implementation. I think we'll do this to avoid logic dependent on specific Java versions. So, to cut it short: JGAP works fine with Java 6 as there was never a bug report and the reason for the few failing unit tests (out of 1350 or so) is found. Best Klaus > -----Original Message----- > From: jga...@li... > [mailto:jga...@li...] On Behalf > Of Daniel Jue > Sent: Wednesday, October 17, 2007 7:54 AM > To: jga...@li... > Subject: [jgap-users] 3.2.2 Tests failing with Java 1.6 > > Hello list! I'm a new user of jgap. I tried to search > nabble regarding this problem, but I could only find posts relating to > 1.4/1.5 issues. Is jgap 3.2.2 compatible with Java 1.6? (Or > is some 3rd party lib not compatible?) > > Kindest Regards, > > Daniel Jue > > E:\lib\jgap\jgap_3.2.2_full>java -version java version "1.6.0_02" > Java(TM) SE Runtime Environment (build 1.6.0_02-b06) Java > HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing) > > Here is the error I get with the stock run_tests: > > > E:\lib\jgap\jgap_3.2.2_full>run_tests.bat > > E:\lib\jgap\jgap_3.2.2_full>java -cp > ".;lib\junit3.8.1.jar;lib\junit-addons-1.4. > jar;lib\log4j.jar;lib\commons-lang-2.1.jar;lib\commons-codec-1 .3.jar;jgap-tests. > jar;jgap.jar" junit.textui.TestRunner org.jgap.AllTests > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ......................................... > ..............................F.F.......... > ......................................... > ......................................... > ..F.F.F..................................... > ......................................... > ......................................... > ......................................F.F.. > F......................................... > ..............[Fatal Error] FILENAME_WRITE63169tmp:1:1: > Premature end of file. > ..... > Time: 2.391 > There were 8 failures: > 1) > testToString_4(org.jgap.impl.MapGeneTest)junit.framework.Compa risonFailure: e xpected:<...7.0,-55),(3,102.0...> but > was:<...3,102.0),(7.0,-55...> > at > org.jgap.impl.MapGeneTest.testToString_4(MapGeneTest.java:114) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 2) > testToString_5(org.jgap.impl.MapGeneTest)junit.framework.Compa risonFailure: e xpected:<...7.0,-55),(3,102.0...> but > was:<...3,102.0),(7.0,-55...> > at > org.jgap.impl.MapGeneTest.testToString_5(MapGeneTest.java:129) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 3) > testApplyMutation_0(org.jgap.impl.SetGeneTest)junit.framework. AssertionFailed > Error: expected:<true> but was:<false> > at > org.jgap.impl.SetGeneTest.testApplyMutation_0(SetGeneTest.java:253) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 4) > testApplyMutation_1(org.jgap.impl.SetGeneTest)junit.framework. AssertionFailed > Error: expected:<true> but was:<false> > at > org.jgap.impl.SetGeneTest.testApplyMutation_1(SetGeneTest.java:270) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 5) > testApplyMutation_2(org.jgap.impl.SetGeneTest)junit.framework. AssertionFailed > Error: expected:<true> but was:<false> > at > org.jgap.impl.SetGeneTest.testApplyMutation_2(SetGeneTest.java:287) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 6) > testSelect_1(org.jgap.impl.WeightedRouletteSelectorTest)junit. framework.Asser > tionFailedError: expected:<Size:4, Fitness value:10.0, > Alleles:[BooleanGene=null , BooleanGene=null, > BooleanGene=null, BooleanGene=null], Application data:null> > but was:<Size:2, Fitness value:11.0, > Alleles:[IntegerGene(-2147483648,2147483647 > )=null, IntegerGene(-2147483648,2147483647)=null], > Application data:null> > at > org.jgap.impl.WeightedRouletteSelectorTest.testSelect_1(WeightedRoule > tteSelectorTest.java:134) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 7) > testSelect_2(org.jgap.impl.WeightedRouletteSelectorTest)junit. framework.Asser > tionFailedError: expected:<Size:4, Fitness value:10.0, > Alleles:[BooleanGene=null , BooleanGene=null, > BooleanGene=null, BooleanGene=null], Application data:null> > but was:<Size:2, Fitness value:11.0, > Alleles:[IntegerGene(-2147483648,2147483647 > )=null, IntegerGene(-2147483648,2147483647)=null], > Application data:null> > at > org.jgap.impl.WeightedRouletteSelectorTest.testSelect_2(WeightedRoule > tteSelectorTest.java:186) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > 8) > testSelect_4(org.jgap.impl.WeightedRouletteSelectorTest)junit. framework.Asser > tionFailedError: expected:<Size:2, Fitness value:3.0, > Alleles:[IntegerGene(-2147 483648,2147483647)=null, > IntegerGene(-2147483648,2147483647)=null], Application > data:null> but was:<Size:3, Fitness value:2.0, > Alleles:[DoubleGene(-8.9884656743 > 11579E307,8.988465674311579E307)=null, > DoubleGene(-8.988465674311579E307,8.98846 > 5674311579E307)=null, > DoubleGene(-8.988465674311579E307,8.988465674311579E307)=n > ull], Application data:null> > at > org.jgap.impl.WeightedRouletteSelectorTest.testSelect_4(WeightedRoule > tteSelectorTest.java:283) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > FAILURES!!! > Tests run: 1331, Failures: 8, Errors: 0 > > > E:\lib\jgap\jgap_3.2.2_full>pause > Press any key to continue . . . > > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and > a browser. > Download your FREE copy of Splunk now >> > http://get.splunk.com/ _______________________________________________ > jgap-users mailing list > jga...@li... > https://lists.sourceforge.net/lists/listinfo/jgap-users |