use of eu.esdihumboldt.hale.io.appschema.writer.internal.RetypeHandler in project hale by halestudio.
the class AppSchemaMappingTest method testRetypeHandler.
@Test
public void testRetypeHandler() {
DefaultCell cell = new DefaultCell();
cell.setTransformationIdentifier(RetypeFunction.ID);
ListMultimap<String, Type> source = ArrayListMultimap.create();
source.put(null, new DefaultType(new TypeEntityDefinition(unitDenormType, SchemaSpaceID.SOURCE, null)));
ListMultimap<String, Type> target = ArrayListMultimap.create();
target.put(null, new DefaultType(new TypeEntityDefinition(landCoverUnitType, SchemaSpaceID.TARGET, null)));
cell.setSource(source);
cell.setTarget(target);
RetypeHandler handler = new RetypeHandler();
FeatureTypeMapping ftMapping = handler.handleTypeTransformation(cell, new AppSchemaMappingContext(mappingWrapper));
assertEquals(SOURCE_UNIT_DENORM, ftMapping.getSourceType());
assertEquals("lcv:LandCoverUnit", ftMapping.getTargetElement());
}
Aggregations