/** * Tests {@link NetcdfStoreProvider#decoder(WarningListeners, StorageConnector)} for a UCAR * {@link NetcdfFile} object. The provider shall instantiate a {@link DecoderWrapper}. * * @throws IOException if an error occurred while opening the netCDF file. * @throws DataStoreException if a logical error occurred. */ @Test public void testDecoderFromUCAR() throws IOException, DataStoreException { final StorageConnector c = new StorageConnector(createUCAR(TestData.NETCDF_2D_GEOGRAPHIC)); try (Decoder decoder = NetcdfStoreProvider.decoder(LISTENERS, c)) { assertInstanceOf("decoder", DecoderWrapper.class, decoder); } } }
/** * Tests {@link NetcdfStoreProvider#probeContent(StorageConnector)} for a UCAR {@link NetcdfFile} object. * * @throws IOException if an error occurred while opening the netCDF file. * @throws DataStoreException if a logical error occurred. */ @Test public void testProbeContentFromUCAR() throws IOException, DataStoreException { try (NetcdfFile file = createUCAR(TestData.NETCDF_2D_GEOGRAPHIC)) { final StorageConnector c = new StorageConnector(file); final NetcdfStoreProvider provider = new NetcdfStoreProvider(); final ProbeResult probe = provider.probeContent(c); assertTrue ("isSupported", probe.isSupported()); assertEquals("getMimeType", NetcdfStoreProvider.MIME_TYPE, probe.getMimeType()); assertNull ("getVersion", probe.getVersion()); } }