java.lang.Object
org.apache.batik.test.AbstractTest
org.apache.batik.test.PerformanceTest
- All Implemented Interfaces:
- Test
- Direct Known Subclasses:
- OnePerformanceTest, PerformanceTestValidator.SimplePerformanceTest
- public abstract class PerformanceTest
- extends AbstractTest
This abstract 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.
- Version:
- $Id: PerformanceTest.java,v 1.5 2004/08/18 07:16:57 vhardy Exp $
|
Method Summary |
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)
|
| Methods inherited from class org.apache.batik.test.AbstractTest |
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getName, getParent, getQualifiedId, reportError, reportException, reportSuccess, setId, setName, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
referenceScore
protected double referenceScore
- Reference score. -1 means there is no reference score
allowedScoreDeviation
protected double allowedScoreDeviation
- Allowed deviation from the reference score. 10% by default
lastScore
protected double lastScore
- Score during last run
PerformanceTest
public PerformanceTest()
getLastScore
public double getLastScore()
getReferenceScore
public double getReferenceScore()
setReferenceScore
public void setReferenceScore(double referenceScore)
getAllowedScoreDeviation
public double getAllowedScoreDeviation()
setAllowedScoreDeviation
public void setAllowedScoreDeviation(double allowedScoreDeviation)
run
public final TestReport run()
- Force implementations to only implement
runOp
and other performance specific methods.
- Specified by:
run in interface Test- Overrides:
run in class AbstractTest
runImplBasic
public final boolean runImplBasic()
throws java.lang.Exception
- Force implementations to only implement
runOp
and other performance specific methods.
- Overrides:
runImplBasic in class AbstractTest
runImpl
public final TestReport runImpl()
throws java.lang.Exception
- 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.
- Overrides:
runImpl in class AbstractTest
sort
protected void sort(double[] a)
throws java.lang.Exception
runRef
protected void runRef()
- Runs the reference operation.
By default, this runs the same BufferedImage drawing
operation 10000 times
runOp
protected abstract void runOp()
throws java.lang.Exception
- Runs the tested operation