Search in sources :

Example 1 with HaleSchemaReader

use of eu.esdihumboldt.hale.common.schema.persist.hsd.HaleSchemaReader in project hale by halestudio.

the class AppSchemaIsolatedWorkspacesMappingTest method init.

@BeforeClass
public static void init() throws Exception {
    TestUtil.startConversionService();
    sourceSchemaSpace = new DefaultSchemaSpace();
    targetSchemaSpace = new DefaultSchemaSpace();
    Schema source = loadSchema(new HaleSchemaReader(), SOURCE_SCHEMA_PATH);
    assertNotNull(source);
    sourceSchemaSpace.addSchema(source);
    Schema target = loadSchema(new XmlSchemaReader(), TARGET_SCHEMA_STATIONS_PATH);
    assertNotNull(target);
    targetSchemaSpace.addSchema(target);
    // make sure MeasurementsType is included in the mapping relevant types
    List<TypeDefinition> mappingRelevantTypes = new ArrayList<>();
    mappingRelevantTypes.add(targetSchemaSpace.getType(MEASUREMENTS_QNAME));
    targetSchemaSpace.toggleMappingRelevant(mappingRelevantTypes);
    assertEquals(3, targetSchemaSpace.getMappingRelevantTypes().size());
    alignment = loadAlignment(new JaxbAlignmentReader(), ALIGNMENT_PATH);
    assertNotNull(alignment);
}
Also used : JaxbAlignmentReader(eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentReader) XmlSchemaReader(eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader) HaleSchemaReader(eu.esdihumboldt.hale.common.schema.persist.hsd.HaleSchemaReader) Schema(eu.esdihumboldt.hale.common.schema.model.Schema) DefaultSchemaSpace(eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace) ArrayList(java.util.ArrayList) TypeDefinition(eu.esdihumboldt.hale.common.schema.model.TypeDefinition) BeforeClass(org.junit.BeforeClass)

Aggregations

JaxbAlignmentReader (eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentReader)1 Schema (eu.esdihumboldt.hale.common.schema.model.Schema)1 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)1 DefaultSchemaSpace (eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace)1 HaleSchemaReader (eu.esdihumboldt.hale.common.schema.persist.hsd.HaleSchemaReader)1 XmlSchemaReader (eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader)1 ArrayList (java.util.ArrayList)1 BeforeClass (org.junit.BeforeClass)1