Search in sources :

Example 16 with StorageConnector

use of org.apache.sis.storage.StorageConnector in project sis by apache.

the class StoreProviderTest method testProbeContent.

/**
 * Tests {@link StoreProvider#probeContent(StorageConnector)} method.
 *
 * @throws DataStoreException if en error occurred while reading the CSV file.
 */
@Test
public void testProbeContent() throws DataStoreException {
    final StoreProvider p = new StoreProvider();
    final StorageConnector c = new StorageConnector(StoreTest.testData());
    assertEquals(ProbeResult.SUPPORTED, p.probeContent(c));
}
Also used : StorageConnector(org.apache.sis.storage.StorageConnector) Test(org.junit.Test)

Example 17 with StorageConnector

use of org.apache.sis.storage.StorageConnector in project sis by apache.

the class StoreTest method open.

/**
 * Opens a CSV store on the test data for reading the lines as-is, without assembling them in a single trajectory.
 */
private static Store open() throws DataStoreException {
    StorageConnector connector = new StorageConnector(testData());
    connector.setOption(DataOptionKey.FOLIATION_REPRESENTATION, FoliationRepresentation.FRAGMENTED);
    return new Store(null, connector);
}
Also used : StorageConnector(org.apache.sis.storage.StorageConnector)

Example 18 with StorageConnector

use of org.apache.sis.storage.StorageConnector in project sis by apache.

the class LandsatStoreProviderTest method testProbeContentFromReader.

/**
 * Tests {@link LandsatStoreProvider#probeContent(StorageConnector)} method.
 *
 * @throws DataStoreException if en error occurred while reading the test file.
 */
@Test
public void testProbeContentFromReader() throws DataStoreException {
    final StorageConnector connector = new StorageConnector(LandsatReaderTest.class.getResourceAsStream("LandsatTest.txt"));
    connector.setOption(OptionKey.ENCODING, StandardCharsets.UTF_8);
    final LandsatStoreProvider provider = new LandsatStoreProvider();
    assertEquals(ProbeResult.SUPPORTED, provider.probeContent(connector));
}
Also used : StorageConnector(org.apache.sis.storage.StorageConnector) Test(org.junit.Test)

Aggregations

StorageConnector (org.apache.sis.storage.StorageConnector)18 Test (org.junit.Test)11 StringReader (java.io.StringReader)4 ProbeResult (org.apache.sis.storage.ProbeResult)4 Path (java.nio.file.Path)3 DataStore (org.apache.sis.storage.DataStore)3 Metadata (org.opengis.metadata.Metadata)3 ChannelDecoderTest (org.apache.sis.internal.netcdf.impl.ChannelDecoderTest)2 Parameters (org.apache.sis.parameter.Parameters)2 DataStoreException (org.apache.sis.storage.DataStoreException)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 DirectoryIteratorException (java.nio.file.DirectoryIteratorException)1 StandardOpenOption (java.nio.file.StandardOpenOption)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 AbstractFeature (org.apache.sis.feature.AbstractFeature)1 URIDataStore (org.apache.sis.internal.storage.URIDataStore)1 UnmodifiableArrayList (org.apache.sis.internal.util.UnmodifiableArrayList)1