use of org.opengis.metadata.lineage.Lineage in project sis by apache.
the class ConcatenatedFeatureSetTest method testSameType.
/**
* Tests the concatenation of two feature sets having the same feature type.
*
* @throws DataStoreException if an error occurred while concatenating the feature sets.
*/
@Test
public void testSameType() throws DataStoreException {
final FeatureTypeBuilder builder = new FeatureTypeBuilder();
builder.setName("City");
builder.addAttribute(String.class).setName("name");
builder.addAttribute(Integer.class).setName("population");
final DefaultFeatureType ft = builder.build();
final FeatureSet cfs = ConcatenatedFeatureSet.create(new MemoryFeatureSet(null, ft, Arrays.asList(ft.newInstance(), ft.newInstance())), new MemoryFeatureSet(null, ft, Arrays.asList(ft.newInstance())));
assertSame("getType()", ft, cfs.getType());
assertEquals("features.count()", 3, cfs.features(false).count());
final Metadata md = cfs.getMetadata();
assertNotNull("getMetadata()", md);
assertContentInfoEquals("City", 3, (FeatureCatalogueDescription) getSingleton(md.getContentInfo()));
final Lineage lineage = getSingleton(((DefaultMetadata) md).getResourceLineages());
assertFeatureSourceEquals("City", new String[] { "City" }, getSingleton(lineage.getSources()));
}
Aggregations