@Test
public void parseStandardPropsGML311()
                        throws XMLStreamException, FactoryConfigurationError, IOException, UnknownCRSException,
                        ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException {

    String schemaUrl = "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd";
    GMLAppSchemaReader adapter = new GMLAppSchemaReader( GML_31, null, schemaUrl );
    AppSchema schema = adapter.extractAppSchema();
    GMLStreamReader gmlReader = getParser( "StandardPropsGML311.gml" );
    gmlReader.setApplicationSchema( schema );
    XMLStreamReader xmlReader = gmlReader.getXMLReader();
    assertEquals( XMLStreamConstants.START_ELEMENT, xmlReader.getEventType() );
    assertEquals( new QName( "http://www.opengis.net/gml", "Point" ), xmlReader.getName() );
    Point point = (Point) gmlReader.readGeometry();
    assertEquals( XMLStreamConstants.END_ELEMENT, xmlReader.getEventType() );
    assertEquals( new QName( "http://www.opengis.net/gml", "Point" ), xmlReader.getName() );
    // geometry value
    assertEquals( 7.12, point.get0(), DELTA );
    assertEquals( 50.72, point.get1(), DELTA );
    assertEquals( 2, point.getCoordinateDimension() );
    assertEquals( CRSManager.lookup( "EPSG:4326" ), point.getCoordinateSystem() );
    // standard properties
    assertEquals( 6, point.getProperties().size() );
    // gml:metaDataProperty
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}metaDataProperty" ),
                  point.getProperties().get( 0 ).getName() );
    GenericXMLElement mdProp1 = (GenericXMLElement) point.getProperties().get( 0 ).getValue();
    assertNotNull( mdProp1.getXSType() );
    assertEquals( 1, mdProp1.getChildren().size() );
    GenericXMLElement genericMetadata = (GenericXMLElement) mdProp1.getChildren().get( 0 );
    Assert.assertNull( genericMetadata.getXSType() );
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}GenericMetaData" ), genericMetadata.getName() );
    assertEquals( 1, genericMetadata.getChildren().size() );
    PrimitiveValue pv = (PrimitiveValue) genericMetadata.getChildren().get( 0 );
    assertEquals( BaseType.STRING, pv.getType().getBaseType() );
    assertEquals( "Example for metadata: Ce point ne pas une point.", pv.getValue() );
    // gml:metaDataProperty
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}metaDataProperty" ),
                  point.getProperties().get( 1 ).getName() );
    GenericXMLElement mdProp2 = (GenericXMLElement) point.getProperties().get( 1 ).getValue();
    assertNotNull( mdProp2.getXSType() );
    assertEquals( 1, mdProp2.getChildren().size() );
    GenericXMLElement myMetadata = (GenericXMLElement) mdProp2.getChildren().get( 0 );
    Assert.assertNull( myMetadata.getXSType() );
    assertEquals( QName.valueOf( "{http://www.myns.com}MyMetaData" ), myMetadata.getName() );
    assertEquals( 1, myMetadata.getChildren().size() );
    pv = (PrimitiveValue) myMetadata.getChildren().get( 0 );
    assertEquals( STRING, pv.getType().getBaseType() );
    assertEquals( "Actually, in GML 3.1.1, anything may appear here, content is not constrained.", pv.getValue() );
    // gml:description
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}description" ),
                  point.getProperties().get( 2 ).getName() );
    GenericXMLElement descriptionProp = (GenericXMLElement) point.getProperties().get( 2 ).getValue();
    assertNotNull( descriptionProp.getXSType() );
    assertEquals( 1, descriptionProp.getChildren().size() );
    pv = (PrimitiveValue) descriptionProp.getChildren().get( 0 );
    assertEquals( STRING, pv.getType().getBaseType() );
    assertEquals( "This is just for testing the parsing of standard GML properties.", pv.getValue() );
    // gml:name
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}name" ), point.getProperties().get( 3 ).getName() );
    GenericXMLElement nameProp1 = (GenericXMLElement) point.getProperties().get( 3 ).getValue();
    assertNotNull( nameProp1.getXSType() );
    assertEquals( 1, nameProp1.getChildren().size() );
    pv = (PrimitiveValue) nameProp1.getChildren().get( 0 );
    assertEquals( STRING, pv.getType().getBaseType() );
    assertEquals( "Point P1", pv.getValue() );
    // gml:name
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}name" ), point.getProperties().get( 4 ).getName() );
    GenericXMLElement nameProp2 = (GenericXMLElement) point.getProperties().get( 4 ).getValue();
    assertNotNull( nameProp2.getXSType() );
    assertEquals( 1, nameProp2.getChildren().size() );
    pv = (PrimitiveValue) nameProp2.getChildren().get( 0 );
    assertEquals( STRING, pv.getType().getBaseType() );
    assertEquals( "P1", pv.getValue() );
    // gml:name
    assertEquals( QName.valueOf( "{http://www.opengis.net/gml}name" ), point.getProperties().get( 5 ).getName() );
    GenericXMLElement nameProp3 = (GenericXMLElement) point.getProperties().get( 5 ).getValue();
    assertNotNull( nameProp3.getXSType() );
    assertEquals( 1, nameProp3.getChildren().size() );
    pv = (PrimitiveValue) nameProp3.getChildren().get( 0 );
    assertEquals( STRING, pv.getType().getBaseType() );
    assertEquals( "Point_P1", pv.getValue() );
}