|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectIOTestCase
NetcdfCRSTest
public class NetcdfCRSTest
Tests the NetcdfCRS class using Coordinate Systems built from test files.
Each test defined in this class performs the following steps:
wrap(CoordinateSystem, NetcdfDataset)
method in order to test their own NetCDF wrapper, as in the example below:
public class MyTest extends NetcdfCRSTest {
@Override
protected CoordinateReferenceSystem wrap(CoordinateSystem cs, NetcdfDataset file) throws IOException {
return new MyWrapper(cs);
}
}
| Field Summary | |
|---|---|
protected CoordinateReferenceSystem |
crs
The CRS object being tested. |
protected TemporalCRS |
temporalCRS
If the tested crs has a temporal component, that component. |
protected CRSValidator |
validator
The validator to use for validating the CoordinateReferenceSystem instance. |
protected VerticalCRS |
verticalCRS
If the tested crs has a vertical component, that component. |
| Fields inherited from class IOTestCase |
|---|
CIP, LANDSAT, NCEP, THREDDS |
| Constructor Summary | |
|---|---|
|
NetcdfCRSTest()
Creates a new test case using the default validator. |
protected |
NetcdfCRSTest(CRSValidator validator)
Creates a new test case using the given validator. |
| Method Summary | |
|---|---|
protected void |
assertNameEquals(String expected,
IdentifiedObject object)
Asserts that the a name or identifier of the given identified object is equals to the given value. |
void |
testGeographic_XYT()
Tests the compound CRS (geographic + time) declared in the "NCEP-SST.nc" file. |
void |
testGeographic()
Tests the geographic CRS declared in the "THREDDS.ncml" file. |
void |
testProjected_XYZT()
Tests the compound CRS (projected + height + time) declared in the "CIP.nc" file. |
protected CoordinateReferenceSystem |
wrap(CoordinateSystem cs,
NetcdfDataset file)
Wraps the given NetCDF file into a GeoAPI CRS object. |
| Methods inherited from class IOTestCase |
|---|
open |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final CRSValidator validator
CoordinateReferenceSystem instance.
This validator is specified at construction time.
protected CoordinateReferenceSystem crs
wrap(CoordinateSystem, NetcdfDataset) when a testXXX()
method is executed.
protected VerticalCRS verticalCRS
null. This field is set when a testXXX() method
from this class is executed.
protected TemporalCRS temporalCRS
null. This field is set when a testXXX() method
from this class is executed.
| Constructor Detail |
|---|
public NetcdfCRSTest()
CRSValidator.enforceStandardNames field
to false, since NetCDF axis names are non-standard.
protected NetcdfCRSTest(CRSValidator validator)
validator - The validator to use for validating the CoordinateReferenceSystem
instance.| Method Detail |
|---|
protected CoordinateReferenceSystem wrap(CoordinateSystem cs,
NetcdfDataset file)
throws IOException
NetcdfCRS instance. Subclasses can override this method for
creating their own instance.
cs - The NetCDF coordinate system to wrap.file - The originating dataset file, or null if none.
IOException - If an error occurred while wrapping the given NetCDF coordinate system.
protected void assertNameEquals(String expected,
IdentifiedObject object)
"NetCDF".
expected - The expected code value.object - The identified object to verify.
public void testGeographic()
throws IOException
GeographicCRS.EAST, NORTH)."x", "y") as declared in the NetCDF file."y x" as declared in the NetCDF file.assertNameEquals(String, IdentifiedObject) method.
IOException - If an error occurred while reading the test file.
public void testGeographic_XYT()
throws IOException
CompoundCRS
with 2 components: a GeographicCRS and a TemporalCRS.EAST,
NORTH, FUTURE)."lon", "lat", "valtime")
as declared in the NetCDF file."valtime lat lon"
as declared in the NetCDF file.assertNameEquals(String, IdentifiedObject) method.
IOException - If an error occurred while reading the test file.
public void testProjected_XYZT()
throws IOException
CompoundCRS
with 3 components: a ProjectedCRS, a VerticalCRS and
a TemporalCRS.EAST,
NORTH, UP,
FUTURE)."x0", "y0", "z0", "time")
as declared in the NetCDF file."time, z0, y0, x0"
as declared in the NetCDF file.IOTestCase.CIP javadoc.assertNameEquals(String, IdentifiedObject) method.
IOException - If an error occurred while reading the test file.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||