|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.geotools.data.DataTestCase
public class 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.
We have also special cased 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.
Field Summary | |
---|---|
protected org.opengis.filter.FilterFactory2 |
ff
|
protected com.vividsolutions.jts.geom.GeometryFactory |
gf
|
protected ReferencedEnvelope |
lakeBounds
|
protected org.opengis.feature.simple.SimpleFeature[] |
lakeFeatures
|
protected org.opengis.feature.simple.SimpleFeatureType |
lakeType
|
protected org.opengis.feature.simple.SimpleFeature |
newRiver
|
protected org.opengis.feature.simple.SimpleFeature |
newRoad
|
protected ReferencedEnvelope |
rd12Bounds
|
protected org.opengis.filter.Filter |
rd12Filter
|
protected org.opengis.filter.Filter |
rd1Filter
|
protected org.opengis.filter.Filter |
rd2Filter
|
protected ReferencedEnvelope |
riverBounds
|
protected org.opengis.feature.simple.SimpleFeature[] |
riverFeatures
|
protected org.opengis.feature.simple.SimpleFeatureType |
riverType
|
protected ReferencedEnvelope |
roadBounds
|
protected org.opengis.feature.simple.SimpleFeature[] |
roadFeatures
|
protected org.opengis.feature.simple.SimpleFeatureType |
roadType
|
protected org.opengis.filter.Filter |
rv1Filter
|
protected org.opengis.feature.simple.SimpleFeatureType |
subRiverType
|
protected org.opengis.feature.simple.SimpleFeatureType |
subRoadType
|
Constructor Summary | |
---|---|
DataTestCase(java.lang.String name)
Creates a default test case with the given name. |
Method Summary | |
---|---|
protected void |
assertEquals(com.vividsolutions.jts.geom.Geometry expected,
com.vividsolutions.jts.geom.Geometry actual)
Compares two geometries for equality. |
protected void |
assertEquals(java.lang.String message,
com.vividsolutions.jts.geom.Geometry expected,
com.vividsolutions.jts.geom.Geometry actual)
Compares two geometries for equality. |
protected int |
count(FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> reader)
Counts the number of Features returned by the specified reader. |
protected int |
count(FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> writer)
Counts the number of Features in the specified writer. |
protected void |
dataSetUp()
Loads the data. |
com.vividsolutions.jts.geom.LineString |
line(int[] xy)
Creates a line from the specified (x,y) coordinates. |
com.vividsolutions.jts.geom.MultiLineString |
lines(int[][] xy)
Creates a multiline from the specified (x,y) coordinates. |
com.vividsolutions.jts.geom.Polygon |
polygon(int[] xy)
Creates a polygon from the specified (x,y) coordinates. |
com.vividsolutions.jts.geom.Polygon |
polygon(int[] xy,
int[][] holes)
Creates a line from the specified (x,y) coordinates and an arbitrary amount of holes. |
com.vividsolutions.jts.geom.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. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected com.vividsolutions.jts.geom.GeometryFactory gf
protected org.opengis.feature.simple.SimpleFeatureType roadType
protected org.opengis.feature.simple.SimpleFeatureType subRoadType
protected org.opengis.feature.simple.SimpleFeature[] roadFeatures
protected ReferencedEnvelope roadBounds
protected ReferencedEnvelope rd12Bounds
protected org.opengis.filter.Filter rd1Filter
protected org.opengis.filter.Filter rd2Filter
protected org.opengis.filter.Filter rd12Filter
protected org.opengis.feature.simple.SimpleFeature newRoad
protected org.opengis.feature.simple.SimpleFeatureType riverType
protected org.opengis.feature.simple.SimpleFeatureType subRiverType
protected org.opengis.feature.simple.SimpleFeature[] riverFeatures
protected ReferencedEnvelope riverBounds
protected org.opengis.filter.Filter rv1Filter
protected org.opengis.feature.simple.SimpleFeature newRiver
protected org.opengis.feature.simple.SimpleFeatureType lakeType
protected org.opengis.feature.simple.SimpleFeature[] lakeFeatures
protected ReferencedEnvelope lakeBounds
protected org.opengis.filter.FilterFactory2 ff
Constructor Detail |
---|
public DataTestCase(java.lang.String name)
Method Detail |
---|
protected void setUp() throws java.lang.Exception
dataSetUp()
.
setUp
in class junit.framework.TestCase
java.lang.Exception
protected void dataSetUp() throws java.lang.Exception
java.lang.Exception
setUp()
protected void tearDown() throws java.lang.Exception
null
, allowing garbage collection.
This method is automatically invoked after each test.
tearDown
in class junit.framework.TestCase
java.lang.Exception
public com.vividsolutions.jts.geom.LineString line(int[] xy)
public com.vividsolutions.jts.geom.MultiLineString lines(int[][] xy)
public com.vividsolutions.jts.geom.Polygon polygon(int[] xy)
public com.vividsolutions.jts.geom.Polygon polygon(int[] xy, int[][] holes)
public com.vividsolutions.jts.geom.LinearRing ring(int[] xy)
protected void assertEquals(com.vividsolutions.jts.geom.Geometry expected, com.vividsolutions.jts.geom.Geometry actual)
protected void assertEquals(java.lang.String message, com.vividsolutions.jts.geom.Geometry expected, com.vividsolutions.jts.geom.Geometry actual)
protected int count(FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> reader) throws java.io.IOException
This method will close the reader.
java.io.IOException
protected int count(FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> writer) throws java.util.NoSuchElementException, java.io.IOException
java.util.NoSuchElementException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |