Package org.apache.batik.test
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: PerformanceTest.java 1733416 2016-03-03 07:07:13Z gadams $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
Allowed deviation from the reference score.protected double
Score during last runprotected double
Reference score.Fields inherited from class org.apache.batik.test.AbstractTest
id, name, parent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
double
double
final TestReport
run()
Force implementations to only implementrunOp
and other performance specific methods.final TestReport
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.final boolean
Force implementations to only implementrunOp
and other performance specific methods.protected abstract void
runOp()
Runs the tested operationprotected 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
-
Field Details
-
referenceScore
protected double referenceScoreReference score. -1 means there is no reference score -
allowedScoreDeviation
protected double allowedScoreDeviationAllowed deviation from the reference score. 10% 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 implementrunOp
and other performance specific methods.- Specified by:
run
in interfaceTest
- Overrides:
run
in classAbstractTest
-
runImplBasic
Force implementations to only implementrunOp
and other performance specific methods.- Overrides:
runImplBasic
in classAbstractTest
- Throws:
Exception
-
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:
runImpl
in classAbstractTest
- Throws:
Exception
- See Also:
-
sort
- Throws:
Exception
-
runRef
protected void runRef()Runs the reference operation. By default, this runs the same BufferedImage drawing operation 10000 times -
runOp
Runs the tested operation- Throws:
Exception
-