|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAssert
TestCase
DataTestCase
public class 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.
| Field Summary | |
|---|---|
protected FilterFactory2 |
ff
|
protected GeometryFactory |
gf
|
protected ReferencedEnvelope |
lakeBounds
|
protected SimpleFeature[] |
lakeFeatures
|
protected SimpleFeatureType |
lakeType
|
protected SimpleFeature |
newRiver
|
protected SimpleFeature |
newRoad
|
protected ReferencedEnvelope |
rd12Bounds
|
protected Filter |
rd12Filter
|
protected Filter |
rd1Filter
|
protected Filter |
rd2Filter
|
protected ReferencedEnvelope |
riverBounds
|
protected SimpleFeature[] |
riverFeatures
|
protected SimpleFeatureType |
riverType
|
protected ReferencedEnvelope |
roadBounds
|
protected SimpleFeature[] |
roadFeatures
|
protected SimpleFeatureType |
roadType
|
protected Filter |
rv1Filter
|
protected SimpleFeatureType |
subRiverType
|
protected SimpleFeatureType |
subRoadType
|
| Constructor Summary | |
|---|---|
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<SimpleFeatureType,SimpleFeature> reader)
Counts the number of Features returned by the specified reader. |
protected int |
count(FeatureWriter<SimpleFeatureType,SimpleFeature> writer)
Counts the number of Features in the specified writer. |
protected void |
dataSetUp()
Loads the data. |
protected int |
expected(Filter filter)
|
LineString |
line(int[] xy)
Creates a line from the specified (x,y) coordinates. |
MultiLineString |
lines(int[][] xy)
Creates a multiline from the specified (x,y) coordinates. |
Polygon |
polygon(int[] xy)
Creates a polygon from the specified (x,y) coordinates. |
Polygon |
polygon(int[] xy,
int[][] holes)
Creates a line from the specified (x,y) coordinates and an arbitrary amount of holes. |
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 TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class 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 Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected GeometryFactory gf
protected SimpleFeatureType roadType
protected SimpleFeatureType subRoadType
protected SimpleFeature[] roadFeatures
protected ReferencedEnvelope roadBounds
protected ReferencedEnvelope rd12Bounds
protected Filter rd1Filter
protected Filter rd2Filter
protected Filter rd12Filter
protected SimpleFeature newRoad
protected SimpleFeatureType riverType
protected SimpleFeatureType subRiverType
protected SimpleFeature[] riverFeatures
protected ReferencedEnvelope riverBounds
protected Filter rv1Filter
protected SimpleFeature newRiver
protected SimpleFeatureType lakeType
protected SimpleFeature[] lakeFeatures
protected ReferencedEnvelope lakeBounds
protected FilterFactory2 ff
| Constructor Detail |
|---|
public DataTestCase(String name)
| Method Detail |
|---|
protected int expected(Filter filter)
protected void setUp()
throws Exception
dataSetUp().
setUp in class TestCaseException
protected void dataSetUp()
throws Exception
ExceptionsetUp()
protected void tearDown()
throws Exception
null, allowing garbage collection.
This method is automatically invoked after each test.
tearDown in class TestCaseExceptionpublic LineString line(int[] xy)
public MultiLineString lines(int[][] xy)
public Polygon polygon(int[] xy)
public Polygon polygon(int[] xy,
int[][] holes)
public LinearRing ring(int[] xy)
protected void assertEquals(Geometry expected,
Geometry actual)
protected void assertEquals(String message,
Geometry expected,
Geometry actual)
protected int count(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
throws IOException
This method will close the reader.
IOException
protected int count(FeatureWriter<SimpleFeatureType,SimpleFeature> writer)
throws NoSuchElementException,
IOException
NoSuchElementException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||