Port Java provider API, fix to protocol support check.
[shibboleth/cpp-opensaml.git] / samltest / saml2 / metadata / FilesystemMetadataProviderTest.h
index 0ba7c17..049ab31 100644 (file)
@@ -22,12 +22,14 @@ using namespace opensaml::saml2md;
 class FilesystemMetadataProviderTest : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
     XMLCh* entityID;\r
     XMLCh* supportedProtocol;\r
+    XMLCh* supportedProtocol2;\r
     MetadataProvider* metadataProvider;\r
 \r
 public:\r
     void setUp() {\r
         entityID=XMLString::transcode("urn:mace:incommon:washington.edu");\r
         supportedProtocol=XMLString::transcode("urn:oasis:names:tc:SAML:1.1:protocol");\r
+        supportedProtocol2=XMLString::transcode("urn:mace:shibboleth:1.0");\r
         \r
         auto_ptr_XMLCh MP("MetadataProvider");\r
         auto_ptr_XMLCh path("path");\r
@@ -53,11 +55,14 @@ public:
         SAMLObjectBaseTestCase::tearDown();\r
     }\r
 \r
-    void testGetEntityDescriptor() {\r
+    void testEntityDescriptor() {\r
         Locker locker(metadataProvider);\r
-        const EntityDescriptor* descriptor = metadataProvider->lookup(entityID);\r
+        const EntityDescriptor* descriptor = metadataProvider->getEntityDescriptor(entityID);\r
         TSM_ASSERT("Retrieved entity descriptor was null", descriptor!=NULL);\r
         assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());\r
+        TSM_ASSERT_EQUALS("Unexpected number of roles", 1, descriptor->getIDPSSODescriptors().size());\r
+        TSM_ASSERT("Role lookup failed", descriptor->getIDPSSODescriptor(supportedProtocol)!=NULL);\r
+        TSM_ASSERT("Role lookup failed", descriptor->getIDPSSODescriptor(supportedProtocol2)!=NULL);\r
     }\r
 \r
 };\r