Class Test
- java.lang.Object
-
- org.locationtech.jtstest.testrunner.Test
-
- All Implemented Interfaces:
java.lang.Runnable
public class Test extends java.lang.Object implements java.lang.RunnableA test for two geometries.- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private ResultactualResultprivate java.util.ArrayListargumentsprivate java.lang.Stringdescriptionprivate java.lang.Exceptionexceptionprivate ResultexpectedResultprivate java.lang.StringgeometryIndexprivate booleanisRunprivate java.lang.Stringoperationprivate java.lang.Object[]operationArgsprivate booleanpassedprivate GeometrytargetGeometryprivate TestCasetestCaseprivate inttestIndexprivate doubletolerance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancomputePassed()private java.lang.Object[]convertArgs(java.util.List argStr)private java.lang.ObjectconvertArgToGeomOrString(java.lang.String argStr)ResultgetActualResult()Computes the actual result and caches the result value.java.lang.StringgetArgument(int i)intgetArgumentCount()java.lang.StringgetDescription()java.lang.ExceptiongetException()ResultgetExpectedResult()java.lang.StringgetGeometryIndex()private GeometryOperationgetGeometryOperation()java.lang.StringgetOperation()TestCasegetTestCase()intgetTestIndex()private booleanisExpectedResultGeometryValid()booleanisPassed()Returns whether the Test is passed.booleanisRun()voidremoveArgument(int i)voidrun()voidsetArgument(int i, java.lang.String value)voidsetResult(Result result)java.lang.StringtoXml()
-
-
-
Field Detail
-
description
private java.lang.String description
-
operation
private java.lang.String operation
-
expectedResult
private Result expectedResult
-
testIndex
private int testIndex
-
geometryIndex
private java.lang.String geometryIndex
-
arguments
private java.util.ArrayList arguments
-
testCase
private TestCase testCase
-
passed
private boolean passed
-
tolerance
private double tolerance
-
targetGeometry
private Geometry targetGeometry
-
operationArgs
private java.lang.Object[] operationArgs
-
isRun
private boolean isRun
-
actualResult
private Result actualResult
-
exception
private java.lang.Exception exception
-
-
Constructor Detail
-
Test
public Test(TestCase testCase, int testIndex, java.lang.String description, java.lang.String operation, java.lang.String geometryIndex, java.util.List arguments, Result expectedResult, double tolerance)
Creates a Test with the given description. The given operation (e.g. "equals") will be performed, the expected result of which is expectedResult.
-
-
Method Detail
-
setResult
public void setResult(Result result)
-
setArgument
public void setArgument(int i, java.lang.String value)
-
getDescription
public java.lang.String getDescription()
-
getGeometryIndex
public java.lang.String getGeometryIndex()
-
getExpectedResult
public Result getExpectedResult()
-
getOperation
public java.lang.String getOperation()
-
getTestIndex
public int getTestIndex()
-
getArgument
public java.lang.String getArgument(int i)
-
getArgumentCount
public int getArgumentCount()
-
isPassed
public boolean isPassed()
Returns whether the Test is passed.
-
getException
public java.lang.Exception getException()
-
getTestCase
public TestCase getTestCase()
-
removeArgument
public void removeArgument(int i)
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
isRun
public boolean isRun()
-
computePassed
public boolean computePassed() throws java.lang.Exception- Throws:
java.lang.Exception
-
isExpectedResultGeometryValid
private boolean isExpectedResultGeometryValid()
-
getActualResult
public Result getActualResult() throws java.lang.Exception
Computes the actual result and caches the result value.- Returns:
- the actual result computed
- Throws:
java.lang.Exception- if the operation fails
-
getGeometryOperation
private GeometryOperation getGeometryOperation()
-
toXml
public java.lang.String toXml()
-
convertArgs
private java.lang.Object[] convertArgs(java.util.List argStr)
-
convertArgToGeomOrString
private java.lang.Object convertArgToGeomOrString(java.lang.String argStr)
-
-