public class EfsmTransitionCoverage extends TestCoverage
Constructor and Description |
---|
EfsmTransitionCoverage()
Constructs an empty coverage.
|
EfsmTransitionCoverage(Efsm efsm)
Constructs a new coverage representation for the specified EFSM.
|
EfsmTransitionCoverage(EfsmTransitionCoverage coverage)
Constructs a new coverage as a copy of the specified coverage.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Compares the specified object with this coverage for equality.
|
java.util.Set<EfsmTransition> |
getCovered()
Returns all covered transitions in this coverage.
|
java.math.BigDecimal |
getPercentage()
Returns a percentage representation of this test coverage computed with the default precision.
|
java.math.BigDecimal |
getPercentage(int precision)
Returns a percentage representation of this test coverage computed with the specified
precision.
|
java.util.Set<EfsmTransition> |
getUncovered()
Returns all uncovered transitions in this coverage.
|
int |
hashCode() |
void |
include(EfsmTransitionCoverage coverage)
Includes the specified coverage to this coverage.
|
boolean |
isCovered(EfsmTransition transition)
Checks if the specified transition is covered.
|
boolean |
isFull()
Tests if this coverage is full, that is, there are no uncovered transitions.
|
void |
markTransitionAsCovered(EfsmTransition coveredTransition)
Marks the specified transition as covered.
|
void |
reset()
Resets this coverage to the initial state.
|
java.lang.String |
toString()
Returns a string representing this coverage.
|
public EfsmTransitionCoverage()
public EfsmTransitionCoverage(Efsm efsm)
Initially, all transitions of the EFSM are considered as uncovered.
efsm
- the EFSM for coverage monitoringjava.lang.IllegalArgumentException
- when argument is null
.public EfsmTransitionCoverage(EfsmTransitionCoverage coverage)
coverage
- the coverage to be copiedjava.lang.IllegalArgumentException
- when argument is null
.public void markTransitionAsCovered(EfsmTransition coveredTransition)
coveredTransition
- the transition to be marked as coveredjava.lang.IllegalArgumentException
- if the specified transition is not found
among the transitions extracted from the EFSM during initialisationpublic boolean isCovered(EfsmTransition transition)
transition
- the transition to be testedtrue
if the transition is covered, otherwise returns false
java.lang.IllegalArgumentException
- if the specified transition is not found
among the transitions extracted from the EFSM during initialisationpublic java.math.BigDecimal getPercentage()
The returned value is computed as a ratio of amount of covered transitions to total amount of transitions. It is guaranteed that the value is precise enough to reflect the smallest possible change in a coverage information.
getPercentage
in class TestCoverage
public java.math.BigDecimal getPercentage(int precision)
The returned value is computed as a ratio of amount of covered transitions to total amount of transitions.
getPercentage
in class TestCoverage
precision
- a number of decimal places in the resultpublic boolean isFull()
isFull
in class TestCoverage
true
if this coverage is full. Otherwise returns false
public java.util.Set<EfsmTransition> getCovered()
public java.util.Set<EfsmTransition> getUncovered()
public void reset()
TestCoverage
reset
in class TestCoverage
public void include(EfsmTransitionCoverage coverage)
coverage
- the coverage to be includedpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
The object is considered as equal to this coverage if and only if it is also an EFSM transition coverage and it contains the same covered and covered transitions as this coverage does, or more formally:
EfsmTransitionCoverage
class or its subclass;
equals
in class java.lang.Object
object
- the object to be compared for equality with this coveragetrue
if the specified object is equal to this coverage. Otherwise returns
false
public java.lang.String toString()
TestCoverage
toString
in class TestCoverage