cancel
Showing results for 
Search instead for 
Did you mean: 

5.0.beta1 Activiti Examples (Test Cases) FAILED in Grails

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi,

Majority of the Activiti Examples Test Cases FAILED due to error NullPointerException for runtimeService variable in Grails environment. But this problem only happened in Activiti 5.0.beta1 not 5.0.alpha4 (All tests PASSED). Currently, this issue is blocking the release of Grails Activiti Plugin 5.0.beta1.

It seems like the processEngine variable not initiated properly in ProcessEngineTestCase super class related to loading of activiti.properties file. It is obvious to me that it is environment issue. But I not sure how to fix it. Anyone here have any clue how to solve this problem?

You can download both Activiti Examples 5.0.beta1 and Activiti Examples 5.0.alpha4 at http://code.google.com/p/grails-activiti-plugin/downloads/detail?name=activiti-examples-beta1.zip and http://code.google.com/p/grails-activiti-plugin/downloads/detail?name=activiti-examples-alpha4.zip. You need Grails 1.3.4 installed (can be downloaded at http://grails.org/Download) to run the application (command: "grails test-app unit:")

Below is test result for Activiti Examples 5.0.beta1 for your reference:
Running 37 unit tests…
Running test org.activiti.examples.bpmn.receivetask.ReceiveTaskTest…
                    testWaitStateBehavior…FAILED
Running test org.activiti.examples.bpmn.gateway.ExclusiveGatewayTest…
                    testDecisionFunctionality…FAILED
Running test org.activiti.examples.bpmn.gateway.ParallelGatewayTest…
                    testForkJoin…FAILED
                    testUnbalancedForkJoin…FAILED
Running test org.activiti.examples.bpmn.subprocess.SubProcessTest…
                    testSimpleSubProcess…FAILED
Running test org.activiti.examples.bpmn.scripttask.ScriptTaskTest…
                    testScriptExecution…FAILED
                    testSetVariableThroughExecutionInScript…FAILED
Running test org.activiti.examples.bpmn.event.timer.BoundaryTimerEventTest…
                    testInterruptingTimerDuration…FAILED
Running test org.activiti.examples.bpmn.servicetask.JavaServiceTaskTest…
                    testJavaServiceDelegation…FAILED
Running test org.activiti.examples.bpmn.usertask.taskcandidate.TaskCandidateTest…
                    testSingleCandidateGroup…FAILED
                    testSingleCandidateGroup…FAILED
                    testMultipleCandidateGroups…FAILED
                    testMultipleCandidateGroups…FAILED
                    testMultipleCandidateUsers…FAILED
                    testMultipleCandidateUsers…FAILED
                    testMixedCandidateUserAndGroup…FAILED
                    testMixedCandidateUserAndGroup…FAILED
Running test org.activiti.examples.bpmn.usertask.taskassignee.TaskAssigneeTest…
                    testTaskAssignee…FAILED
Running test org.activiti.examples.bpmn.usertask.FinancialReportProcessTest…
                    testProcess…FAILED
                    testProcess…FAILED
Running test org.activiti.examples.bpmn.callactivity.CallActivityTest…
                    testOrderProcessWithCallActivity…FAILED
Running test org.activiti.examples.bpmn.expression.UelExpressionTest…
                    testValueAndMethodExpression…FAILED
Running test org.activiti.examples.mgmt.ManagementServiceTest…
                    testTableCount…FAILED
                    testGetTableMetaData…FAILED
Running test org.activiti.examples.mgmt.TablePageQueryTest…
                    testGetTablePage…FAILED
                    testGetSortedTablePage…FAILED
Running test org.activiti.examples.task.StandaloneTaskTest…
                    testCreateToComplete…FAILED
                    testCreateToComplete…FAILED
Running test org.activiti.examples.processdefinitions.ProcessDefinitionsTest…
                    testGetProcessDefinitions…FAILED
                    testDeployIdenticalProcessDefinitions…FAILED
Running test org.activiti.examples.taskforms.TaskFormsTest…
                    testTaskFormsWithVacationRequestProcess…FAILED
                    testTaskFormsWithVacationRequestProcess…FAILED
                    testTaskFormUnavailable…FAILED
                    testTaskFormUnavailable…FAILED
Running test org.activiti.examples.identity.IdentityTest…
                    testAuthentication…FAILED
                    testFindGroupsByUserAndType…FAILED
                    testUser…FAILED
                    testGroup…FAILED
                    testMembership…FAILED
Running test org.activiti.examples.pojo.PojoTest…PASSED
Running test org.activiti.examples.spring.SpringAutoDeployTest…PASSED
Running test org.activiti.examples.spring.SpringTransactionIntegrationTest…PASSED
Running test org.activiti.examples.variables.VariablesTest…
                    testBasicVariableOperations…FAILED

Regards,
Chee Kin
12 REPLIES 12

tombaeyens
Champ in-the-making
Champ in-the-making
It seems like the processEngine variable not initiated properly in ProcessEngineTestCase super class related to loading of activiti.properties file. It is obvious to me that it is environment issue. But I not sure how to fix it. Anyone here have any clue how to solve this problem?

Do you have more information on what the exact cause is?  The Activiti test suite also uses ProcessEngineTestCase.processengine and there it works.  Ideally we would be able to build a GrailsTest in our test suite that guards how you use Activiti APIs.  That way we know when we break your use case.  I don't have time to reproduce the grails tests.

jbarrez
Star Contributor
Star Contributor
The process engine is built during the runBare() of the ProcessEngineTestCase. Could you verify if this method is actually called?

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi,

Thanks for fast and helpful response. Yes, it is confirmed that the runBare() of the ProcessEngineTestCase is NOT called by Grails Test Environment. Unluckily, Grails Developer have decided not to fix this issue, you can find out more here at http://jira.codehaus.org/browse/GRAILS-6002.

Is it possible to use the work around @Rule annotations as mentioned in the jira issue?

Regards,
Chee Kin

jbarrez
Star Contributor
Star Contributor
That explains your errors …

I assume you could work around this, but only if you would introduce your own superclass with a Rule and change all the tests to have it as a parent…

limcheekin
Champ on-the-rise
Champ on-the-rise
Thanks. I think I will remove it for Grails Activiti Plugin 5.0.beta1 release as I don't have time to fix it now and I don't have any knowledge on @Rule annotation. May I know anyone here volunteer to fix this issue? I welcome you to join Grails Activiti Plugin project at http://code.google.com/p/grails-activiti-plugin/

Regards,
Chee Kin

rilisema
Champ in-the-making
Champ in-the-making
As I understand correctly, runBare() was widely used in jUnit3 and not anymore in jUnit4?
If that is the case, should the Activiti developers do something here to make Activiti more compatible with jUnit4?

Regards,
Richard Polderman

tombaeyens
Champ in-the-making
Champ in-the-making
Richard, I've created a JUnit3-style test case and a JUnit4 style rule as part of the public packages.  HTH

limcheekin
Champ on-the-rise
Champ on-the-rise
Richard, I've created a JUnit3-style test case and a JUnit4 style rule as part of the public packages.  HTH

Hi Tom,

Thanks. Look forward the release of Activiti 5.0.beta2 and incorporate this feature to the Grails Activiti Plugin.

Regards,
Chee Kin

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi Tom and Joram,

As per beta2 release, the examples still using JUnit 3 style of testing, for example:

public class CallActivityTest extends ActivitiInternalTestCase {
…….

May I know is there any plan to upgrade it to JUnit 4 as documented at http://activiti.org/userguide/index.html#apiUnitTesting?

Regards,
Chee Kin