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, setParentprotected 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 Testrun in class AbstractTestpublic final boolean runImplBasic()
throws Exception
runOp
and other performance specific methods.runImplBasic in class AbstractTestExceptionpublic final TestReport runImpl() throws 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 AbstractTestExceptionrunRef(),
runOp()protected void runRef()
Copyright © 2000–2017 Apache Software Foundation. All rights reserved.