Jbpm 6.1.0.CR1: ProcessTest in sample Evaluation project throws nullpointer when running as junit test case in Eclipse
dleerob Aug 11, 2014 4:41 AMI downloaded and installed Jbpm 6.1.0.CR1 using the full installer, and installed the demo.
I imported the Evaluation project into Eclipse.
I ran the ProcessTest as a junit test case.
The console is showing the relevant output:
Process started ...
'krisv' completing task Self Evaluation: Please perform a self-evalutation.
'john' completing task PM Evaluation: You need to evaluate krisv.
'mary' completing task HR Evaluation: You need to evaluate krisv.
Process instance completed
However, the test case is failing, as a NullPointerException it thrown when the last line "manager.close();" is called. Stack Trace below:
ProcessTest
com.sample.ProcessTest
testEvaluationProcess(com.sample.ProcessTest)
java.lang.NullPointerException
at org.jbpm.process.audit.strategy.StandaloneJtaStrategy.getEntityManager(StandaloneJtaStrategy.java:36)
at org.jbpm.process.audit.JPAAuditLogService.getEntityManager(JPAAuditLogService.java:327)
at org.jbpm.process.audit.JPAAuditLogService.clear(JPAAuditLogService.java:300)
at org.jbpm.test.JbpmJUnitBaseTestCase.clearHistory(JbpmJUnitBaseTestCase.java:642)
at org.jbpm.test.JbpmJUnitBaseTestCase.tearDown(JbpmJUnitBaseTestCase.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Is anyone able to assist? Why is this line failing?