|
The method AppSchemaDataAccess.getFeatureSource(Name) may fail to return a feature source for any name returned by AppSchemaDataAccess.getNames().
This is due to the fact that getNames() returns either the target element or the mapping name (if it is defined), while getFeatureSource() only looks up mappings by target element.
To reproduce the issue, add this unit test to GeologicUnitTest.java:
@Test
public void testGetNamesAndFeatureSources() throws Exception {
/*
* Initiate data accesses and make sure they have the mappings
*/
final Map dsParams = new HashMap();
URL url = "" + "GeologicUnit.xml");
assertNotNull(url);
dsParams.put("dbtype", "app-schema");
dsParams.put("url", url.toExternalForm());
DataAccess guDataStore = DataAccessFinder.getDataStore(dsParams);
assertNotNull(guDataStore);
for (Name name: guDataStore.getNames()) {
FeatureSource fs = guDataStore.getFeatureSource(name);
assertNotNull(fs);
}
}
See related discussion on ML.
|