[cpp-xmltooling COMMIT] /branches/REL_1/xmltoolingtest/FilesystemCredentialResolverTest.h

noreply at shibboleth.net noreply at shibboleth.net
Thu Dec 15 09:27:14 GMT 2011


Author: scantor
Date: Thu Dec 15 09:27:14 2011
New Revision: 939

URL: http://svn.shibboleth.net/view/cpp-xmltooling?rev=939&view=rev
Log:
Switch to vector-based API.

Modified:
    branches/REL_1/xmltoolingtest/FilesystemCredentialResolverTest.h

Modified: branches/REL_1/xmltoolingtest/FilesystemCredentialResolverTest.h
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltoolingtest/FilesystemCredentialResolverTest.h?rev=939&r1=938&r2=939&view=diff
==============================================================================
--- branches/REL_1/xmltoolingtest/FilesystemCredentialResolverTest.h (original)
+++ branches/REL_1/xmltoolingtest/FilesystemCredentialResolverTest.h Thu Dec 15 09:27:14 2011
@@ -45,11 +45,13 @@
                 )
             );
 
+        vector<const Credential*> creds;
         Locker locker(credResolver.get());
-        const X509Credential* cred=dynamic_cast<const X509Credential*>(credResolver->resolve());
-        TSM_ASSERT("Retrieved credential was null", cred!=nullptr);
-        TSM_ASSERT("Retrieved key was null", cred->getPrivateKey()!=nullptr);
-        TSM_ASSERT_EQUALS("Unexpected number of certificates", 1, cred->getEntityCertificateChain().size());
-        TSM_ASSERT_EQUALS("Custom key name not found", 1, cred->getKeyNames().count("Sample Key"));
+        credResolver->resolve(creds);
+        TSM_ASSERT_EQUALS("Retrieved credential was null", 1, creds.size());
+        TSM_ASSERT("Retrieved key was null", creds.front()->getPrivateKey()!=nullptr);
+        TSM_ASSERT_EQUALS("Unexpected number of certificates", 1,
+            dynamic_cast<const X509Credential*>(creds.front())->getEntityCertificateChain().size());
+        TSM_ASSERT_EQUALS("Custom key name not found", 1, creds.front()->getKeyNames().count("Sample Key"));
     }
 };



More information about the commits mailing list