public abstract class PerformanceTest extends AbstractTest
Test
implementation instruments performance
testing.
Derived classes need only implement the runOp
and,
optionally, the runRef
methods.
The setReferenceScore
method is used to specify
the last recorded score for the performance test and the
setAllowedScoreDeviation
method is used to specify
the allowed deviation from the reference score.Modifier and Type | Field and Description |
---|---|
protected double |
allowedScoreDeviation
Allowed deviation from the reference score.
|
protected double |
lastScore
Score during last run
|
protected double |
referenceScore
Reference score.
|
id, name, parent
Constructor and Description |
---|
PerformanceTest() |
Modifier and Type | Method and Description |
---|---|
double |
getAllowedScoreDeviation() |
double |
getLastScore() |
double |
getReferenceScore() |
TestReport |
run()
Force implementations to only implement
runOp
and other performance specific methods. |
TestReport |
runImpl()
This implementation of runImpl runs the reference
operation (with
runRef ), then runs
the operation (with runOp ) and checks whether
or not the score is within the allowed deviation of the
reference score. |
boolean |
runImplBasic()
Force implementations to only implement
runOp
and other performance specific methods. |
protected abstract void |
runOp()
Runs the tested operation
|
protected void |
runRef()
Runs the reference operation.
|
void |
setAllowedScoreDeviation(double allowedScoreDeviation) |
void |
setReferenceScore(double referenceScore) |
protected void |
sort(double[] a) |
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getName, getParent, getQualifiedId, reportError, reportException, reportSuccess, setId, setName, setParent
protected double referenceScore
protected double allowedScoreDeviation
protected double lastScore
public double getLastScore()
public double getReferenceScore()
public void setReferenceScore(double referenceScore)
public double getAllowedScoreDeviation()
public void setAllowedScoreDeviation(double allowedScoreDeviation)
public final TestReport run()
runOp
and other performance specific methods.run
in interface Test
run
in class AbstractTest
public final boolean runImplBasic() throws java.lang.Exception
runOp
and other performance specific methods.runImplBasic
in class AbstractTest
java.lang.Exception
public final TestReport runImpl() throws java.lang.Exception
runRef
), then runs
the operation (with runOp
) and checks whether
or not the score is within the allowed deviation of the
reference score.runImpl
in class AbstractTest
java.lang.Exception
runRef()
,
runOp()
protected void sort(double[] a) throws java.lang.Exception
java.lang.Exception
protected void runRef()
protected abstract void runOp() throws java.lang.Exception
java.lang.Exception