/** * Returns a {@link NetcdfStore} implementation associated with this provider. * * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>). * @return a data store implementation associated with this provider for the given storage. * @throws DataStoreException if an error occurred while creating the data store instance. */ @Override public DataStore open(final StorageConnector connector) throws DataStoreException { return new NetcdfStore(this, connector); }
/** * 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); }
/** * Tests {@link NetcdfStore#getConventionVersion()}. * * @throws DataStoreException if an error occurred while reading the netCDF file. */ @Test public void testGetConventionVersion() throws DataStoreException { final Version version; try (NetcdfStore store = create(TestData.NETCDF_2D_GEOGRAPHIC)) { version = store.getConventionVersion(); } assertEquals("major", 1, version.getMajor()); assertEquals("minor", 4, version.getMinor()); } }
/** * Returns a {@link NetcdfStore} implementation associated with this provider. * * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>). * @return a data store implementation associated with this provider for the given storage. * @throws DataStoreException if an error occurred while creating the data store instance. */ @Override public DataStore open(final StorageConnector connector) throws DataStoreException { return new NetcdfStore(this, connector); }
/** * Returns a new netCDF store to test. * * @param dataset the name of the datastore to load. * @throws DataStoreException if an error occurred while reading the netCDF file. */ private static NetcdfStore create(final TestData dataset) throws DataStoreException { return new NetcdfStore(null, new StorageConnector(dataset.location())); }