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 SimpleFeatures, SimpleFeatureTypes and Filters 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 ReferencedEnvelopeprotected SimpleFeature[]protected SimpleFeatureTypeprotected FilterFactoryprotected GeometryFactoryprotected ReferencedEnvelopeprotected SimpleFeature[]protected SimpleFeatureTypeprotected ReferencedEnvelopeprotected SimpleFeature[]protected SimpleFeatureTypeprotected SimpleFeatureprotected SimpleFeatureprotected ReferencedEnvelopeprotected Filterprotected Filterprotected Filterprotected ReferencedEnvelopeprotected SimpleFeature[]protected SimpleFeatureTypeprotected ReferencedEnvelopeprotected SimpleFeature[]protected SimpleFeatureTypeprotected Filterprotected SimpleFeatureTypeprotected SimpleFeatureType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertGeometryEquals(String message, Geometry expected, Geometry actual) Compares two geometries for equality.protected voidassertGeometryEquals(Geometry expected, Geometry actual) Compares two geometries for equality.protected intcount(FeatureReader<SimpleFeatureType, SimpleFeature> reader) Counts the number of Features returned by the specified reader.protected intcount(FeatureWriter<SimpleFeatureType, SimpleFeature> writer) Counts the number of Features in the specified writer.protected voidLoads the data.protected intvoidinit()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.voidtearDown()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:
NoSuchElementExceptionIOException
-