/** * Reads the metadata using the UCAR library and compares * its string representation with the expected one. * * @throws IOException if an I/O error occurred. * @throws DataStoreException if a logical error occurred. */ @Test public void testUCAR() throws IOException, DataStoreException { final Metadata metadata; try (Decoder input = createDecoder(TestData.NETCDF_2D_GEOGRAPHIC)) { metadata = new MetadataReader(input).read(); } compareToExpected(metadata); }
/** * Reads the metadata using the netCDF decoder embedded with SIS, * and compares its string representation with the expected one. * * @throws IOException if an I/O error occurred while opening the file. * @throws DataStoreException if a logical error occurred. */ @Test public void testEmbedded() throws IOException, DataStoreException { final Metadata metadata; try (Decoder input = ChannelDecoderTest.createChannelDecoder(TestData.NETCDF_2D_GEOGRAPHIC)) { metadata = new MetadataReader(input).read(); } compareToExpected(metadata); }
/** * Tests {@link NetcdfStore#getMetadata()}. * * @throws DataStoreException if an error occurred while reading the netCDF file. */ @Test public void testGetMetadata() throws DataStoreException { final Metadata metadata; try (NetcdfStore store = create(TestData.NETCDF_2D_GEOGRAPHIC)) { metadata = store.getMetadata(); assertSame("Should be cached.", metadata, store.getMetadata()); } MetadataReaderTest.compareToExpected(metadata); }