How to write a JUnit test case to test custom workitemhandler implementation in jBPM 6 ?
Issue
- There is a custom woritemhanlder implementation which is developed in
jBPM 6. Users would need to writeJUnittest cases to test it's functionality (e.g. complete a task) separately. Is there any sampleJUnittest case to the requirements on this woritemhanlder as listed below?
public class SimpleWoritemHandler extends
AbstractLogOrThrowWorkItemHandler {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
Map<String, Object> params = workItem.getParameters();
Map<String, Object> results = new HashMap<String, Object>();
...
}
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
}
...
}
Requirements.
(1) Excecute and test the executeWorkItem(...) method from a JUnit test case.
(2) Pass dummy WorkItem and WorkItemManager parameters from the JUnit test case.
- Also, how to write a
JUnittest case which would be able to test the sample workitemhandler implementation which is declared insidekmodule.xmlfile instead of registering it throughjBPM 6API (i.e.registerWorkItemHandler(String, WorkItemHandler)) ?
Environment
- Red Hat JBoss BPM Suite (BPMS)
- 6.0.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.