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.Runnable
A test for two geometries.- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private Result
actualResult
private java.util.ArrayList
arguments
private java.lang.String
description
private java.lang.Exception
exception
private Result
expectedResult
private java.lang.String
geometryIndex
private boolean
isRun
private java.lang.String
operation
private java.lang.Object[]
operationArgs
private boolean
passed
private Geometry
targetGeometry
private TestCase
testCase
private int
testIndex
private double
tolerance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
computePassed()
private java.lang.Object[]
convertArgs(java.util.List argStr)
private java.lang.Object
convertArgToGeomOrString(java.lang.String argStr)
Result
getActualResult()
Computes the actual result and caches the result value.java.lang.String
getArgument(int i)
int
getArgumentCount()
java.lang.String
getDescription()
java.lang.Exception
getException()
Result
getExpectedResult()
java.lang.String
getGeometryIndex()
private GeometryOperation
getGeometryOperation()
java.lang.String
getOperation()
TestCase
getTestCase()
int
getTestIndex()
private boolean
isExpectedResultGeometryValid()
boolean
isPassed()
Returns whether the Test is passed.boolean
isRun()
void
removeArgument(int i)
void
run()
void
setArgument(int i, java.lang.String value)
void
setResult(Result result)
java.lang.String
toXml()
-
-
-
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:
run
in 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)
-
-