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 SummaryFieldsModifier 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 SummaryConstructors
- 
Method SummaryModifier 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- 
DataTestCasepublic DataTestCase()
 
- 
- 
Method Details- 
expected
- 
initInvoked before a test is run. The default implementation invokesdataSetUp().- Throws:
- Exception
 
- 
dataSetUpLoads the data.
- 
tearDownSet all data references tonull, allowing garbage collection. This method is automatically invoked after each test.- Throws:
- Exception
 
- 
lineCreates a line from the specified (x,y) coordinates. The coordinates are stored in a flat array.
- 
linesCreates a multiline from the specified (x,y) coordinates.
- 
polygonCreates a polygon from the specified (x,y) coordinates. The coordinates are stored in a flat array.
- 
polygonCreates a line from the specified (x,y) coordinates and an arbitrary amount of holes.
- 
ringCreates a ring from the specified (x,y) coordinates. The coordinates are stored in a flat array.
- 
assertGeometryEqualsCompares two geometries for equality.
- 
assertGeometryEqualsCompares two geometries for equality.
- 
countCounts the number of Features returned by the specified reader.This method will close the reader. - Throws:
- IOException
 
- 
countprotected 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
 
 
-