#include <fstream>
#include <saml/exceptions.h>
-#include <saml/SAMLConfig.h>
#include <saml/util/SAMLConstants.h>
#include <xmltooling/exceptions.h>
#include <xmltooling/validation/Validator.h>
#include <xmltooling/XMLObject.h>
#include <xmltooling/XMLObjectBuilder.h>
+#include <xmltooling/XMLToolingConfig.h>
using namespace opensaml;
using namespace xmltooling;
}
}
- void assertEquals(const char* failMessage, DOMDocument* expectedDOM, XMLObject* xmlObject) {
- DOMElement* generatedDOM = xmlObject->marshall();
+ void assertEquals(const char* failMessage, DOMDocument* expectedDOM, XMLObject* xmlObject, bool canMarshall=true) {
+ DOMElement* generatedDOM = xmlObject->getDOM();
+ if (!generatedDOM) {
+ if (!canMarshall) {
+ TSM_ASSERT("DOM not available", false);
+ }
+ else {
+ generatedDOM = xmlObject->marshall();
+ }
+ }
if (!generatedDOM->isEqualNode(expectedDOM->getDocumentElement())) {
string buf;
XMLHelper::serialize(generatedDOM, buf);
}
}
- void assertEquals(DOMDocument* expectedDOM, XMLObject* xmlObject) {
- assertEquals("Marshalled DOM was not the same as the expected DOM", expectedDOM, xmlObject);
+ void assertEquals(DOMDocument* expectedDOM, XMLObject* xmlObject, bool canMarshall=true) {
+ assertEquals("Marshalled DOM was not the same as the expected DOM", expectedDOM, xmlObject, canMarshall);
delete xmlObject;
}