@Test
public void testAIXMCustomGeometryDeclarations()
                        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();
    String aixmNs = "http://www.aixm.aero/schema/5.1";
    // {http://www.aixm.aero/schema/5.1}Point
    GMLObjectType gt = schema.getGeometryType( new QName( aixmNs, "Point" ) );
    Assert.assertEquals( 9, gt.getPropertyDeclarations().size() );
    assertPropertyType( gt, 0, new QName( GML3_2_NS, "metaDataProperty" ), 0, -1 );
    assertPropertyType( gt, 1, new QName( GML3_2_NS, "description" ), 0, 1 );
    assertPropertyType( gt, 2, new QName( GML3_2_NS, "descriptionReference" ), 0, 1 );
    assertPropertyType( gt, 3, new QName( GML3_2_NS, "identifier" ), 0, 1 );
    assertPropertyType( gt, 4, new QName( GML3_2_NS, "name" ), 0, -1 );
    // gml:pos/gml:coordinates are actually part of a choice (that's why minOccurs is 1)
    assertPropertyType( gt, 5, new QName( GML3_2_NS, "pos" ), 1, 1 );
    assertPropertyType( gt, 6, new QName( GML3_2_NS, "coordinates" ), 1, 1 );
    assertPropertyType( gt, 7, new QName( aixmNs, "horizontalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 8, new QName( aixmNs, "annotation" ), 0, -1 );
    // {http://www.aixm.aero/schema/5.1}ElevatedPoint
    gt = schema.getGeometryType( new QName( aixmNs, "ElevatedPoint" ) );
    Assert.assertEquals( 14, gt.getPropertyDeclarations().size() );
    assertPropertyType( gt, 0, new QName( GML3_2_NS, "metaDataProperty" ), 0, -1 );
    assertPropertyType( gt, 1, new QName( GML3_2_NS, "description" ), 0, 1 );
    assertPropertyType( gt, 2, new QName( GML3_2_NS, "descriptionReference" ), 0, 1 );
    assertPropertyType( gt, 3, new QName( GML3_2_NS, "identifier" ), 0, 1 );
    assertPropertyType( gt, 4, new QName( GML3_2_NS, "name" ), 0, -1 );
    // gml:pos/gml:coordinates are actually part of a choice (that's why minOccurs is 1)
    assertPropertyType( gt, 5, new QName( GML3_2_NS, "pos" ), 1, 1 );
    assertPropertyType( gt, 6, new QName( GML3_2_NS, "coordinates" ), 1, 1 );
    assertPropertyType( gt, 7, new QName( aixmNs, "horizontalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 8, new QName( aixmNs, "annotation" ), 0, -1 );
    assertPropertyType( gt, 9, new QName( aixmNs, "elevation" ), 0, 1 );
    assertPropertyType( gt, 10, new QName( aixmNs, "geoidUndulation" ), 0, 1 );
    assertPropertyType( gt, 11, new QName( aixmNs, "verticalDatum" ), 0, 1 );
    assertPropertyType( gt, 12, new QName( aixmNs, "verticalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 13, new QName( aixmNs, "extension" ), 0, -1 );
    // {http://www.aixm.aero/schema/5.1}Curve
    gt = schema.getGeometryType( new QName( aixmNs, "Curve" ) );
    Assert.assertEquals( 8, gt.getPropertyDeclarations().size() );
    assertPropertyType( gt, 0, new QName( GML3_2_NS, "metaDataProperty" ), 0, -1 );
    assertPropertyType( gt, 1, new QName( GML3_2_NS, "description" ), 0, 1 );
    assertPropertyType( gt, 2, new QName( GML3_2_NS, "descriptionReference" ), 0, 1 );
    assertPropertyType( gt, 3, new QName( GML3_2_NS, "identifier" ), 0, 1 );
    assertPropertyType( gt, 4, new QName( GML3_2_NS, "name" ), 0, -1 );
    assertPropertyType( gt, 5, new QName( GML3_2_NS, "segments" ), 1, 1 );
    assertPropertyType( gt, 6, new QName( aixmNs, "horizontalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 7, new QName( aixmNs, "annotation" ), 0, -1 );
    // {http://www.aixm.aero/schema/5.1}ElevatedCurve
    gt = schema.getGeometryType( new QName( aixmNs, "ElevatedCurve" ) );
    Assert.assertEquals( 13, gt.getPropertyDeclarations().size() );
    assertPropertyType( gt, 0, new QName( GML3_2_NS, "metaDataProperty" ), 0, -1 );
    assertPropertyType( gt, 1, new QName( GML3_2_NS, "description" ), 0, 1 );
    assertPropertyType( gt, 2, new QName( GML3_2_NS, "descriptionReference" ), 0, 1 );
    assertPropertyType( gt, 3, new QName( GML3_2_NS, "identifier" ), 0, 1 );
    assertPropertyType( gt, 4, new QName( GML3_2_NS, "name" ), 0, -1 );
    assertPropertyType( gt, 5, new QName( GML3_2_NS, "segments" ), 1, 1 );
    assertPropertyType( gt, 6, new QName( aixmNs, "horizontalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 7, new QName( aixmNs, "annotation" ), 0, -1 );
    assertPropertyType( gt, 8, new QName( aixmNs, "elevation" ), 0, 1 );
    assertPropertyType( gt, 9, new QName( aixmNs, "geoidUndulation" ), 0, 1 );
    assertPropertyType( gt, 10, new QName( aixmNs, "verticalDatum" ), 0, 1 );
    assertPropertyType( gt, 11, new QName( aixmNs, "verticalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 12, new QName( aixmNs, "extension" ), 0, -1 );
    // {http://www.aixm.aero/schema/5.1}Surface
    gt = schema.getGeometryType( new QName( aixmNs, "Surface" ) );
    Assert.assertEquals( 8, gt.getPropertyDeclarations().size() );
    assertPropertyType( gt, 0, new QName( GML3_2_NS, "metaDataProperty" ), 0, -1 );
    assertPropertyType( gt, 1, new QName( GML3_2_NS, "description" ), 0, 1 );
    assertPropertyType( gt, 2, new QName( GML3_2_NS, "descriptionReference" ), 0, 1 );
    assertPropertyType( gt, 3, new QName( GML3_2_NS, "identifier" ), 0, 1 );
    assertPropertyType( gt, 4, new QName( GML3_2_NS, "name" ), 0, -1 );
    assertPropertyType( gt, 5, new QName( GML3_2_NS, "patches" ), 1, 1 );
    assertPropertyType( gt, 6, new QName( aixmNs, "horizontalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 7, new QName( aixmNs, "annotation" ), 0, -1 );
    // {http://www.aixm.aero/schema/5.1}ElevatedSurface
    gt = schema.getGeometryType( new QName( aixmNs, "ElevatedSurface" ) );
    Assert.assertEquals( 13, gt.getPropertyDeclarations().size() );
    assertPropertyType( gt, 0, new QName( GML3_2_NS, "metaDataProperty" ), 0, -1 );
    assertPropertyType( gt, 1, new QName( GML3_2_NS, "description" ), 0, 1 );
    assertPropertyType( gt, 2, new QName( GML3_2_NS, "descriptionReference" ), 0, 1 );
    assertPropertyType( gt, 3, new QName( GML3_2_NS, "identifier" ), 0, 1 );
    assertPropertyType( gt, 4, new QName( GML3_2_NS, "name" ), 0, -1 );
    assertPropertyType( gt, 5, new QName( GML3_2_NS, "patches" ), 1, 1 );
    assertPropertyType( gt, 6, new QName( aixmNs, "horizontalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 7, new QName( aixmNs, "annotation" ), 0, -1 );
    assertPropertyType( gt, 8, new QName( aixmNs, "elevation" ), 0, 1 );
    assertPropertyType( gt, 9, new QName( aixmNs, "geoidUndulation" ), 0, 1 );
    assertPropertyType( gt, 10, new QName( aixmNs, "verticalDatum" ), 0, 1 );
    assertPropertyType( gt, 11, new QName( aixmNs, "verticalAccuracy" ), 0, 1 );
    assertPropertyType( gt, 12, new QName( aixmNs, "extension" ), 0, -1 );
}