@Test public void testCSVStrategyDefault() throws Exception { CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStoreFromFile(file); CSVStrategy csvStrategy = datastore.getCSVStrategy(); assertEquals( "Unexpected default csv strategy", CSVAttributesOnlyStrategy.class, csvStrategy.getClass()); }
@Test public void testCSVStrategyGuess() throws Exception { Map<String, Serializable> params = new HashMap<String, Serializable>(); params.put("strategy", "guess"); params.put("file", file); CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStore(params); CSVStrategy csvStrategy = datastore.getCSVStrategy(); assertEquals("Unexpected strategy", CSVLatLonStrategy.class, csvStrategy.getClass()); }
@Test public void testCSVStrategyWKT() throws IOException { Map<String, Serializable> params = new HashMap<String, Serializable>(); params.put("strategy", "wkt"); params.put("wktField", "whatever"); params.put("file", file); CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStore(params); CSVStrategy csvStrategy = datastore.getCSVStrategy(); assertEquals("Unexpected strategy", CSVSpecifiedWKTStrategy.class, csvStrategy.getClass()); }