public void testEntitiesDescriptor() throws Exception {
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
InputStream is = tcl.getResourceAsStream("saml2/metadata/seam-entities.xml");
assertNotNull("Inputstream not null", is);
SAMLParser parser = new SAMLParser();
EntitiesDescriptorType entities = (EntitiesDescriptorType) parser.parse(is);
Assert.assertNotNull(entities);
Assert.assertEquals(2, entities.getEntityDescriptor().size());
EntityDescriptorType entity = (EntityDescriptorType) entities.getEntityDescriptor().get(0);
IDPSSODescriptorType idp = entity.getChoiceType().get(0).getDescriptors().get(0).getIdpDescriptor();
KeyDescriptorType keyDescriptor = idp.getKeyDescriptor().get(0);