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
public abstract class PerformanceTest extends AbstractTest
This abstractTestimplementation instruments performance testing. Derived classes need only implement therunOpand, optionally, therunRefmethods. ThesetReferenceScoremethod is used to specify the last recorded score for the performance test and thesetAllowedScoreDeviationmethod 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
Fields Modifier and Type Field Description protected doubleallowedScoreDeviationAllowed deviation from the reference score.protected doublelastScoreScore during last runprotected doublereferenceScoreReference score.-
Fields inherited from class org.apache.batik.test.AbstractTest
id, name, parent
-
-
Constructor Summary
Constructors Constructor Description PerformanceTest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description doublegetAllowedScoreDeviation()doublegetLastScore()doublegetReferenceScore()TestReportrun()Force implementations to only implementrunOpand other performance specific methods.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.booleanrunImplBasic()Force 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)protected voidsort(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
-
-
-
-
Method Detail
-
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 implementrunOpand other performance specific methods.- Specified by:
runin interfaceTest- Overrides:
runin classAbstractTest
-
runImplBasic
public final boolean runImplBasic() throws java.lang.ExceptionForce implementations to only implementrunOpand other performance specific methods.- Overrides:
runImplBasicin classAbstractTest- Throws:
java.lang.Exception
-
runImpl
public final TestReport runImpl() throws java.lang.Exception
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- Throws:
java.lang.Exception- See Also:
runRef(),runOp()
-
sort
protected void sort(double[] a) throws java.lang.Exception- 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.ExceptionRuns the tested operation- Throws:
java.lang.Exception
-
-