Search in sources :

Example 1 with RetypeHandler

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());
}
Also used : Type(eu.esdihumboldt.hale.common.align.model.Type) AttributeMappingType(eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AttributeMappingType) AppSchemaDataAccessType(eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AppSchemaDataAccessType) DefaultType(eu.esdihumboldt.hale.common.align.model.impl.DefaultType) TypeEntityDefinition(eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition) DefaultCell(eu.esdihumboldt.hale.common.align.model.impl.DefaultCell) DefaultType(eu.esdihumboldt.hale.common.align.model.impl.DefaultType) AppSchemaMappingContext(eu.esdihumboldt.hale.io.appschema.writer.internal.mapping.AppSchemaMappingContext) FeatureTypeMapping(eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.TypeMappingsPropertyType.FeatureTypeMapping) RetypeHandler(eu.esdihumboldt.hale.io.appschema.writer.internal.RetypeHandler) Test(org.junit.Test)

Aggregations

Type (eu.esdihumboldt.hale.common.align.model.Type)1 DefaultCell (eu.esdihumboldt.hale.common.align.model.impl.DefaultCell)1 DefaultType (eu.esdihumboldt.hale.common.align.model.impl.DefaultType)1 TypeEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition)1 AppSchemaDataAccessType (eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AppSchemaDataAccessType)1 AttributeMappingType (eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AttributeMappingType)1 FeatureTypeMapping (eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.TypeMappingsPropertyType.FeatureTypeMapping)1 RetypeHandler (eu.esdihumboldt.hale.io.appschema.writer.internal.RetypeHandler)1 AppSchemaMappingContext (eu.esdihumboldt.hale.io.appschema.writer.internal.mapping.AppSchemaMappingContext)1 Test (org.junit.Test)1