Class PerformanceTest
java.lang.Object
org.apache.batik.test.AbstractTest
org.apache.batik.test.PerformanceTest
- All Implemented Interfaces:
Test
- Direct Known Subclasses:
OnePerformanceTest, PerformanceTestValidator.SimplePerformanceTest
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$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleAllowed deviation from the reference score.protected doubleScore during last runprotected doubleReference score.Fields inherited from class AbstractTest
id, name, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledoubledoublefinal TestReportrun()Force implementations to only implementrunOpand other performance specific methods.final TestReportrunImpl()This implementation of runImpl runs the reference operation (withrunRef), then runs the operation (withrunOp) and checks whether or not the score is within the allowed deviation of the reference score.final booleanForce implementations to only implementrunOpand other performance specific methods.protected abstract voidrunOp()Runs the tested operationprotected voidrunRef()Runs the reference operation.voidsetAllowedScoreDeviation(double allowedScoreDeviation) voidsetReferenceScore(double referenceScore) Methods inherited from class AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getName, getParent, getQualifiedId, reportError, reportException, reportSuccess, setId, setName, setParent
-
Field Details
-
referenceScore
protected double referenceScoreReference score. -1 means there is no reference score -
allowedScoreDeviation
protected double allowedScoreDeviationAllowed deviation from the reference score. 15% by default -
lastScore
protected double lastScoreScore during last run
-
-
Constructor Details
-
PerformanceTest
public PerformanceTest()
-
-
Method Details
-
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
Force implementations to only implementrunOpand other performance specific methods.- Specified by:
runin interfaceTest- Overrides:
runin classAbstractTest- Returns:
- the results of AbstractTest's run method
-
runImplBasic
public final boolean runImplBasic()Force implementations to only implementrunOpand other performance specific methods.- Overrides:
runImplBasicin classAbstractTest- Returns:
- false always, indicating failure
-
runImpl
This implementation of runImpl runs the reference operation (withrunRef), then runs the operation (withrunOp) and checks whether or not the score is within the allowed deviation of the reference score.- Overrides:
runImplin classAbstractTest- Returns:
- the test report
- Throws:
Exception- if an error occurred- See Also:
-
runRef
protected void runRef()Runs the reference operation. By default, this runs the same BufferedImage drawing operation 10000 times -
runOp
-