[rules-users] JUnit testing problem

J Michael Dean mdean77 at comcast.net
Sun Dec 30 11:44:55 EST 2007


Continuing to have problems - can use Drools in RCP but when I try to  
JUnit test, I cannot instantiate a PackageBuilder.  With the following  
code fragment:

	@BeforeClass
	public static void setUp() throws Exception {
		Reader source;
		PackageBuilderConfiguration pkgConfig = new  
PackageBuilderConfiguration();
		JavaDialectConfiguration javaDialectConf =  
(JavaDialectConfiguration) pkgConfig.getDialectConfiguration("java");
		javaDialectConf.setCompiler(JavaDialectConfiguration.ECLIPSE);
		
		if (pkgConfig == null) {
			System.out.println("Error - null package configuration");
		} else {
			System.out.println("Package configuration is not null"); // NOTE  
THAT THIS EXECUTES SO NOT NULL
		}
		final PackageBuilder builder = new PackageBuilder(pkgConfig); //  
CRASH OCCURS IN THIS LINE OF CODE


I get the following trace:

Package configuration is not null
java.lang.NullPointerException
	at  
org.mvel.optimizers.OptimizerFactory.<clinit>(OptimizerFactory.java:43)
	at  
org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java: 
142)
	at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
	at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:146)
	at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:108)
	at  
droolsRules.tests.AllDroolsRulesTests.setUp(AllDroolsRulesTests.java:49)
	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:585)
	at  
org 
.junit 
.internal 
.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
	at  
org 
.junit 
.internal 
.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
	at  
org 
.junit 
.internal 
.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
	at  
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
	at  
org 
.eclipse 
.jdt 
.internal 
.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
	at  
org 
.eclipse 
.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at  
org 
.eclipse 
.jdt 
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java: 
460)
	at  
org 
.eclipse 
.jdt 
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java: 
673)
	at  
org 
.eclipse 
.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java: 
386)
	at  
org 
.eclipse 
.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java: 
196)
[MVEL] Notice: Possible incorrect version of ASM present (3.0  
required).  Disabling JIT compiler.  Reflective Optimizer will be used.

I had similar issue a number of weeks ago that never resolved, but  
subsequently have upgraded Eclipse to 3.3.2, running on OSX Leopard.   
I cannot locate a ASM library and obviously the error message is  
hinting at that.

Any assistance will be appreciated.  I hate proceeding without JUnit  
testing in place.

- Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071230/3bcab380/attachment.html 


More information about the rules-users mailing list