Package io.flowcov.camunda.model
Class MethodCoverage
- java.lang.Object
-
- io.flowcov.camunda.model.MethodCoverage
-
- All Implemented Interfaces:
AggregatedCoverage
public class MethodCoverage extends java.lang.Object implements AggregatedCoverage
Coverage of an individual test method.A test method annotated with @Deployment does an independent deployment of the listed resources, hence this coverage is equivalent to a deployment coverage.
-
-
Constructor Summary
Constructors Constructor Description MethodCoverage(java.lang.String deploymentId, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCoveredElement(CoveredElement element)Add a covered element to the method coverage.voidaddProcessCoverage(ProcessCoverage processCoverage)Add a process coverage to the method coverage.voidendCoveredElement(CoveredElement element)Mark a covered element execution as ended.doublegetCoveragePercentage()Retrieves the coverage percentage for all process definitions deployed with the method.doublegetCoveragePercentage(java.lang.String processDefinitionKey)Retrieves the coverage percentage for the given process definition key with the method.java.util.Set<java.lang.String>getCoveredFlowNodeIds(java.lang.String processDefinitionKey)Retrieves a set of element IDs of covered flow nodes of the process definition identified by the passed key.java.util.Set<CoveredFlowNode>getCoveredFlowNodes()Retrieves a set of covered flow nodes of the process definitions deployed by this test method.java.util.Set<CoveredFlowNode>getCoveredFlowNodes(java.lang.String processDefinitionKey)Retrieves covered flow nodes for the given process definition key.java.util.Set<java.lang.String>getCoveredSequenceFlowIds(java.lang.String processDefinitionKey)Retrieves a set of element IDs of sequence flows of the process definition identified by the passed key.java.util.Set<CoveredSequenceFlow>getCoveredSequenceFlows()Retrieves a set of covered sequence flows of the process definitions deployed by this test method.java.util.Set<CoveredSequenceFlow>getCoveredSequenceFlows(java.lang.String processDefinitionKey)Retrieves a set of elements of sequence flows of the process definition identified by the passed key.java.util.Set<org.camunda.bpm.engine.repository.ProcessDefinition>getProcessDefinitions()Retrieves the process definitions of the test method's deployment.java.util.Set<org.camunda.bpm.model.bpmn.instance.FlowNode>getProcessDefinitionsFlowNodes()Retrieves the flow nodes of all the process definitions in the method deployment.java.util.Set<org.camunda.bpm.model.bpmn.instance.FlowNode>getProcessDefinitionsFlowNodes(java.lang.String processDefinitionKey)Retrieves the flow nodes for the process definition identified by the passed key in the method deployment.java.util.Set<org.camunda.bpm.model.bpmn.instance.SequenceFlow>getProcessDefinitionsSequenceFlows()Retrieves the sequence flows of all the process definitions in the method deployment.java.util.Set<org.camunda.bpm.model.bpmn.instance.SequenceFlow>getProcessDefinitionsSequenceFlows(java.lang.String processDefinitionKey)Retrieves the sequence flows for the process definition identified by the passed key in the method deployment.java.lang.StringtoString()
-
-
-
Method Detail
-
addProcessCoverage
public void addProcessCoverage(ProcessCoverage processCoverage)
Add a process coverage to the method coverage.- Parameters:
processCoverage-
-
addCoveredElement
public void addCoveredElement(CoveredElement element)
Add a covered element to the method coverage. The element is added according to the object fields.- Parameters:
element-
-
endCoveredElement
public void endCoveredElement(CoveredElement element)
Mark a covered element execution as ended.- Parameters:
element-
-
getCoveragePercentage
public double getCoveragePercentage()
Retrieves the coverage percentage for all process definitions deployed with the method.- Specified by:
getCoveragePercentagein interfaceAggregatedCoverage- Returns:
-
getCoveragePercentage
public double getCoveragePercentage(java.lang.String processDefinitionKey)
Retrieves the coverage percentage for the given process definition key with the method.- Specified by:
getCoveragePercentagein interfaceAggregatedCoverage- Parameters:
processDefinitionKey-- Returns:
-
getProcessDefinitionsFlowNodes
public java.util.Set<org.camunda.bpm.model.bpmn.instance.FlowNode> getProcessDefinitionsFlowNodes()
Retrieves the flow nodes of all the process definitions in the method deployment.- Returns:
-
getProcessDefinitionsFlowNodes
public java.util.Set<org.camunda.bpm.model.bpmn.instance.FlowNode> getProcessDefinitionsFlowNodes(java.lang.String processDefinitionKey)
Retrieves the flow nodes for the process definition identified by the passed key in the method deployment.- Parameters:
processDefinitionKey-- Returns:
-
getProcessDefinitionsSequenceFlows
public java.util.Set<org.camunda.bpm.model.bpmn.instance.SequenceFlow> getProcessDefinitionsSequenceFlows()
Retrieves the sequence flows of all the process definitions in the method deployment.- Returns:
-
getProcessDefinitionsSequenceFlows
public java.util.Set<org.camunda.bpm.model.bpmn.instance.SequenceFlow> getProcessDefinitionsSequenceFlows(java.lang.String processDefinitionKey)
Retrieves the sequence flows for the process definition identified by the passed key in the method deployment.- Parameters:
processDefinitionKey-- Returns:
-
getCoveredFlowNodes
public java.util.Set<CoveredFlowNode> getCoveredFlowNodes()
Retrieves a set of covered flow nodes of the process definitions deployed by this test method.- Returns:
-
getCoveredSequenceFlows
public java.util.Set<CoveredSequenceFlow> getCoveredSequenceFlows()
Retrieves a set of covered sequence flows of the process definitions deployed by this test method.- Returns:
-
getCoveredFlowNodeIds
public java.util.Set<java.lang.String> getCoveredFlowNodeIds(java.lang.String processDefinitionKey)
Retrieves a set of element IDs of covered flow nodes of the process definition identified by the passed key.- Specified by:
getCoveredFlowNodeIdsin interfaceAggregatedCoverage- Returns:
-
getCoveredFlowNodes
public java.util.Set<CoveredFlowNode> getCoveredFlowNodes(java.lang.String processDefinitionKey)
Description copied from interface:AggregatedCoverageRetrieves covered flow nodes for the given process definition key.- Specified by:
getCoveredFlowNodesin interfaceAggregatedCoverage- Returns:
-
getCoveredSequenceFlowIds
public java.util.Set<java.lang.String> getCoveredSequenceFlowIds(java.lang.String processDefinitionKey)
Retrieves a set of element IDs of sequence flows of the process definition identified by the passed key.- Specified by:
getCoveredSequenceFlowIdsin interfaceAggregatedCoverage- Returns:
-
getCoveredSequenceFlows
public java.util.Set<CoveredSequenceFlow> getCoveredSequenceFlows(java.lang.String processDefinitionKey)
Retrieves a set of elements of sequence flows of the process definition identified by the passed key.- Specified by:
getCoveredSequenceFlowsin interfaceAggregatedCoverage- Returns:
-
getProcessDefinitions
public java.util.Set<org.camunda.bpm.engine.repository.ProcessDefinition> getProcessDefinitions()
Retrieves the process definitions of the test method's deployment. The process definitions are compared by resource name and not the process key. As a result process definitions having the same process definition key but coming from separate BPMNs may be returned.- Specified by:
getProcessDefinitionsin interfaceAggregatedCoverage- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-