-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated with Junit Test, CoverageBuilderJavaBridge Class and bump to 0.6
CoverageBuilderJavaBridge class provides a empty groovy class that implements the groovy trait, which allows Junit Java implementations to run the coverage generation
- Loading branch information
1 parent
840447b
commit 06947a0
Showing
4 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/groovy/io/digitalstate/camunda/coverage/bpmn/CoverageBuilderJavaBridge.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.digitalstate.camunda.coverage.bpmn | ||
|
||
|
||
class CoverageBuilderJavaBridge implements CoverageBuilder { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package coveragetest; | ||
|
||
import io.digitalstate.camunda.coverage.bpmn.CoverageBuilderJavaBridge; | ||
import org.camunda.bpm.engine.runtime.ProcessInstance; | ||
import org.camunda.bpm.engine.test.Deployment; | ||
import org.camunda.bpm.engine.test.ProcessEngineRule; | ||
|
||
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
/** | ||
* @author Daniel Meyer | ||
* @author Martin Schimak | ||
*/ | ||
public class SimpleTestCase { | ||
|
||
@Rule | ||
public ProcessEngineRule rule = new ProcessEngineRule("camunda_config/camunda.cfg.xml"); | ||
CoverageBuilderJavaBridge coverageBuilder = new CoverageBuilderJavaBridge(); | ||
|
||
@Test | ||
@Deployment(resources = {"testProcess.bpmn"}) | ||
public void shouldExecuteProcess() { | ||
// Given we create a new process instance | ||
ProcessInstance processInstance = runtimeService().startProcessInstanceByKey("testProcess"); | ||
// Then it should be active | ||
assertThat(processInstance).isActive(); | ||
// And it should be the only instance | ||
assertThat(processInstanceQuery().count()).isEqualTo(1); | ||
// And there should exist just a single task within that process instance | ||
assertThat(task(processInstance)).isNotNull(); | ||
|
||
// When we complete that task | ||
complete(task(processInstance)); | ||
// Then the process instance should be ended | ||
assertThat(processInstance).isEnded(); | ||
coverageBuilder.coverageSnapshot(processInstance); | ||
coverageBuilder.saveCoverageSnapshots(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_7FrToMrfEeOyYYI9xhG4Cw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.0-nightly" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> | ||
<bpmn2:process id="testProcess" isExecutable="true"> | ||
<bpmn2:startEvent id="StartEvent_1"> | ||
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> | ||
</bpmn2:startEvent> | ||
<bpmn2:userTask id="UserTask_1" name="Handle Request"> | ||
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> | ||
<bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> | ||
</bpmn2:userTask> | ||
<bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="UserTask_1" /> | ||
<bpmn2:endEvent id="EndEvent_1"> | ||
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> | ||
</bpmn2:endEvent> | ||
<bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="UserTask_1" targetRef="EndEvent_1" /> | ||
</bpmn2:process> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="testProcess"> | ||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_3" bpmnElement="StartEvent_1"> | ||
<dc:Bounds x="247" y="204" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="_BPMNShape_UserTask_2" bpmnElement="UserTask_1"> | ||
<dc:Bounds x="333" y="182" width="100" height="80" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_3" targetElement="_BPMNShape_UserTask_2"> | ||
<di:waypoint xsi:type="dc:Point" x="283" y="222" /> | ||
<di:waypoint xsi:type="dc:Point" x="333" y="222" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_2" bpmnElement="EndEvent_1"> | ||
<dc:Bounds x="483" y="204" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_UserTask_2" targetElement="_BPMNShape_EndEvent_2"> | ||
<di:waypoint xsi:type="dc:Point" x="433" y="222" /> | ||
<di:waypoint xsi:type="dc:Point" x="483" y="222" /> | ||
</bpmndi:BPMNEdge> | ||
</bpmndi:BPMNPlane> | ||
</bpmndi:BPMNDiagram> | ||
</bpmn2:definitions> |