[cpp-sp] 02/02: SPCPP-756 MDQ test
Rod Widdowson
rdw at steadingsoftware.com
Mon Oct 23 10:19:28 EDT 2017
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=932ff44fdca30a4fe9b06ad62e78c4e279c37050
commit 932ff44fdca30a4fe9b06ad62e78c4e279c37050
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Oct 23 11:23:46 2017 +0100
SPCPP-756 MDQ test
https://issues.shibboleth.net/jira/browse/SSPCPP-756
---
unittests/DynamicMetadataProviderTest.h | 34 ++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/unittests/DynamicMetadataProviderTest.h b/unittests/DynamicMetadataProviderTest.h
index 9a642da..c63e85e 100644
--- a/unittests/DynamicMetadataProviderTest.h
+++ b/unittests/DynamicMetadataProviderTest.h
@@ -150,9 +150,10 @@ public:
performTest("staticFromFile.xml", true, XML_METADATA_PROVIDER);
}
-/* WIP
- void MDQ() {
+private:
+ void mdqTest(bool artifactOnly)
+ {
string config = data_path + "fromMDQ.xml";
ifstream in(config.c_str());
XMLToolingConfig& xcf = XMLToolingConfig::getConfig();
@@ -163,23 +164,34 @@ public:
);
ta::TestApplication testApp(SPConfig::getConfig().getServiceProvider(), metadataProvider.get());
- MetadataProviderCriteria crit(testApp, m_entityId.c_str());
+ const string testEntity("https://foo1.example.org/idp/shibboleth");
try {
metadataProvider->init();
- pair<const EntityDescriptor*, const RoleDescriptor*> thePair = metadataProvider->getEntityDescriptor(crit);
- TS_ASSERT(nullptr != thePair.first);
+ if (!artifactOnly) {
+ MetadataProviderCriteria crit(testApp, testEntity.c_str());
+ pair<const EntityDescriptor*, const RoleDescriptor*> thePair = metadataProvider->getEntityDescriptor(crit);
+ TS_ASSERT(nullptr != thePair.first);
+ }
- MetadataProviderCriteria artifactCrit(testApp, m_artifact.get());
+ auto_ptr<SAML2ArtifactType0004> testArtifact(new SAML2ArtifactType0004(SecurityHelper::doHash("SHA1", testEntity.data(), testEntity.length(), false), 666));
+ MetadataProviderCriteria artifactCrit(testApp, testArtifact.get());
pair<const EntityDescriptor*, const RoleDescriptor*> artefactPair = metadataProvider->getEntityDescriptor(artifactCrit);
TS_ASSERT(nullptr != artefactPair.first);
- if (nullptr != artefactPair.first)
- fprintf(stderr, "ei : %s\n", (artefactPair.first)->getEntityID());
- }
- catch (XMLToolingException& ex) {
+ } catch (XMLToolingException& ex) {
TS_TRACE(ex.what());
throw;
}
}
- */
+
+public:
+ void testMDQ()
+ {
+ mdqTest(false);
+ }
+
+ void testMDQArtifactOnly ()
+ {
+ mdqTest(true);
+ }
};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list