[rules-dev] Several unit tests failed under JDK1.6

Jervis Liu jliu at redhat.com
Fri Aug 29 07:35:05 EDT 2008


Hi, I have tested our 
https://svn.jboss.org/repos/labs/labs/jbossrules/soa_tags/4.3.0.GA_IR1/ 
   branch against JDK1.6. There are several tests failed, detailed can 
be found on https://jira.jboss.org/jira/browse/SOA-714.

These failures are in three modules:

1. drools-compiler: DynamicRulesTest.testDynamicFunction

This might be related to classloader. See Mark Proctor's comments:

(4:39:06 PM) conan: jliu: the drools complier one is probably related to 
the need for any classloaders to do forName instead of loadClass
(4:39:11 PM) conan: fo you have the stack trace for it?
(4:40:42 PM) jliu: (4:40:28 PM) jervisliu: 
java.lang.NoClassDefFoundError: org/drools/test/AddFive
(4:40:42 PM) jliu: 	at 
org.drools.test.Rule_global_rule_test_0.consequence(Rule_global_rule_test_0.java:7)
(4:40:42 PM) jliu: 	at 
org.drools.test.Rule_global_rule_test_0ConsequenceInvoker.evaluate(Rule_global_rule_test_0ConsequenceInvoker.java:20)
(4:40:42 PM) jliu: 	at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
(4:40:42 PM) jliu: 	at 
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
(4:40:42 PM) jliu: 	at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
(4:40:42 PM) jliu: 	at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
(4:40:42 PM) jliu: 	at 
org.drools.integrationtests.DynamicRulesTest.testDynamicFunction(DynamicRulesTest.java:311)
(4:40:42 PM) jliu: 	at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
(4:40:42 PM) jliu: 	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
(4:40:42 PM) jliu: 	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
(4:40:42 PM) jliu: 	at java.lang.reflect.Method.invoke(Method.java:597)
(4:40:42 PM) jliu: 	at junit.framework.TestCase.runTest(TestCase.java:154)
(4:40:42 PM) jliu: 	at junit.framework.TestCase.runBare(TestCase.java:127)
(4:40:42 PM) jliu: 	at 
junit.framework.TestResult$1.protect(TestResult.java:106)
(4:40:42 PM) jliu: 	at 
junit.framework.TestResult.runProtected(TestResult.java:124)
(4:40:42 PM) jliu: 	at junit.framework.TestResult.run(TestResult.java:109)
(4:40:42 PM) jliu: 	at junit.framework.TestCase.run(TestCase.java:118)
(4:40:42 PM) jliu: 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
(4:40:42 PM) jliu: 	at junit.framework.TestSuite.run(TestSuite.java:203)
(4:40:42 PM) jliu: 	at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
(4:40:42 PM) jliu: 	at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
(4:40:42 PM) jliu: 	at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
(4:40:42 PM) jliu: 	at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
(4:40:42 PM) jliu: 	at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
(4:40:42 PM) jliu: 	at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
(4:41:29 PM) jliu: conan: yes, i guess its sth to do with the 
classloader, so maybe JBRULES-1666 has not been fixed yet. at least on 
this branch.
(4:43:08 PM) jliu: conan: for ur information, this DynamicRulesTest 
passed on the trunk. but there are 4 other failures under jdk1.6 in the 
compiler module
(4:43:48 PM) conan: jliu:yes something changed in jdk1.6 that made the 
classloaders more strict.
(4:44:43 PM) conan: jliu: in jdk1.5 I could tell it to load a clas that 
didn't exist and it would correctly fail, i'd then add the class to the 
classloader and it woudl pass - it's almost like jdk1.6 caches that 
failure result, so that it doesn't bother to lookup the class we just added.

I have replaced all loadClass stuff with forName. but this didnt help. I 
will continue my investigation next Mondy, but if there is someone who 
is more familiar with this please feel free to take over this.

2. drools-repository: this seems to be related to 
org.tmatesoft.svn.core.SVNException. Havnt got time to look into this yet.

3. drools-jbrms: I will look into these problems.
But again, if anyone else knows the problem, please feel free to stand 
out ;-)

Thanks,
Jervis



More information about the rules-dev mailing list