use of org.apache.sis.test.TestStep in project sis by apache.
the class FranceGeocentricInterpolationTest method testGridAsFloats.
/**
* Tests a small grid file with interpolations in geocentric coordinates as {@code float} values.
*
* <p>This method is part of a chain.
* The next method is {@link #testGridAsShorts(DatumShiftGridFile)}.</p>
*
* @return the loaded grid with values as {@code float}.
* @throws URISyntaxException if the URL to the test file can not be converted to a path.
* @throws IOException if an error occurred while loading the grid.
* @throws FactoryException if an error occurred while computing the grid.
* @throws TransformException if an error occurred while computing the envelope.
*/
@TestStep
private static DatumShiftGridFile<Angle, Length> testGridAsFloats() throws URISyntaxException, IOException, FactoryException, TransformException {
final Path file = getResource(TEST_FILE);
final DatumShiftGridFile.Float<Angle, Length> grid;
try (BufferedReader in = Files.newBufferedReader(file)) {
grid = FranceGeocentricInterpolation.load(in, file);
}
assertEquals("cellPrecision", 0.005, grid.getCellPrecision(), STRICT);
assertEquals("getCellMean", 168.2587, grid.getCellMean(0), 0.0001);
assertEquals("getCellMean", 58.7163, grid.getCellMean(1), 0.0001);
assertEquals("getCellMean", -320.1801, grid.getCellMean(2), 0.0001);
verifyGrid(grid);
return grid;
}
use of org.apache.sis.test.TestStep in project sis by apache.
the class MetadataSourceTest method testSearch.
/**
* Tests {@link MetadataSource#search(Object)}
*
* @param source the instance to test.
* @throws MetadataStoreException if an error occurred while querying the database.
*/
@TestStep
public static void testSearch(final MetadataSource source) throws MetadataStoreException {
final DefaultCitation specification = new DefaultCitation("PNG (Portable Network Graphics) Specification");
specification.setAlternateTitles(Collections.singleton(new SimpleInternationalString("PNG")));
final DefaultFormat format = new DefaultFormat();
format.setFormatSpecificationCitation(specification);
assertEquals("PNG", source.search(format));
specification.setTitle(null);
assertNull(source.search(format));
}
Aggregations