Package org.geotools.data
Class DataTestCase
Object
DataTestCase
A set of constructs and utility methods used to test the data module.
By isolating a common set of SimpleFeature
s, SimpleFeatureType
s and Filter
s we are able to
reduce the amount of overhead in setting up new tests.
This code has been made part of the public geotools.jar
to provide a starting point for test cases
involving Data constructs.
- Author:
- Jody Garnett, Refractions Research
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ReferencedEnvelope
protected SimpleFeature[]
protected SimpleFeatureType
protected FilterFactory
protected GeometryFactory
protected ReferencedEnvelope
protected SimpleFeature[]
protected SimpleFeatureType
protected ReferencedEnvelope
protected SimpleFeature[]
protected SimpleFeatureType
protected SimpleFeature
protected SimpleFeature
protected ReferencedEnvelope
protected Filter
protected Filter
protected Filter
protected ReferencedEnvelope
protected SimpleFeature[]
protected SimpleFeatureType
protected ReferencedEnvelope
protected SimpleFeature[]
protected SimpleFeatureType
protected Filter
protected SimpleFeatureType
protected SimpleFeatureType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertGeometryEquals
(String message, Geometry expected, Geometry actual) Compares two geometries for equality.protected void
assertGeometryEquals
(Geometry expected, Geometry actual) Compares two geometries for equality.protected int
count
(FeatureReader<SimpleFeatureType, SimpleFeature> reader) Counts the number of Features returned by the specified reader.protected int
count
(FeatureWriter<SimpleFeatureType, SimpleFeature> writer) Counts the number of Features in the specified writer.protected void
Loads the data.protected int
void
init()
Invoked before a test is run.line
(int[] xy) Creates a line from the specified (x,y) coordinates.lines
(int[][] xy) Creates a multiline from the specified (x,y) coordinates.polygon
(int[] xy) Creates a polygon from the specified (x,y) coordinates.polygon
(int[] xy, int[][] holes) Creates a line from the specified (x,y) coordinates and an arbitrary amount of holes.ring
(int[] xy) Creates a ring from the specified (x,y) coordinates.void
tearDown()
Set all data references tonull
, allowing garbage collection.
-
Field Details
-
gf
-
roadType
-
subRoadType
-
roadFeatures
-
roadBounds
-
rd12Bounds
-
rd1Filter
-
rd2Filter
-
rd12Filter
-
newRoad
-
riverType
-
subRiverType
-
riverFeatures
-
riverBounds
-
rv1Filter
-
newRiver
-
lakeType
-
lakeFeatures
-
lakeBounds
-
invalidGeomType
-
invalidGeomFeatures
-
invalidGeomBounds
-
buildingType
-
buildingFeatures
-
buildingBounds
-
ff
-
-
Constructor Details
-
DataTestCase
public DataTestCase()
-
-
Method Details
-
expected
-
init
Invoked before a test is run. The default implementation invokesdataSetUp()
.- Throws:
Exception
-
dataSetUp
Loads the data. -
tearDown
Set all data references tonull
, allowing garbage collection. This method is automatically invoked after each test.- Throws:
Exception
-
line
Creates a line from the specified (x,y) coordinates. The coordinates are stored in a flat array. -
lines
Creates a multiline from the specified (x,y) coordinates. -
polygon
Creates a polygon from the specified (x,y) coordinates. The coordinates are stored in a flat array. -
polygon
Creates a line from the specified (x,y) coordinates and an arbitrary amount of holes. -
ring
Creates a ring from the specified (x,y) coordinates. The coordinates are stored in a flat array. -
assertGeometryEquals
Compares two geometries for equality. -
assertGeometryEquals
Compares two geometries for equality. -
count
Counts the number of Features returned by the specified reader.This method will close the reader.
- Throws:
IOException
-
count
protected int count(FeatureWriter<SimpleFeatureType, SimpleFeature> writer) throws NoSuchElementException, IOExceptionCounts the number of Features in the specified writer. This method will close the writer.- Throws:
NoSuchElementException
IOException
-