Details
Description
Reason 1) no rounding
JDBCFeatureSourceTest>>testBoundary
assertEquals(0d, bounds.getMinX());
assertEquals(0d, bounds.getMinY());
assertEquals(2d, bounds.getMaxX());
assertEquals(2d, bounds.getMaxY());
should check with rounding, the following would work:
assertEquals(0d, new Double(Math.round(bounds.getMinX())));
assertEquals(0d, new Double(Math.round(bounds.getMinY())));
assertEquals(2d, new Double(Math.round(bounds.getMaxX())));
assertEquals(2d, new Double(Math.round(bounds.getMaxY())));
The same holds true for
JDBCFeatureSourceTest>>testBoundsWithQuery
assertEquals(1d, new Double(Math.round(bounds.getMinX())));
assertEquals(1d, new Double(Math.round(bounds.getMinY())));
assertEquals(1d, new Double(Math.round(bounds.getMaxX())));
assertEquals(1d, new Double(Math.round(bounds.getMaxY())));
Reason 2) CRS check in
JDBCFeatureSourceTest>>testSchema
JDBCFeatureSourceTest>>testBoundary
JDBCFeatureSourceTest>>testBoundaryWithQuery
The line
assertEquals(CRS.decode("EPSG:4326"), bounds.getCoordinateReferenceSystem());
is hard stuff. DB2 Spatial Extender has his WGS 84 CRS , but it is not equal as implemented in geotools.
A good idea would be to introduce a protected method
protected boolean areCRSEqual(crs1, csr2) {
return crs1.equals(crs2);
}
und use it
assertTrue(areCRSEqual(CRS.decode("EPSG:4326"), bounds.getCoordinateReferenceSystem()));
This would give me the possiblity to do my own special equal check in my Test class.
Added protected Mehtod areCRSEqual(crs1,crs2) to JDBCTestSupport.java giving all subclasses the possiblity for comparing coordinate reference systems and giving the special test cases for a particular dbms
the possibility to implement the proper compare logic for their own CRS definitions.