@Test
public void testAIXMCustomGeometryHierarchy()
                        throws ClassCastException, ClassNotFoundException, InstantiationException,
                        IllegalAccessException {

    String schemaUrl = this.getClass().getResource( "../aixm/schema/message/AIXM_BasicMessage.xsd" ).toString();
    GMLAppSchemaReader adapter = new GMLAppSchemaReader( null, null, schemaUrl );
    AppSchema schema = adapter.extractAppSchema();
    // gml:Point
    GMLObjectType pointType = schema.getGeometryType( valueOf( "{http://www.opengis.net/gml/3.2}Point" ) );
    assertNotNull( pointType );
    List<GMLObjectType> pointSubstitutions = schema.getSubstitutions( pointType.getName() );
    assertEquals( 2, pointSubstitutions.size() );
    // gml:Curve
    GMLObjectType curveType = schema.getGeometryType( valueOf( "{http://www.opengis.net/gml/3.2}Curve" ) );
    assertNotNull( curveType );
    List<GMLObjectType> curveSubstitutions = schema.getSubstitutions( curveType.getName() );
    assertEquals( 2, curveSubstitutions.size() );
    // gml:Surface
    GMLObjectType surfaceType = schema.getGeometryType( valueOf( "{http://www.opengis.net/gml/3.2}Surface" ) );
    assertNotNull( surfaceType );
    List<GMLObjectType> surfaceSubstitutions = schema.getSubstitutions( surfaceType.getName() );
    assertEquals( 5, surfaceSubstitutions.size() );
}