|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.geotools.data.DataTestCase
A set of constructs and utility methods used to test the data module.
By isolating a commong 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 assertEquals(Geometry, Geometry)
to work around
not working as expected.
This code has been made part of the public to provide a starting point for test cases involving Data constructs.
Field Summary | |
protected com.vividsolutions.jts.geom.GeometryFactory |
gf
|
protected com.vividsolutions.jts.geom.Envelope |
lakeBounds
|
protected Feature[] |
lakeFeatures
|
protected FeatureType |
lakeType
|
protected Feature |
newRiver
|
protected Feature |
newRoad
|
protected com.vividsolutions.jts.geom.Envelope |
rd12Bounds
|
protected Filter |
rd12Filter
|
protected Filter |
rd1Filter
|
protected Filter |
rd2Filter
|
protected com.vividsolutions.jts.geom.Envelope |
riverBounds
|
protected Feature[] |
riverFeatures
|
protected FeatureType |
riverType
|
protected com.vividsolutions.jts.geom.Envelope |
roadBounds
|
protected SimpleFeature[] |
roadFeatures
|
protected FeatureType |
roadType
|
protected Filter |
rv1Filter
|
protected FeatureType |
subRiverType
|
protected FeatureType |
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 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. |
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 , 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 |
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 FeatureType roadType
protected FeatureType subRoadType
protected SimpleFeature[] roadFeatures
protected com.vividsolutions.jts.geom.Envelope roadBounds
protected com.vividsolutions.jts.geom.Envelope rd12Bounds
protected Filter rd1Filter
protected Filter rd2Filter
protected Filter rd12Filter
protected Feature newRoad
protected FeatureType riverType
protected FeatureType subRiverType
protected Feature[] riverFeatures
protected com.vividsolutions.jts.geom.Envelope riverBounds
protected Filter rv1Filter
protected Feature newRiver
protected FeatureType lakeType
protected Feature[] lakeFeatures
protected com.vividsolutions.jts.geom.Envelope lakeBounds
Constructor Detail |
public DataTestCase(java.lang.String name)
Method Detail |
protected void setUp() throws java.lang.Exception
dataSetUp()
.
java.lang.Exception
protected void dataSetUp() throws java.lang.Exception
java.lang.Exception
setUp()
protected void tearDown() throws java.lang.Exception
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 reader) throws java.io.IOException
This method will close the reader.
java.io.IOException
protected int count(FeatureWriter writer) throws java.util.NoSuchElementException, java.io.IOException, IllegalAttributeException
java.util.NoSuchElementException
java.io.IOException
IllegalAttributeException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |