| org.geotools.data.DataTestCase
All known Subclasses: org.geotools.feature.FeatureTypeTest, org.geotools.data.mysql.MySQLDataStoreAPITest, org.geotools.data.postgis.collection.PostgisFeatureCollectionOnlineTest, org.geotools.data.memory.MemoryFeatureCollectionTest, org.geotools.data.memory.MemoryDataStoreTest, org.geotools.validation.IntegrityValidationTest, org.geotools.brewer.color.StyleGeneratorOnlineTest, org.geotools.data.AbstractDataStoreTest, org.geotools.brewer.color.StyleGeneratorTest, org.geotools.validation.FeatureValidationTest, org.geotools.data.postgis.AbstractVersionedPostgisDataTestCase, org.geotools.validation.ValidationProcessorTest, org.geotools.caching.MemoryDataStoreTest, org.geotools.data.oracle.QuickOracleOnlineTest, org.geotools.caching.CacheDataStoreTest, org.geotools.data.feature.memory.MemoryDataAccess_GTAPI_Test, org.geotools.data.collection.CollectionDataStoreTest, org.geotools.validation.ValidationPlugInTester, org.geotools.data.DataUtilitiesTest, org.geotools.validation.relate.MemoryLeakOnlineTest, org.geotools.feature.visitor.VisitorCalculationTest, org.geotools.data.FilteringFeatureReaderTest, org.geotools.data.postgis.AbstractPostgisDataTestCase,
DataTestCase | public class DataTestCase extends TestCase (Code) | | A set of constructs and utility methods used to test the data module.
By isolating a common set of
Feature s,
FeatureType s and
Filter s
we are able to reduce the amount of overhead in setting up new tests.
We have also special cased
DataTestCase.assertEquals(Geometry,Geometry) to work around
Geometry.equals( Object ) not working as expected.
This code has been made part of the public
geotools.jar to provide
a starting point for test cases involving Data constructs.
version: $Id: DataTestCase.java 22600 2006-11-04 09:37:58Z jgarnett $ author: Jody Garnett, Refractions Research sample-data |
Constructor Summary | |
public | DataTestCase(String name) Creates a default test case with the given name. |
Method Summary | |
protected void | assertEquals(Geometry expected, Geometry actual) Compares two geometries for equality. | protected void | assertEquals(String message, Geometry expected, Geometry actual) Compares two geometries for equality. | protected int | count(FeatureReader reader) Counts the number of Features returned by the specified reader. | protected int | count(FeatureWriter writer) Counts the number of Features in the specified writer. | protected void | dataSetUp() Loads the data. | public LineString | line(int[] xy) Creates a line from the specified (x,y) coordinates. | public MultiLineString | lines(int[][] xy) Creates a multiline from the specified (x,y) coordinates. | public Polygon | polygon(int[] xy) Creates a polygon from the specified (x,y) coordinates. | public Polygon | polygon(int[] xy, int[][] holes) Creates a line from the specified (x,y) coordinates and
an arbitrary amount of holes. | public LinearRing | ring(int[] xy) Creates a ring from the specified (x,y) coordinates. | protected void | setUp() Invoked before a test is run. | protected void | tearDown() Set all data references to
null , allowing garbage collection. |
gf | protected GeometryFactory gf(Code) | | |
lakeBounds | protected Envelope lakeBounds(Code) | | |
rd12Bounds | protected Envelope rd12Bounds(Code) | | |
rd12Filter | protected Filter rd12Filter(Code) | | |
rd1Filter | protected Filter rd1Filter(Code) | | |
rd2Filter | protected Filter rd2Filter(Code) | | |
riverBounds | protected Envelope riverBounds(Code) | | |
roadBounds | protected Envelope roadBounds(Code) | | |
rv1Filter | protected Filter rv1Filter(Code) | | |
DataTestCase | public DataTestCase(String name)(Code) | | Creates a default test case with the given name.
|
assertEquals | protected void assertEquals(Geometry expected, Geometry actual)(Code) | | Compares two geometries for equality.
|
assertEquals | protected void assertEquals(String message, Geometry expected, Geometry actual)(Code) | | Compares two geometries for equality.
|
count | protected int count(FeatureReader reader) throws IOException(Code) | | Counts the number of Features returned by the specified reader.
This method will close the reader.
|
line | public LineString line(int[] xy)(Code) | | Creates a line from the specified (x,y) coordinates.
The coordinates are stored in a flat array.
|
lines | public MultiLineString lines(int[][] xy)(Code) | | Creates a multiline from the specified (x,y) coordinates.
|
polygon | public Polygon polygon(int[] xy)(Code) | | Creates a polygon from the specified (x,y) coordinates.
The coordinates are stored in a flat array.
|
polygon | public Polygon polygon(int[] xy, int[][] holes)(Code) | | Creates a line from the specified (x,y) coordinates and
an arbitrary amount of holes.
|
ring | public LinearRing ring(int[] xy)(Code) | | Creates a ring from the specified (x,y) coordinates.
The coordinates are stored in a flat array.
|
tearDown | protected void tearDown() throws Exception(Code) | | Set all data references to
null , allowing garbage collection.
This method is automatically invoked after each test.
|
|
|