Multi-line svn commit, see body.
authorBrent Putman <putmanb@georgetown.edu>
Thu, 6 Jul 2006 22:31:41 +0000 (22:31 +0000)
committerBrent Putman <putmanb@georgetown.edu>
Thu, 6 Jul 2006 22:31:41 +0000 (22:31 +0000)
Initial check-in of SAML 2.0 Core protocol namespace implementation classes
and unit tests.

65 files changed:
.gitignore
saml/.gitignore
saml/Makefile.am
saml/SAMLConfig.cpp
saml/saml2/core/Protocols.h
saml/saml2/core/impl/Protocols20Impl.cpp
saml/saml2/core/impl/Protocols20SchemaValidators.cpp [new file with mode: 0644]
samltest/.gitignore
samltest/Makefile.am
samltest/data/saml2/core/impl/ArtifactResolveChildElements.xml
samltest/data/saml2/core/impl/ArtifactResponseChildElements.xml
samltest/data/saml2/core/impl/AssertionIDRequestChildElements.xml
samltest/data/saml2/core/impl/AttributeQueryChildElements.xml
samltest/data/saml2/core/impl/AuthnQueryChildElements.xml
samltest/data/saml2/core/impl/AuthnRequest.xml
samltest/data/saml2/core/impl/AuthnRequestChildElements.xml
samltest/data/saml2/core/impl/AuthnRequestOptionalAttributes.xml
samltest/data/saml2/core/impl/AuthzDecisionQueryChildElements.xml
samltest/data/saml2/core/impl/LogoutRequestChildElements.xml
samltest/data/saml2/core/impl/LogoutResponseChildElements.xml
samltest/data/saml2/core/impl/ManageNameIDRequestChildElements.xml
samltest/data/saml2/core/impl/ManageNameIDResponseChildElements.xml
samltest/data/saml2/core/impl/NameIDMappingRequestChildElements.xml
samltest/data/saml2/core/impl/NameIDMappingResponseChildElements.xml
samltest/data/saml2/core/impl/NameIDPolicy.xml
samltest/data/saml2/core/impl/NameIDPolicyOptionalAttributes.xml
samltest/data/saml2/core/impl/NewEncryptedID.xml [new file with mode: 0644]
samltest/data/saml2/core/impl/NewEncryptedIDChildElements.xml [new file with mode: 0644]
samltest/data/saml2/core/impl/ResponseChildElements.xml
samltest/data/saml2/core/impl/StatusResponse.xml [new file with mode: 0644]
samltest/data/saml2/core/impl/StatusResponseChildElements.xml [new file with mode: 0644]
samltest/data/saml2/core/impl/StatusResponseOptionalAttributes.xml [new file with mode: 0644]
samltest/saml2/core/impl/.gitignore [new file with mode: 0644]
samltest/saml2/core/impl/Artifact20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/ArtifactResolve20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/ArtifactResponse20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/AssertionIDRequest20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/AttributeQuery20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/AuthnQuery20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/AuthnRequest20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/AuthzDecisionQuery20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/GetComplete20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/IDPEntry20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/IDPList20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/LogoutRequest20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/LogoutResponse20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/ManageNameIDRequest20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/ManageNameIDResponse20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/NameIDMappingRequest20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/NameIDMappingResponse20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/NameIDPolicy20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/NewEncryptedID20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/NewID20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/RequestedAuthnContext20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/RequesterID20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/Response20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/Scoping20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/SessionIndex20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/Status20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/StatusCode20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/StatusDetail20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/StatusMessage20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/StatusResponse20Test.h [new file with mode: 0644]
samltest/saml2/core/impl/Terminate20Test.h [new file with mode: 0644]
schemas/.gitignore [new file with mode: 0644]

index d259f48..c958642 100644 (file)
 /*.ncb
 /*.suo
 /debug
+/aclocal.m4
+/autom4te.cache
+/config.guess
+/config.h
+/config.h.in
+/config.log
+/config.status
+/config.sub
+/configure
+/depcomp
+/install-sh
+/libtool
+/Makefile
+/Makefile.in
+/missing
+/opensaml.spec
+/pkginfo
+/stamp-h1
index 994c81d..968d2de 100644 (file)
@@ -1,2 +1,6 @@
 /Debug
 /*.user
+/.deps
+/.libs
+/Makefile
+/Makefile.in
index e27f6d4..e36b1cd 100644 (file)
@@ -42,10 +42,10 @@ saml2coreinclude_HEADERS = \
        saml2/core/Protocols.h 
 
 saml2mdinclude_HEADERS = \
-       saml2/metadata/Metadata.h \
-       saml2/metadata/MetadataFilter.h \
-       saml2/metadata/MetadataProvider.h \
-       saml2/metadata/MetadataResolver.h
+    saml2/metadata/Metadata.h
+#   saml2/metadata/MetadataFilter.h \
+#      saml2/metadata/MetadataProvider.h \
+#      saml2/metadata/MetadataResolver.h
 
 noinst_HEADERS = \
        internal.h
@@ -60,8 +60,8 @@ libsaml_la_SOURCES = \
        saml2/core/impl/Assertions20Impl.cpp \
        saml2/core/impl/Assertions20SchemaValidators.cpp \
        saml2/core/impl/Protocols20Impl.cpp \
+       saml2/core/impl/Protocols20SchemaValidators.cpp \
        saml2/metadata/impl/MetadataImpl.cpp \
-       saml2/metadata/impl/MetadataProvider.cpp \
        saml2/metadata/impl/MetadataSchemaValidators.cpp \
        signature/ContentReference.cpp \
        signature/SignatureProfileValidator.cpp \
index 7859e9b..1f84e92 100644 (file)
@@ -27,6 +27,7 @@
 #include "SAMLConfig.h"
 #include "saml1/core/Assertions.h"
 #include "saml1/core/Protocols.h"
+#include "saml2/core/Protocols.h"
 #include "saml2/metadata/Metadata.h"
 #include "util/SAMLConstants.h"
 
@@ -74,6 +75,7 @@ bool SAMLInternalConfig::init()
     saml1::registerAssertionClasses();
     saml1p::registerProtocolClasses();
     saml2::registerAssertionClasses();
+    saml2p::registerProtocolClasses();
     saml2md::registerMetadataClasses();
 
     log.info("library initialization complete");
index 029bb8a..42dc463 100644 (file)
@@ -37,6 +37,8 @@ namespace opensaml {
      */
     namespace saml2p {
 
+        //TODO sync C++ and Java class/interface names, e.g. -Type or no -Type, etc
+
         DECL_XMLOBJECT_SIMPLE(SAML_API,Artifact,Artifact,SAML 2.0 Artifact element);
         DECL_XMLOBJECT_SIMPLE(SAML_API,GetComplete,GetComplete,SAML 2.0 GetComplete element);
         DECL_XMLOBJECT_SIMPLE(SAML_API,NewID,NewID,SAML 2.0 NewID element);
@@ -90,10 +92,12 @@ namespace opensaml {
             DECL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT);
             DECL_STRING_ATTRIB(Destination,DESTINATION);
             DECL_STRING_ATTRIB(Consent,CONSENT);
+
             DECL_TYPED_FOREIGN_CHILD(Issuer,saml2);
             DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
             DECL_TYPED_CHILD(Extensions);
             DECL_TYPED_CHILD(Status);
+
             /** StatusResponseType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
@@ -165,7 +169,7 @@ namespace opensaml {
         END_XMLOBJECT;
 
         BEGIN_XMLOBJECT(SAML_API,IDPList,xmltooling::XMLObject,SAML 2.0 IDPList element);
-            DECL_TYPED_CHILD(IDPEntry);
+            DECL_TYPED_CHILDREN(IDPEntry);
             DECL_TYPED_CHILD(GetComplete);
             /** IDPListType local name */
             static const XMLCh TYPE_NAME[];
@@ -177,6 +181,8 @@ namespace opensaml {
             DECL_TYPED_CHILDREN(RequesterID);
             /** ScopingType local name */
             static const XMLCh TYPE_NAME[];
+            /** ProxyCount value to express no restriction*/
+            static const int NO_PROXY_COUNT;
         END_XMLOBJECT;
 
         BEGIN_XMLOBJECT(SAML_API,AuthnRequest,Request,SAML 2.0 AuthnRequest element);
@@ -211,6 +217,7 @@ namespace opensaml {
         END_XMLOBJECT;
 
         BEGIN_XMLOBJECT(SAML_API,ArtifactResponse,StatusResponse,SAML 2.0 ArtifactResponse element);
+            DECL_XMLOBJECT_CHILD(Payload);
             /** ArtifiactResponseType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
@@ -220,7 +227,7 @@ namespace opensaml {
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT(SAML_API,NewEncryptedID,saml2::EncryptedElementType,SAML 2.0 EncryptedNewID element);
+        BEGIN_XMLOBJECT(SAML_API,NewEncryptedID,saml2::EncryptedElementType,SAML 2.0 NewEncryptedID element);
         END_XMLOBJECT;
 
         BEGIN_XMLOBJECT(SAML_API,ManageNameIDRequest,Request,SAML 2.0 ManageNameIDRequest element);
@@ -266,8 +273,6 @@ namespace opensaml {
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
 
-        //TODO custom builders, if any
-
         // Builders
         DECL_SAML2POBJECTBUILDER(Artifact);
         DECL_SAML2POBJECTBUILDER(ArtifactResolve);
@@ -301,11 +306,46 @@ namespace opensaml {
         DECL_SAML2POBJECTBUILDER(StatusMessage);
         DECL_SAML2POBJECTBUILDER(Terminate);
 
+        //
+        // Custom builders
+        //
+
+        /**
+         * Builder for StatusResponse objects.
+         * 
+         * This is customized to force the element name to be specified.
+         */
+        class SAML_API StatusResponseBuilder : public xmltooling::XMLObjectBuilder {
+        public:
+            virtual ~StatusResponseBuilder() {}
+            /** Builder that allows element/type override. */
+            virtual StatusResponse* buildObject(
+                const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
+                ) const;
+        
+            /** Singleton builder. */
+            static StatusResponse* buildStatusResponse(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
+                const StatusResponseBuilder* b = dynamic_cast<const StatusResponseBuilder*>(
+                    XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20P_NS,StatusResponse::TYPE_NAME))
+                    );
+                if (b) {
+                    xmltooling::QName schemaType(SAMLConstants::SAML20P_NS,StatusResponse::TYPE_NAME,SAMLConstants::SAML20P_PREFIX);
+                    return b->buildObject(nsURI, localName, prefix, &schemaType);
+                }
+                throw xmltooling::XMLObjectException("Unable to obtain typed builder for StatusResponse.");
+            }
+        };
+
         
         /**
-         * Registers builders and validators for Protocol classes into the runtime.
+         * Registers builders and validators for SAML 2.0 Protocol classes into the runtime.
          */
         void SAML_API registerProtocolClasses();
+
+        /**
+         * Validator suite for SAML 2.0 Protocol schema validation.
+         */
+        extern SAML_API xmltooling::ValidatorSuite ProtocolSchemaValidators;
     };
 };
 
index 121a0f4..8f4a3d6 100644 (file)
 
 #include "internal.h"
 #include "exceptions.h"
+#include "saml/encryption/EncryptedKeyResolver.h"
 #include "saml2/core/Protocols.h"
 
 #include <xmltooling/AbstractChildlessElement.h>
 #include <xmltooling/AbstractComplexElement.h>
 #include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
+#include <xmltooling/encryption/Decrypter.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
@@ -41,6 +43,7 @@ using namespace opensaml::saml2p;
 using namespace opensaml::saml2;
 using namespace opensaml;
 using namespace xmlsignature;
+using namespace xmlencryption;
 using namespace xmltooling;
 using namespace std;
 
@@ -52,7 +55,1619 @@ using namespace std;
 namespace opensaml {
     namespace saml2p {
 
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Artifact);
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,GetComplete);
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,NewID);
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,RequesterID);
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SessionIndex);
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,StatusMessage);
 
+
+        //TODO need unit test for this, using objects from another namespace
+        class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
+                                             public AbstractDOMCachingXMLObject,
+                                             public AbstractElementProxy,
+                                             public AbstractValidatingXMLObject,
+                                             public AbstractXMLObjectMarshaller,
+                                             public AbstractXMLObjectUnmarshaller
+        {
+        public:
+            virtual ~ExtensionsImpl() {}
+    
+            ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+            }
+                
+            ExtensionsImpl(const ExtensionsImpl& src)
+                    : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src),
+                        AbstractValidatingXMLObject(src) {
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        getXMLObjects().push_back((*i)->clone());
+                    }
+                }
+            }
+            
+            IMPL_XMLOBJECT_CLONE(Extensions);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                // Unknown child.
+                const XMLCh* nsURI=root->getNamespaceURI();
+                if (!XMLString::equals(nsURI,SAMLConstants::SAML20P_NS) && nsURI && *nsURI) {
+                    getXMLObjects().push_back(childXMLObject);
+                    return;
+                }
+                
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL StatusCodeImpl : public virtual StatusCode,
+                                             public AbstractComplexElement,
+                                             public AbstractDOMCachingXMLObject,
+                                             public AbstractValidatingXMLObject,
+                                             public AbstractXMLObjectMarshaller,
+                                             public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_Value=NULL;
+                m_StatusCode=NULL;
+                m_children.push_back(NULL);
+                m_pos_StatusCode=m_children.begin();
+            }
+            public:
+                virtual ~StatusCodeImpl() {}
+
+                StatusCodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+                {
+                        init();
+                }
+
+                StatusCodeImpl(const StatusCodeImpl& src) : AbstractXMLObject(src),
+                                                            AbstractDOMCachingXMLObject(src),
+                                                            AbstractValidatingXMLObject(src)
+                {
+                    init();
+                    setValue(src.getValue());
+                    if (src.getStatusCode())
+                        setStatusCode(src.getStatusCode()->cloneStatusCode());
+                }
+
+                IMPL_XMLOBJECT_CLONE(StatusCode);
+                IMPL_STRING_ATTRIB(Value);
+                IMPL_TYPED_CHILD(StatusCode);
+
+            protected:
+                void marshallAttributes(DOMElement* domElement) const {
+                    MARSHALL_STRING_ATTRIB(Value,VALUE,NULL);
+                }
+
+                void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                    PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
+                    AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+                }
+
+                void processAttribute(const DOMAttr* attribute) {
+                    PROC_STRING_ATTRIB(Value,VALUE,NULL);
+                    AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+                }
+        };
+
+        //TODO need unit tests for non-SAML namespace children
+        class SAML_DLLLOCAL StatusDetailImpl : public virtual StatusDetail,
+                                               public AbstractComplexElement,
+                                               public AbstractDOMCachingXMLObject,
+                                               public AbstractValidatingXMLObject,
+                                               public AbstractXMLObjectMarshaller,
+                                               public AbstractXMLObjectUnmarshaller
+        {
+            public:
+                virtual ~StatusDetailImpl() {}
+
+                StatusDetailImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+
+                StatusDetailImpl(const StatusDetailImpl& src) : AbstractXMLObject(src),
+                                                                AbstractDOMCachingXMLObject(src),
+                                                                AbstractValidatingXMLObject(src)
+                {
+                        VectorOf(XMLObject) v=getDetails();
+                        for (vector<XMLObject*>::const_iterator i=src.m_Details.begin(); i!=src.m_Details.end(); i++) {
+                            if (*i) {
+                                v.push_back((*i)->clone());
+                            }
+                        }
+                    }
+
+                IMPL_XMLOBJECT_CLONE(StatusDetail);
+                IMPL_XMLOBJECT_CHILDREN(Detail,m_children.end());
+
+            protected:
+                void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                    getDetails().push_back(childXMLObject);
+                    AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+                }
+        };
+
+
+        class SAML_DLLLOCAL StatusImpl : public virtual Status,
+                                         public AbstractComplexElement,
+                                         public AbstractDOMCachingXMLObject,
+                                         public AbstractValidatingXMLObject,
+                                         public AbstractXMLObjectMarshaller,
+                                         public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_StatusCode=NULL;
+                m_StatusMessage=NULL;
+                m_StatusDetail=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_StatusCode=m_children.begin();
+                m_pos_StatusMessage=m_pos_StatusCode;
+                ++m_pos_StatusMessage;
+                m_pos_StatusDetail=m_pos_StatusMessage;
+                ++m_pos_StatusDetail;
+            }
+        public:
+            virtual ~StatusImpl() { }
+    
+            StatusImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                    init();
+            }
+                
+            StatusImpl(const StatusImpl& src) : AbstractXMLObject(src),
+                                                AbstractDOMCachingXMLObject(src),
+                                                AbstractValidatingXMLObject(src)
+            {
+                init();
+                if (src.getStatusCode())
+                    setStatusCode(src.getStatusCode()->cloneStatusCode());
+                if (src.getStatusMessage())
+                    setStatusMessage(src.getStatusMessage()->cloneStatusMessage());
+                if (src.getStatusDetail())
+                    setStatusDetail(src.getStatusDetail()->cloneStatusDetail());
+            }
+            
+            IMPL_XMLOBJECT_CLONE(Status);
+            IMPL_TYPED_CHILD(StatusCode);
+            IMPL_TYPED_CHILD(StatusMessage);
+            IMPL_TYPED_CHILD(StatusDetail);
+    
+        protected:
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusMessage,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusDetail,SAMLConstants::SAML20P_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+    
+        };
+
+
+        class SAML_DLLLOCAL RequestImpl : public virtual Request,
+                                          public AbstractComplexElement,
+                                          public AbstractDOMCachingXMLObject,
+                                          public AbstractValidatingXMLObject,
+                                          public AbstractXMLObjectMarshaller,
+                                          public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_ID=NULL;
+                m_Version=NULL;
+                m_IssueInstant=NULL;
+                m_Destination=NULL;
+                m_Consent=NULL;
+                m_Issuer=NULL;
+                m_Signature=NULL;
+                m_Extensions=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_Issuer=m_children.begin();
+                m_pos_Signature=m_pos_Issuer;
+                ++m_pos_Signature;
+                m_pos_Extensions=m_pos_Signature;
+                ++m_pos_Extensions;
+            }
+        protected:
+            RequestImpl() {
+                init();
+            }
+        public:
+            virtual ~RequestImpl() {
+                XMLString::release(&m_ID);
+                XMLString::release(&m_Version);
+                XMLString::release(&m_Destination);
+                XMLString::release(&m_Consent);
+                delete m_IssueInstant;
+            }
+    
+            RequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            RequestImpl(const RequestImpl& src) : AbstractXMLObject(src),
+                                                  AbstractDOMCachingXMLObject(src),
+                                                  AbstractValidatingXMLObject(src)
+            {
+                init();
+                setID(src.getID());
+                setVersion(src.getVersion());
+                setIssueInstant(src.getIssueInstant());
+                setDestination(src.getDestination());
+                setConsent(src.getConsent());
+                if (src.getIssuer())
+                    setIssuer(src.getIssuer()->cloneIssuer());
+                if (src.getSignature())
+                    setSignature(src.getSignature()->cloneSignature());
+                if (src.getExtensions())
+                    setExtensions(src.getExtensions()->cloneExtensions());
+            }
+            
+            const XMLCh* getId() const {
+                return getID();
+            }
+
+            //IMPL_TYPED_CHILD(Signature);
+            // Need customized setter.
+        protected:
+            Signature* m_Signature;
+            list<XMLObject*>::iterator m_pos_Signature;
+        public:
+            Signature* getSignature() const {
+                return m_Signature;
+            }
+            
+            void setSignature(Signature* sig) {
+                prepareForAssignment(m_Signature,sig);
+                *m_pos_Signature=m_Signature=sig;
+                // Sync content reference back up.
+                if (m_Signature)
+                    m_Signature->setContentReference(new opensaml::ContentReference(*this));
+            }
+            
+            IMPL_XMLOBJECT_CLONE(Request);
+            IMPL_STRING_ATTRIB(Version);
+            IMPL_STRING_ATTRIB(ID);
+            IMPL_DATETIME_ATTRIB(IssueInstant);
+            IMPL_STRING_ATTRIB(Destination);
+            IMPL_STRING_ATTRIB(Consent);
+            IMPL_TYPED_FOREIGN_CHILD(Issuer,saml2);
+            IMPL_TYPED_CHILD(Extensions);
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                if (!m_Version)
+                    const_cast<RequestImpl*>(this)->m_Version=XMLString::transcode("2.0");
+                MARSHALL_STRING_ATTRIB(Version,VER,NULL);
+                if (!m_ID)
+                    const_cast<RequestImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
+                MARSHALL_ID_ATTRIB(ID,ID,NULL);
+                if (!m_IssueInstant)
+                    const_cast<RequestImpl*>(this)->m_IssueInstant=new DateTime(time(NULL));
+                MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
+                MARSHALL_STRING_ATTRIB(Destination,DESTINATION,NULL);
+                MARSHALL_STRING_ATTRIB(Consent,CONSENT,NULL);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
+                PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+    
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_ID_ATTRIB(ID,ID,NULL);
+                PROC_STRING_ATTRIB(Version,VER,NULL);
+                PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
+                PROC_STRING_ATTRIB(Destination,DESTINATION,NULL);
+                PROC_STRING_ATTRIB(Consent,CONSENT,NULL);
+                AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+            }
+        };
+
+
+        class SAML_DLLLOCAL AssertionIDRequestImpl : public virtual AssertionIDRequest, public RequestImpl
+        {
+        public:
+            virtual ~AssertionIDRequestImpl() { }
+    
+            AssertionIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+                
+            AssertionIDRequestImpl(const AssertionIDRequestImpl& src) : AbstractXMLObject(src),
+                                                                        RequestImpl(src)
+            {
+                VectorOf(AssertionIDRef) v=getAssertionIDRefs();
+                for (vector<AssertionIDRef*>::const_iterator i=src.m_AssertionIDRefs.begin(); i!=src.m_AssertionIDRefs.end(); i++) {
+                    if (*i) {                               
+                        v.push_back((*i)->cloneAssertionIDRef());
+                    }
+                }
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(AssertionIDRequest);
+            IMPL_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,m_children.end());
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,SAMLConstants::SAML20_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL SubjectQueryImpl : public virtual SubjectQuery, public RequestImpl
+        {
+            void init()
+            {
+                m_Subject = NULL;
+                m_children.push_back(NULL);
+                m_pos_Subject = m_pos_Extensions;
+                ++m_pos_Subject;
+            }
+        protected:
+            SubjectQueryImpl() {
+                init();
+            }
+        public:
+            virtual ~SubjectQueryImpl() { }
+    
+            SubjectQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            { 
+                init();
+            }
+                
+            SubjectQueryImpl(const SubjectQueryImpl& src) : AbstractXMLObject(src),
+                                                            RequestImpl(src)
+            {
+                init();
+                if (src.getSubject())
+                    setSubject(src.getSubject()->cloneSubject());
+            }
+            
+            IMPL_XMLOBJECT_CLONE(SubjectQuery);
+            IMPL_TYPED_FOREIGN_CHILD(Subject,saml2);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+
+        class SAML_DLLLOCAL RequestedAuthnContextImpl : public virtual RequestedAuthnContext,
+                                                        public AbstractComplexElement,
+                                                        public AbstractDOMCachingXMLObject,
+                                                        public AbstractValidatingXMLObject,
+                                                        public AbstractXMLObjectMarshaller,
+                                                        public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_Comparison=NULL;
+            }
+        public:
+            virtual ~RequestedAuthnContextImpl() {
+                XMLString::release(&m_Comparison);
+            }
+    
+            RequestedAuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            RequestedAuthnContextImpl(const RequestedAuthnContextImpl& src) : AbstractXMLObject(src),
+                                                                              AbstractDOMCachingXMLObject(src),
+                                                                              AbstractValidatingXMLObject(src)
+            {
+                init();
+                setComparison(src.getComparison());
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        AuthnContextClassRef* classref=dynamic_cast<AuthnContextClassRef*>(*i);
+                        if (classref) {
+                            getAuthnContextClassRefs().push_back(classref->cloneAuthnContextClassRef());
+                            continue;
+                        }
+
+                        AuthnContextDeclRef* declref=dynamic_cast<AuthnContextDeclRef*>(*i);
+                        if (declref) {
+                            getAuthnContextDeclRefs().push_back(declref->cloneAuthnContextDeclRef());
+                            continue;
+                        }
+                    }
+                }
+            }
+            
+            IMPL_XMLOBJECT_CLONE(RequestedAuthnContext);
+            IMPL_STRING_ATTRIB(Comparison);
+            IMPL_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,m_children.end());
+            IMPL_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,m_children.end());
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                MARSHALL_STRING_ATTRIB(Comparison,COMPARISON,NULL);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,SAMLConstants::SAML20_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+    
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_STRING_ATTRIB(Comparison,COMPARISON,NULL);
+                AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+            }
+        };
+
+
+        class SAML_DLLLOCAL AuthnQueryImpl : public virtual AuthnQuery, public SubjectQueryImpl
+        {
+            void init() {
+                m_SessionIndex=NULL;
+                m_RequestedAuthnContext=NULL;
+                m_children.push_back(NULL);
+                m_pos_RequestedAuthnContext = m_pos_Subject;
+                ++m_pos_RequestedAuthnContext;
+                
+            }
+        public:
+            virtual ~AuthnQueryImpl() {
+                XMLString::release(&m_SessionIndex);
+            }
+    
+            AuthnQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            AuthnQueryImpl(const AuthnQueryImpl& src) : AbstractXMLObject(src),
+                                                        SubjectQueryImpl(src)
+            {
+                init();
+                setSessionIndex(src.getSessionIndex());
+                if (src.getRequestedAuthnContext())
+                    setRequestedAuthnContext(src.getRequestedAuthnContext()->cloneRequestedAuthnContext());
+            }
+            
+            IMPL_XMLOBJECT_CLONE(AuthnQuery);
+            IMPL_STRING_ATTRIB(SessionIndex);
+            IMPL_TYPED_CHILD(RequestedAuthnContext);
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
+                SubjectQueryImpl::marshallAttributes(domElement);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
+                SubjectQueryImpl::processChildElement(childXMLObject,root);
+            }
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
+                SubjectQueryImpl::processAttribute(attribute);
+            }
+        };
+
+        class SAML_DLLLOCAL AttributeQueryImpl : public virtual AttributeQuery, public SubjectQueryImpl
+        {
+        public:
+            virtual ~AttributeQueryImpl() { }
+    
+            AttributeQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+                
+            AttributeQueryImpl(const AttributeQueryImpl& src) : AbstractXMLObject(src),
+                                                                SubjectQueryImpl(src)
+            {
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        Attribute* attrib=dynamic_cast<Attribute*>(*i);
+                        if (attrib) {
+                            getAttributes().push_back(attrib->cloneAttribute());
+                            continue;
+                        }
+                    }
+                }
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(AttributeQuery);
+            IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
+                SubjectQueryImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL AuthzDecisionQueryImpl : public virtual AuthzDecisionQuery, public SubjectQueryImpl
+        {
+            void init() {
+                m_Resource=NULL;
+                m_Evidence=NULL;
+                m_children.push_back(NULL);
+                m_pos_Evidence=m_pos_Subject;
+                ++m_pos_Evidence;
+                
+            }
+        public:
+            virtual ~AuthzDecisionQueryImpl() {
+                XMLString::release(&m_Resource);
+            }
+    
+            AuthzDecisionQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            AuthzDecisionQueryImpl(const AuthzDecisionQueryImpl& src) : AbstractXMLObject(src),
+                                                        SubjectQueryImpl(src)
+            {
+                init();
+                setResource(src.getResource());
+                if (src.getEvidence())
+                    setEvidence(src.getEvidence()->cloneEvidence());
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        Action* action=dynamic_cast<Action*>(*i);
+                        if (action) {
+                            getActions().push_back(action->cloneAction());
+                            continue;
+                        }
+                    }
+                }
+            }
+            
+            IMPL_XMLOBJECT_CLONE(AuthzDecisionQuery);
+            IMPL_STRING_ATTRIB(Resource);
+            IMPL_TYPED_FOREIGN_CHILDREN(Action,saml2,m_pos_Evidence);
+            IMPL_TYPED_FOREIGN_CHILD(Evidence,saml2);
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
+                SubjectQueryImpl::marshallAttributes(domElement);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(Evidence,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(Action,saml2,SAMLConstants::SAML20_NS,false);
+                SubjectQueryImpl::processChildElement(childXMLObject,root);
+            }
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
+                SubjectQueryImpl::processAttribute(attribute);
+            }
+        };
+
+        class SAML_DLLLOCAL NameIDPolicyImpl : public virtual NameIDPolicy,
+                                               public AbstractChildlessElement,
+                                               public AbstractDOMCachingXMLObject,
+                                               public AbstractValidatingXMLObject,
+                                               public AbstractXMLObjectMarshaller,
+                                               public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_Format=NULL;
+                m_SPNameQualifier=NULL;
+                m_AllowCreate=XMLConstants::XML_BOOL_NULL;
+            }
+            public:
+                virtual ~NameIDPolicyImpl()
+                {
+                    XMLString::release(&m_Format);
+                    XMLString::release(&m_SPNameQualifier);
+                }
+
+                NameIDPolicyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+                {
+                        init();
+                }
+
+                NameIDPolicyImpl(const NameIDPolicyImpl& src) : AbstractXMLObject(src),
+                                                                AbstractDOMCachingXMLObject(src),
+                                                                AbstractValidatingXMLObject(src)
+                {
+                    init();
+                    setFormat(src.getFormat());
+                    setSPNameQualifier(src.getSPNameQualifier());
+                    AllowCreate(m_AllowCreate);
+                }
+
+                IMPL_XMLOBJECT_CLONE(NameIDPolicy);
+                IMPL_STRING_ATTRIB(Format);
+                IMPL_STRING_ATTRIB(SPNameQualifier);
+                IMPL_BOOLEAN_ATTRIB(AllowCreate);
+
+            protected:
+                void marshallAttributes(DOMElement* domElement) const {
+                    MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
+                    MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
+                    MARSHALL_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,NULL);
+                }
+
+                void processAttribute(const DOMAttr* attribute) {
+                    PROC_STRING_ATTRIB(Format,FORMAT,NULL);
+                    PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
+                    PROC_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,NULL);
+                    AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+                }
+        };
+
+        class SAML_DLLLOCAL IDPEntryImpl : public virtual IDPEntry,
+                                           public AbstractChildlessElement,
+                                           public AbstractDOMCachingXMLObject,
+                                           public AbstractValidatingXMLObject,
+                                           public AbstractXMLObjectMarshaller,
+                                           public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_ProviderID=NULL;
+                m_Name=NULL;
+                m_Loc=NULL;
+            }
+            public:
+                virtual ~IDPEntryImpl()
+                {
+                    XMLString::release(&m_ProviderID);
+                    XMLString::release(&m_Name);
+                    XMLString::release(&m_Loc);
+                }
+
+                IDPEntryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+                {
+                        init();
+                }
+
+                IDPEntryImpl(const IDPEntryImpl& src) : AbstractXMLObject(src),
+                                                                AbstractDOMCachingXMLObject(src),
+                                                                AbstractValidatingXMLObject(src)
+                {
+                    init();
+                    setProviderID(src.getProviderID());
+                    setName(src.getName());
+                    setLoc(src.getLoc());
+                }
+
+                IMPL_XMLOBJECT_CLONE(IDPEntry);
+                IMPL_STRING_ATTRIB(ProviderID);
+                IMPL_STRING_ATTRIB(Name);
+                IMPL_STRING_ATTRIB(Loc);
+
+            protected:
+                void marshallAttributes(DOMElement* domElement) const {
+                    MARSHALL_STRING_ATTRIB(ProviderID,PROVIDERID,NULL);
+                    MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
+                    MARSHALL_STRING_ATTRIB(Loc,LOC,NULL);
+                }
+
+                void processAttribute(const DOMAttr* attribute) {
+                    PROC_STRING_ATTRIB(ProviderID,PROVIDERID,NULL);
+                    PROC_STRING_ATTRIB(Name,NAME,NULL);
+                    PROC_STRING_ATTRIB(Loc,LOC,NULL);
+                    AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+                }
+        };
+
+        class SAML_DLLLOCAL IDPListImpl : public virtual IDPList,
+                                          public AbstractComplexElement,
+                                          public AbstractDOMCachingXMLObject,
+                                          public AbstractValidatingXMLObject,
+                                          public AbstractXMLObjectMarshaller,
+                                          public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_GetComplete=NULL;
+                m_children.push_back(NULL);
+                m_pos_GetComplete=m_children.begin();
+                
+            }
+        public:
+            virtual ~IDPListImpl() { }
+    
+            IDPListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            IDPListImpl(const IDPListImpl& src) : AbstractXMLObject(src),
+                                                  AbstractComplexElement(src),
+                                                  AbstractDOMCachingXMLObject(src),
+                                                  AbstractValidatingXMLObject(src)
+            {
+                init();
+                if (src.getGetComplete())
+                    setGetComplete(src.getGetComplete()->cloneGetComplete());
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        IDPEntry* entry=dynamic_cast<IDPEntry*>(*i);
+                        if (entry) {
+                            getIDPEntrys().push_back(entry->cloneIDPEntry());
+                            continue;
+                        }
+                    }
+                }
+            }
+            
+            IMPL_XMLOBJECT_CLONE(IDPList);
+            IMPL_TYPED_CHILDREN(IDPEntry,m_pos_GetComplete);
+            IMPL_TYPED_CHILD(GetComplete);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_CHILDREN(IDPEntry,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(GetComplete,SAMLConstants::SAML20P_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+        };
+
+
+        class SAML_DLLLOCAL ScopingImpl : public virtual Scoping,
+                                          public AbstractComplexElement,
+                                          public AbstractDOMCachingXMLObject,
+                                          public AbstractValidatingXMLObject,
+                                          public AbstractXMLObjectMarshaller,
+                                          public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_ProxyCount=NULL;
+                m_IDPList=NULL;
+                m_children.push_back(NULL);
+                m_pos_IDPList=m_children.begin();
+                
+            }
+        public:
+            virtual ~ScopingImpl() {
+                XMLString::release(&m_ProxyCount); 
+            }
+    
+            ScopingImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            ScopingImpl(const ScopingImpl& src) : AbstractXMLObject(src),
+                                                  AbstractComplexElement(src),
+                                                  AbstractDOMCachingXMLObject(src),
+                                                  AbstractValidatingXMLObject(src)
+            {
+                init();
+                setProxyCount(m_ProxyCount);
+                if (src.getIDPList())
+                    setIDPList(src.getIDPList()->cloneIDPList());
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        RequesterID* reqid =dynamic_cast<RequesterID*>(*i);
+                        if (reqid) {
+                            getRequesterIDs().push_back(reqid->cloneRequesterID());
+                            continue;
+                        }
+                    }
+                }
+            }
+            
+            IMPL_XMLOBJECT_CLONE(Scoping);
+            IMPL_INTEGER_ATTRIB(ProxyCount);
+            IMPL_TYPED_CHILD(IDPList);
+            IMPL_TYPED_CHILDREN(RequesterID,m_children.end());
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                    MARSHALL_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,NULL);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_CHILD(IDPList,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILDREN(RequesterID,SAMLConstants::SAML20P_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,NULL);
+                AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+            }
+        };
+
+        class SAML_DLLLOCAL AuthnRequestImpl : public virtual AuthnRequest, public RequestImpl
+        {
+            void init() {
+                m_ForceAuthn=XMLConstants::XML_BOOL_NULL;
+                m_IsPassive=XMLConstants::XML_BOOL_NULL;
+                m_ProtocolBinding=NULL;
+                m_AssertionConsumerServiceIndex=NULL;
+                m_AssertionConsumerServiceURL=NULL;
+                m_AttributeConsumingServiceIndex=NULL;
+                m_ProviderName=NULL;
+
+                m_Subject=NULL;
+                m_NameIDPolicy=NULL;
+                m_Conditions=NULL;
+                m_RequestedAuthnContext=NULL;
+                m_Scoping=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_Subject=m_pos_Extensions;
+                ++m_pos_Subject;
+                m_pos_NameIDPolicy=m_pos_Subject;
+                ++m_pos_NameIDPolicy;
+                m_pos_Conditions=m_pos_NameIDPolicy;
+                ++m_pos_Conditions;
+                m_pos_RequestedAuthnContext=m_pos_Conditions;
+                ++m_pos_RequestedAuthnContext;
+                m_pos_Scoping=m_pos_RequestedAuthnContext;
+                ++m_pos_Scoping;
+                
+            }
+        public:
+            virtual ~AuthnRequestImpl() {
+                XMLString::release(&m_ProtocolBinding);
+                XMLString::release(&m_AssertionConsumerServiceURL);
+                XMLString::release(&m_ProviderName);
+                XMLString::release(&m_AssertionConsumerServiceIndex);
+                XMLString::release(&m_AttributeConsumingServiceIndex);
+            }
+    
+            AuthnRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            AuthnRequestImpl(const AuthnRequestImpl& src) : AbstractXMLObject(src),
+                                                            RequestImpl(src)
+            {
+                init();
+
+                ForceAuthn(m_ForceAuthn);
+                IsPassive(m_IsPassive);
+                setProtocolBinding(src.getProtocolBinding());
+                setAssertionConsumerServiceIndex(m_AssertionConsumerServiceIndex);
+                setAssertionConsumerServiceURL(src.getAssertionConsumerServiceURL());
+                setAttributeConsumingServiceIndex(m_AttributeConsumingServiceIndex);
+                setProviderName(src.getProviderName());
+
+                if (src.getSubject())
+                    setSubject(src.getSubject()->cloneSubject());
+                if (src.getNameIDPolicy())
+                    setNameIDPolicy(src.getNameIDPolicy()->cloneNameIDPolicy());
+                if (src.getConditions())
+                    setConditions(src.getConditions()->cloneConditions());
+                if (src.getRequestedAuthnContext())
+                    setRequestedAuthnContext(src.getRequestedAuthnContext()->cloneRequestedAuthnContext());
+                if (src.getScoping())
+                    setScoping(src.getScoping()->cloneScoping());
+            }
+            
+            IMPL_XMLOBJECT_CLONE(AuthnRequest);
+
+            IMPL_BOOLEAN_ATTRIB(ForceAuthn);
+            IMPL_BOOLEAN_ATTRIB(IsPassive);
+            IMPL_STRING_ATTRIB(ProtocolBinding);
+            IMPL_INTEGER_ATTRIB(AssertionConsumerServiceIndex);
+            IMPL_STRING_ATTRIB(AssertionConsumerServiceURL);
+            IMPL_INTEGER_ATTRIB(AttributeConsumingServiceIndex);
+            IMPL_STRING_ATTRIB(ProviderName);
+
+            IMPL_TYPED_FOREIGN_CHILD(Subject,saml2);
+            IMPL_TYPED_CHILD(NameIDPolicy);
+            IMPL_TYPED_FOREIGN_CHILD(Conditions,saml2);
+            IMPL_TYPED_CHILD(RequestedAuthnContext);
+            IMPL_TYPED_CHILD(Scoping);
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                MARSHALL_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,NULL);
+                MARSHALL_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,NULL);
+                MARSHALL_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,NULL);
+                MARSHALL_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,NULL);
+                MARSHALL_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,NULL);
+                MARSHALL_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,NULL);
+                MARSHALL_STRING_ATTRIB(ProviderName,PROVIDERNAME,NULL);
+                RequestImpl::marshallAttributes(domElement);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Conditions,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(Scoping,SAMLConstants::SAML20P_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,NULL);
+                PROC_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,NULL);
+                PROC_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,NULL);
+                PROC_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,NULL);
+                PROC_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,NULL);
+                PROC_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,NULL);
+                PROC_STRING_ATTRIB(ProviderName,PROVIDERNAME,NULL);
+                RequestImpl::processAttribute(attribute);
+            }
+        };
+
+        class SAML_DLLLOCAL StatusResponseImpl : public virtual StatusResponse,
+                                                 public AbstractComplexElement,
+                                                 public AbstractDOMCachingXMLObject,
+                                                 public AbstractValidatingXMLObject,
+                                                 public AbstractXMLObjectMarshaller,
+                                                 public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_ID=NULL;
+                m_InResponseTo=NULL;
+                m_Version=NULL;
+                m_IssueInstant=NULL;
+                m_Destination=NULL;
+                m_Consent=NULL;
+                m_Issuer=NULL;
+                m_Signature=NULL;
+                m_Extensions=NULL;
+                m_Status=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_Issuer=m_children.begin();
+                m_pos_Signature=m_pos_Issuer;
+                ++m_pos_Signature;
+                m_pos_Extensions=m_pos_Signature;
+                ++m_pos_Extensions;
+                m_pos_Status=m_pos_Extensions;
+                ++m_pos_Status;
+            }
+        protected:
+            StatusResponseImpl() {
+                init();
+            }
+        public:
+            virtual ~StatusResponseImpl() {
+                XMLString::release(&m_ID);
+                XMLString::release(&m_InResponseTo);
+                XMLString::release(&m_Version);
+                XMLString::release(&m_Destination);
+                XMLString::release(&m_Consent);
+                delete m_IssueInstant;
+            }
+    
+            StatusResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            StatusResponseImpl(const StatusResponseImpl& src) : AbstractXMLObject(src),
+                                                                AbstractDOMCachingXMLObject(src),
+                                                                AbstractValidatingXMLObject(src)
+            {
+                init();
+                setID(src.getID());
+                setInResponseTo(src.getInResponseTo());
+                setVersion(src.getVersion());
+                setIssueInstant(src.getIssueInstant());
+                setDestination(src.getDestination());
+                setConsent(src.getConsent());
+                if (src.getIssuer())
+                    setIssuer(src.getIssuer()->cloneIssuer());
+                if (src.getSignature())
+                    setSignature(src.getSignature()->cloneSignature());
+                if (src.getExtensions())
+                    setExtensions(src.getExtensions()->cloneExtensions());
+                if (src.getStatus())
+                    setStatus(src.getStatus()->cloneStatus());
+            }
+            
+            const XMLCh* getId() const {
+                return getID();
+            }
+
+            //IMPL_TYPED_CHILD(Signature);
+            // Need customized setter.
+        protected:
+            Signature* m_Signature;
+            list<XMLObject*>::iterator m_pos_Signature;
+        public:
+            Signature* getSignature() const {
+                return m_Signature;
+            }
+            
+            void setSignature(Signature* sig) {
+                prepareForAssignment(m_Signature,sig);
+                *m_pos_Signature=m_Signature=sig;
+                // Sync content reference back up.
+                if (m_Signature)
+                    m_Signature->setContentReference(new opensaml::ContentReference(*this));
+            }
+            
+            IMPL_XMLOBJECT_CLONE(StatusResponse);
+            IMPL_STRING_ATTRIB(Version);
+            IMPL_STRING_ATTRIB(ID);
+            IMPL_STRING_ATTRIB(InResponseTo);
+            IMPL_DATETIME_ATTRIB(IssueInstant);
+            IMPL_STRING_ATTRIB(Destination);
+            IMPL_STRING_ATTRIB(Consent);
+            IMPL_TYPED_FOREIGN_CHILD(Issuer,saml2);
+            IMPL_TYPED_CHILD(Extensions);
+            IMPL_TYPED_CHILD(Status);
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                if (!m_Version)
+                    const_cast<StatusResponseImpl*>(this)->m_Version=XMLString::transcode("2.0");
+                MARSHALL_STRING_ATTRIB(Version,VER,NULL);
+                if (!m_ID)
+                    const_cast<StatusResponseImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
+                MARSHALL_ID_ATTRIB(ID,ID,NULL);
+                if (!m_IssueInstant)
+                    const_cast<StatusResponseImpl*>(this)->m_IssueInstant=new DateTime(time(NULL));
+                MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
+                MARSHALL_STRING_ATTRIB(Destination,DESTINATION,NULL);
+                MARSHALL_STRING_ATTRIB(Consent,CONSENT,NULL);
+                MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
+                PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(Status,SAMLConstants::SAML20P_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+    
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_ID_ATTRIB(ID,ID,NULL);
+                PROC_STRING_ATTRIB(Version,VER,NULL);
+                PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
+                PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
+                PROC_STRING_ATTRIB(Destination,DESTINATION,NULL);
+                PROC_STRING_ATTRIB(Consent,CONSENT,NULL);
+                AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+            }
+        };
+
+        class SAML_DLLLOCAL ResponseImpl : public virtual Response, public StatusResponseImpl
+        {
+        public:
+            virtual ~ResponseImpl() { }
+    
+            ResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+                
+            ResponseImpl(const ResponseImpl& src) : AbstractXMLObject(src),
+                                                    StatusResponseImpl(src)
+            {
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        Assertion* assertion=dynamic_cast<Assertion*>(*i);
+                        if (assertion) {
+                            getAssertions().push_back(assertion->cloneAssertion());
+                            continue;
+                        }
+                        EncryptedAssertion* encAssertion=dynamic_cast<EncryptedAssertion*>(*i);
+                        if (encAssertion) {
+                            getEncryptedAssertions().push_back(encAssertion->cloneEncryptedAssertion());
+                            continue;
+                        }
+                    }
+                }
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(Response);
+            IMPL_TYPED_FOREIGN_CHILDREN(Assertion,saml2,m_children.end());
+            IMPL_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,m_children.end());
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,SAMLConstants::SAML20_NS,false);
+                StatusResponseImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL ArtifactResolveImpl : public virtual ArtifactResolve, public RequestImpl
+        {
+            void init() {
+                m_Artifact=NULL;
+                m_children.push_back(NULL);
+                m_pos_Artifact=m_pos_Extensions;
+                ++m_pos_Artifact;
+            }
+        public:
+            virtual ~ArtifactResolveImpl() { }
+    
+            ArtifactResolveImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            { 
+                init();
+            }
+                
+            ArtifactResolveImpl(const ArtifactResolveImpl& src) : AbstractXMLObject(src),
+                                                                  RequestImpl(src)
+            {
+                init();
+                if(src.getArtifact())
+                    setArtifact(src.getArtifact()->cloneArtifact());
+            }
+            
+            IMPL_XMLOBJECT_CLONE(ArtifactResolve);
+            IMPL_TYPED_CHILD(Artifact);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_CHILD(Artifact,SAMLConstants::SAML20P_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL ArtifactResponseImpl : public virtual ArtifactResponse, public StatusResponseImpl
+        {
+            void init() {
+                m_Payload=NULL;
+                m_children.push_back(NULL);
+                m_pos_Payload=m_pos_Status;
+                ++m_pos_Payload;
+            }
+        public:
+            virtual ~ArtifactResponseImpl() { }
+    
+            ArtifactResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            ArtifactResponseImpl(const ArtifactResponseImpl& src) : AbstractXMLObject(src),
+                                                                    StatusResponseImpl(src)
+            {
+                init();
+                if (src.getPayload())
+                    setPayload(getPayload()->clone());
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(ArtifactResponse);
+            IMPL_XMLOBJECT_CHILD(Payload);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                // These are valid elements for the parent StatusResponse, so don't process these.
+                // If not one of these, then it must be the payload.
+                if (
+                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20_NS,saml2::Issuer::LOCAL_NAME) &&
+                    ! XMLHelper::isNodeNamed(root,XMLConstants::XMLSIG_NS,xmlsignature::Signature::LOCAL_NAME) &&
+                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Extensions::LOCAL_NAME) &&
+                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Status::LOCAL_NAME)
+                   )
+                {
+                    setPayload(childXMLObject);
+                    return;
+                }
+
+                StatusResponseImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL NewEncryptedIDImpl : public virtual NewEncryptedID,
+                                                 public AbstractComplexElement,
+                                                 public AbstractDOMCachingXMLObject,
+                                                 public AbstractValidatingXMLObject,
+                                                 public AbstractXMLObjectMarshaller,
+                                                 public AbstractXMLObjectUnmarshaller
+        {
+            void init() {
+                m_EncryptedData=NULL;
+                m_children.push_back(NULL);
+                m_pos_EncryptedData=m_children.begin();
+            }
+            
+        protected:
+            NewEncryptedIDImpl()
+            {
+                init();
+            }
+            
+        public:
+            virtual ~NewEncryptedIDImpl() {}
+    
+            NewEncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            NewEncryptedIDImpl(const NewEncryptedIDImpl& src)
+                : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src)
+            {
+                init();
+                if (src.getEncryptedData())
+                    setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
+                VectorOf(xmlencryption::EncryptedKey) v=getEncryptedKeys();
+                for (vector<xmlencryption::EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
+                    if (*i) {
+                        v.push_back((*i)->cloneEncryptedKey());
+                    }
+                }
+            }
+    
+            XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
+            {
+                if (!m_EncryptedData)
+                    throw DecryptionException("No encrypted data present.");
+                Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
+                DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
+                if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
+                    DOMNode* plaintext=frag->getFirstChild();
+                    if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
+                        auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
+                        ret->releaseThisAndChildrenDOM();
+                        return ret.release();
+                    }
+                }
+                frag->release();
+                throw DecryptionException("Decryption did not result in a single element.");
+            }
+        
+            IMPL_XMLOBJECT_CLONE(NewEncryptedID);
+            EncryptedElementType* cloneEncryptedElementType() const {
+                return new NewEncryptedIDImpl(*this);
+            }
+
+            IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
+            IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false);
+                AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL TerminateImpl : public virtual Terminate,
+                                            public AbstractChildlessElement,
+                                            public AbstractDOMCachingXMLObject,
+                                            public AbstractValidatingXMLObject,
+                                            public AbstractXMLObjectMarshaller,
+                                            public AbstractXMLObjectUnmarshaller
+        {
+            public:
+                virtual ~TerminateImpl() { }
+
+                TerminateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+
+                TerminateImpl(const TerminateImpl& src) : AbstractXMLObject(src),
+                                                          AbstractDOMCachingXMLObject(src),
+                                                          AbstractValidatingXMLObject(src) { }
+
+                IMPL_XMLOBJECT_CLONE(Terminate);
+
+            protected:
+                // has no attributes or children
+        };
+
+        class SAML_DLLLOCAL ManageNameIDRequestImpl : public virtual ManageNameIDRequest, public RequestImpl
+        {
+            void init() {
+                m_NameID=NULL;
+                m_EncryptedID=NULL;
+                m_NewID=NULL;
+                m_NewEncryptedID=NULL;
+                m_Terminate=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_NameID=m_pos_Extensions;
+                ++m_pos_NameID;
+                m_pos_EncryptedID=m_pos_NameID;
+                ++m_pos_EncryptedID;
+                m_pos_NewID=m_pos_EncryptedID;
+                ++m_pos_NewID;
+                m_pos_NewEncryptedID=m_pos_NewID;
+                ++m_pos_NewEncryptedID;
+                m_pos_Terminate=m_pos_NewEncryptedID;
+                ++m_pos_Terminate;
+                
+            }
+        public:
+            virtual ~ManageNameIDRequestImpl() { }
+    
+            ManageNameIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            ManageNameIDRequestImpl(const ManageNameIDRequestImpl& src) : AbstractXMLObject(src),
+                                                                            RequestImpl(src)
+            {
+                init();
+
+                if (src.getNameID())
+                    setNameID(src.getNameID()->cloneNameID());
+                if (src.getEncryptedID())
+                    setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
+                if (src.getNewID())
+                    setNewID(src.getNewID()->cloneNewID());
+                if (src.getNewEncryptedID())
+                    setNewEncryptedID(src.getNewEncryptedID()->cloneNewEncryptedID());
+                if (src.getTerminate())
+                    setTerminate(src.getTerminate()->cloneTerminate());
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(ManageNameIDRequest);
+
+            IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
+            IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
+            IMPL_TYPED_CHILD(NewID);
+            IMPL_TYPED_CHILD(NewEncryptedID);
+            IMPL_TYPED_CHILD(Terminate);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_CHILD(NewID,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(NewEncryptedID,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(Terminate,SAMLConstants::SAML20P_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL ManageNameIDResponseImpl : public virtual ManageNameIDResponse, public StatusResponseImpl
+        {
+            public:
+                virtual ~ManageNameIDResponseImpl() { }
+    
+                ManageNameIDResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+                
+                ManageNameIDResponseImpl(const ManageNameIDResponseImpl& src) : AbstractXMLObject(src),
+                                                                                StatusResponseImpl(src) { }
+
+                IMPL_XMLOBJECT_CLONE(ManageNameIDResponse);
+        };
+
+        class SAML_DLLLOCAL LogoutRequestImpl : public virtual LogoutRequest, public RequestImpl
+        {
+            void init() {
+                m_Reason=NULL;
+                m_NotOnOrAfter=NULL;
+
+                m_BaseID=NULL;
+                m_NameID=NULL;
+                m_EncryptedID=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_BaseID=m_pos_Extensions;
+                ++m_pos_BaseID;
+                m_pos_NameID=m_pos_BaseID;
+                ++m_pos_NameID;
+                m_pos_EncryptedID=m_pos_NameID;
+                ++m_pos_EncryptedID;
+                
+            }
+        public:
+            virtual ~LogoutRequestImpl() {
+                XMLString::release(&m_Reason);
+                delete m_NotOnOrAfter;
+            }
+    
+            LogoutRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            LogoutRequestImpl(const LogoutRequestImpl& src) : AbstractXMLObject(src),
+                                                              RequestImpl(src)
+            {
+                init();
+
+                setReason(src.getReason());
+                setNotOnOrAfter(src.getNotOnOrAfter());
+
+                if (src.getBaseID())
+                    setBaseID(src.getBaseID()->cloneBaseID());
+                if (src.getNameID())
+                    setNameID(src.getNameID()->cloneNameID());
+                if (src.getEncryptedID())
+                    setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
+
+                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    if (*i) {
+                        SessionIndex* si = dynamic_cast<SessionIndex*>(*i);
+                        if (si) {
+                            getSessionIndexs().push_back(si->cloneSessionIndex());
+                            continue;
+                        }
+                    }
+                }
+            }
+            
+            IMPL_XMLOBJECT_CLONE(LogoutRequest);
+
+            IMPL_STRING_ATTRIB(Reason);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter);
+            IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
+            IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
+            IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
+            IMPL_TYPED_CHILDREN(SessionIndex,m_children.end());
+    
+        protected:
+            void marshallAttributes(DOMElement* domElement) const {
+                MARSHALL_STRING_ATTRIB(Reason,REASON,NULL);
+                MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
+                RequestImpl::marshallAttributes(domElement);
+            }
+    
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_CHILDREN(SessionIndex,SAMLConstants::SAML20P_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+            void processAttribute(const DOMAttr* attribute) {
+                PROC_STRING_ATTRIB(Reason,REASON,NULL);
+                PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
+                RequestImpl::processAttribute(attribute);
+            }
+        };
+
+        class SAML_DLLLOCAL LogoutResponseImpl : public virtual LogoutResponse, public StatusResponseImpl
+        {
+            public:
+                virtual ~LogoutResponseImpl() { }
+    
+                LogoutResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+                
+                LogoutResponseImpl(const LogoutResponseImpl& src) : AbstractXMLObject(src),
+                                                                    StatusResponseImpl(src) { }
+
+                IMPL_XMLOBJECT_CLONE(LogoutResponse);
+        };
+
+
+        class SAML_DLLLOCAL NameIDMappingRequestImpl : public virtual NameIDMappingRequest, public RequestImpl
+        {
+            void init() {
+                m_BaseID=NULL;
+                m_NameID=NULL;
+                m_EncryptedID=NULL;
+                m_NameIDPolicy=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_BaseID=m_pos_Extensions;
+                ++m_pos_BaseID;
+                m_pos_NameID=m_pos_BaseID;
+                ++m_pos_NameID;
+                m_pos_EncryptedID=m_pos_NameID;
+                ++m_pos_EncryptedID;
+                m_pos_NameIDPolicy=m_pos_EncryptedID;
+                ++m_pos_NameIDPolicy;
+                
+            }
+        public:
+            virtual ~NameIDMappingRequestImpl() { }
+    
+            NameIDMappingRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            NameIDMappingRequestImpl(const NameIDMappingRequestImpl& src) : AbstractXMLObject(src),
+                                                                            RequestImpl(src)
+            {
+                init();
+
+                if (src.getBaseID())
+                    setBaseID(src.getBaseID()->cloneBaseID());
+                if (src.getNameID())
+                    setNameID(src.getNameID()->cloneNameID());
+                if (src.getEncryptedID())
+                    setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
+                if (src.getNameIDPolicy())
+                    setNameIDPolicy(src.getNameIDPolicy()->cloneNameIDPolicy());
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(NameIDMappingRequest);
+
+            IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
+            IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
+            IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
+            IMPL_TYPED_CHILD(NameIDPolicy);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
+                RequestImpl::processChildElement(childXMLObject,root);
+            }
+        };
+
+        class SAML_DLLLOCAL NameIDMappingResponseImpl : public virtual NameIDMappingResponse, public StatusResponseImpl
+        {
+            void init() {
+                m_NameID=NULL;
+                m_EncryptedID=NULL;
+                m_children.push_back(NULL);
+                m_children.push_back(NULL);
+                m_pos_NameID=m_pos_Status;
+                ++m_pos_NameID;
+                m_pos_EncryptedID=m_pos_NameID;
+                ++m_pos_EncryptedID;
+            }
+        public:
+            virtual ~NameIDMappingResponseImpl() { }
+    
+            NameIDMappingResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
+            {
+                init();
+            }
+                
+            NameIDMappingResponseImpl(const NameIDMappingResponseImpl& src) : AbstractXMLObject(src),
+                                                                              StatusResponseImpl(src)
+            {
+                init();
+
+                if (src.getNameID())
+                    setNameID(getNameID()->cloneNameID());
+                if (src.getEncryptedID())
+                    setEncryptedID(getEncryptedID()->cloneEncryptedID());
+
+            }
+            
+            IMPL_XMLOBJECT_CLONE(NameIDMappingResponse);
+            IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
+            IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
+    
+        protected:
+            void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
+                StatusResponseImpl::processChildElement(childXMLObject,root);
+            }
+        };
     };
 };
 
@@ -61,6 +1676,132 @@ namespace opensaml {
 #endif
 
 // Builder Implementations
+IMPL_XMLOBJECTBUILDER(Artifact);
+IMPL_XMLOBJECTBUILDER(ArtifactResolve);
+IMPL_XMLOBJECTBUILDER(ArtifactResponse);
+IMPL_XMLOBJECTBUILDER(AssertionIDRequest);
+IMPL_XMLOBJECTBUILDER(AttributeQuery);
+IMPL_XMLOBJECTBUILDER(AuthnQuery);
+IMPL_XMLOBJECTBUILDER(AuthnRequest);
+IMPL_XMLOBJECTBUILDER(AuthzDecisionQuery);
+IMPL_XMLOBJECTBUILDER(Extensions);
+IMPL_XMLOBJECTBUILDER(GetComplete);
+IMPL_XMLOBJECTBUILDER(IDPEntry);
+IMPL_XMLOBJECTBUILDER(IDPList);
+IMPL_XMLOBJECTBUILDER(LogoutRequest);
+IMPL_XMLOBJECTBUILDER(LogoutResponse);
+IMPL_XMLOBJECTBUILDER(ManageNameIDRequest);
+IMPL_XMLOBJECTBUILDER(ManageNameIDResponse);
+IMPL_XMLOBJECTBUILDER(NameIDMappingRequest);
+IMPL_XMLOBJECTBUILDER(NameIDMappingResponse);
+IMPL_XMLOBJECTBUILDER(NameIDPolicy);
+IMPL_XMLOBJECTBUILDER(NewEncryptedID);
+IMPL_XMLOBJECTBUILDER(NewID);
+IMPL_XMLOBJECTBUILDER(RequestedAuthnContext);
+IMPL_XMLOBJECTBUILDER(RequesterID);
+IMPL_XMLOBJECTBUILDER(Response);
+IMPL_XMLOBJECTBUILDER(Scoping);
+IMPL_XMLOBJECTBUILDER(SessionIndex);
+IMPL_XMLOBJECTBUILDER(Status);
+IMPL_XMLOBJECTBUILDER(StatusCode);
+IMPL_XMLOBJECTBUILDER(StatusDetail);
+IMPL_XMLOBJECTBUILDER(StatusMessage);
+IMPL_XMLOBJECTBUILDER(StatusResponse);
+IMPL_XMLOBJECTBUILDER(Terminate);
 
 
 // Unicode literals
+const XMLCh Artifact::LOCAL_NAME[] = UNICODE_LITERAL_8(A,r,t,i,f,a,c,t);
+const XMLCh ArtifactResolve::LOCAL_NAME[] = UNICODE_LITERAL_15(A,r,t,i,f,a,c,t,R,e,s,o,l,v,e);
+const XMLCh ArtifactResolve::TYPE_NAME[] = UNICODE_LITERAL_19(A,r,t,i,f,a,c,t,R,e,s,o,l,v,e,T,y,p,e);
+const XMLCh ArtifactResponse::LOCAL_NAME[] = UNICODE_LITERAL_16(A,r,t,i,f,a,c,t,R,e,s,p,o,n,s,e);
+const XMLCh ArtifactResponse::TYPE_NAME[] = UNICODE_LITERAL_20(A,r,t,i,f,a,c,t,R,e,s,p,o,n,s,e,T,y,p,e);
+const XMLCh AssertionIDRequest::LOCAL_NAME[] = UNICODE_LITERAL_18(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t);
+const XMLCh AssertionIDRequest::TYPE_NAME[] = UNICODE_LITERAL_22(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t,T,y,p,e);
+const XMLCh AttributeQuery::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,Q,u,e,r,y);
+const XMLCh AttributeQuery::TYPE_NAME[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,Q,u,e,r,y,T,y,p,e);
+const XMLCh AuthnQuery::LOCAL_NAME[] = UNICODE_LITERAL_10(A,u,t,h,n,Q,u,e,r,y);
+const XMLCh AuthnQuery::TYPE_NAME[] = UNICODE_LITERAL_14(A,u,t,h,n,Q,u,e,r,y,T,y,p,e);
+const XMLCh AuthnQuery::SESSIONINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
+const XMLCh AuthnRequest::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,R,e,q,u,e,s,t);
+const XMLCh AuthnRequest::TYPE_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,R,e,q,u,e,s,t,T,y,p,e);
+const XMLCh AuthnRequest::FORCEAUTHN_ATTRIB_NAME[] = UNICODE_LITERAL_10(F,o,r,c,e,A,u,t,h,n);
+const XMLCh AuthnRequest::ISPASSIVE_ATTRIB_NAME[] = UNICODE_LITERAL_9(I,s,P,a,s,s,i,v,e);
+const XMLCh AuthnRequest::PROTOCOLBINDING_ATTRIB_NAME[] = UNICODE_LITERAL_15(P,r,o,t,o,c,o,l,B,i,n,d,i,n,g);
+const XMLCh AuthnRequest::ASSERTIONCONSUMERSERVICEINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_29(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e,I,n,d,e,x);
+const XMLCh AuthnRequest::ASSERTIONCONSUMERSERVICEURL_ATTRIB_NAME[] = UNICODE_LITERAL_27(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e,U,R,L);
+const XMLCh AuthnRequest::ATTRIBUTECONSUMINGSERVICEINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_30(A,t,t,r,i,b,u,t,e,C,o,n,s,u,m,i,n,g,S,e,r,v,i,c,e,I,n,d,e,x);
+const XMLCh AuthnRequest::PROVIDERNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(P,r,o,v,i,d,e,r,N,a,m,e);
+const XMLCh AuthzDecisionQuery::LOCAL_NAME[] = UNICODE_LITERAL_18(A,u,t,h,z,D,e,c,i,s,i,o,n,Q,u,e,r,y);
+const XMLCh AuthzDecisionQuery::TYPE_NAME[] = UNICODE_LITERAL_22(A,u,t,h,z,D,e,c,i,s,i,o,n,Q,u,e,r,y,T,y,p,e);
+const XMLCh AuthzDecisionQuery::RESOURCE_ATTRIB_NAME[] = UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
+const XMLCh Extensions::LOCAL_NAME[] = UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
+const XMLCh Extensions::TYPE_NAME[] = UNICODE_LITERAL_14(E,x,t,e,n,s,i,o,n,s,T,y,p,e);
+const XMLCh GetComplete::LOCAL_NAME[] = UNICODE_LITERAL_11(G,e,t,C,o,m,p,l,e,t,e);
+const XMLCh IDPEntry::LOCAL_NAME[] = UNICODE_LITERAL_8(I,D,P,E,n,t,r,y);
+const XMLCh IDPEntry::TYPE_NAME[] = UNICODE_LITERAL_12(I,D,P,E,n,t,r,y,T,y,p,e);
+const XMLCh IDPEntry::PROVIDERID_ATTRIB_NAME[] = UNICODE_LITERAL_10(P,r,o,v,i,d,e,r,I,D);
+const XMLCh IDPEntry::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
+const XMLCh IDPEntry::LOC_ATTRIB_NAME[] = UNICODE_LITERAL_3(L,o,c);
+const XMLCh IDPList::LOCAL_NAME[] = UNICODE_LITERAL_7(I,D,P,L,i,s,t);
+const XMLCh IDPList::TYPE_NAME[] = UNICODE_LITERAL_11(I,D,P,L,i,s,t,T,y,p,e);
+const XMLCh LogoutRequest::LOCAL_NAME[] = UNICODE_LITERAL_13(L,o,g,o,u,t,R,e,q,u,e,s,t);
+const XMLCh LogoutRequest::TYPE_NAME[] = UNICODE_LITERAL_17(L,o,g,o,u,t,R,e,q,u,e,s,t,T,y,p,e);
+const XMLCh LogoutRequest::REASON_ATTRIB_NAME[] = UNICODE_LITERAL_6(R,e,a,s,o,n);
+const XMLCh LogoutRequest::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
+const XMLCh LogoutResponse::LOCAL_NAME[] = UNICODE_LITERAL_14(L,o,g,o,u,t,R,e,s,p,o,n,s,e);
+const XMLCh ManageNameIDRequest::LOCAL_NAME[] = UNICODE_LITERAL_19(M,a,n,a,g,e,N,a,m,e,I,D,R,e,q,u,e,s,t);
+const XMLCh ManageNameIDRequest::TYPE_NAME[] = UNICODE_LITERAL_23(M,a,n,a,g,e,N,a,m,e,I,D,R,e,q,u,e,s,t,T,y,p,e);
+const XMLCh ManageNameIDResponse::LOCAL_NAME[] = UNICODE_LITERAL_20(M,a,n,a,g,e,N,a,m,e,I,D,R,e,s,p,o,n,s,e);
+const XMLCh NameIDMappingRequest::LOCAL_NAME[] = UNICODE_LITERAL_20(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,q,u,e,s,t);
+const XMLCh NameIDMappingRequest::TYPE_NAME[] = UNICODE_LITERAL_24(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,q,u,e,s,t,T,y,p,e);
+const XMLCh NameIDMappingResponse::LOCAL_NAME[] = UNICODE_LITERAL_21(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,s,p,o,n,s,e);
+const XMLCh NameIDMappingResponse::TYPE_NAME[] = UNICODE_LITERAL_25(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,s,p,o,n,s,e,T,y,p,e);
+const XMLCh NameIDPolicy::LOCAL_NAME[] = UNICODE_LITERAL_12(N,a,m,e,I,D,P,o,l,i,c,y);
+const XMLCh NameIDPolicy::TYPE_NAME[] = UNICODE_LITERAL_16(N,a,m,e,I,D,P,o,l,i,c,y,T,y,p,e);
+const XMLCh NameIDPolicy::FORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_6(F,o,r,m,a,t);
+const XMLCh NameIDPolicy::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
+const XMLCh NameIDPolicy::ALLOWCREATE_ATTRIB_NAME[] = UNICODE_LITERAL_11(A,l,l,o,w,C,r,e,a,t,e);
+const XMLCh NewEncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_14(N,e,w,E,n,c,r,y,p,t,e,d,I,D);
+const XMLCh NewID::LOCAL_NAME[] = UNICODE_LITERAL_5(N,e,w,I,D);
+const XMLCh RequesterID::LOCAL_NAME[] = UNICODE_LITERAL_11(R,e,q,u,e,s,t,e,r,I,D);
+const XMLCh RequestedAuthnContext::LOCAL_NAME[] = UNICODE_LITERAL_21(R,e,q,u,e,s,t,e,d,A,u,t,h,n,C,o,n,t,e,x,t);
+const XMLCh RequestedAuthnContext::TYPE_NAME[] = UNICODE_LITERAL_25(R,e,q,u,e,s,t,e,d,A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
+const XMLCh RequestedAuthnContext::COMPARISON_ATTRIB_NAME[] = UNICODE_LITERAL_10(C,o,m,p,a,r,i,s,o,n);
+const XMLCh RequestedAuthnContext::COMPARISON_EXACT[] = UNICODE_LITERAL_5(e,x,a,c,t);
+const XMLCh RequestedAuthnContext::COMPARISON_MINIMUM[] = UNICODE_LITERAL_7(m,i,n,i,m,u,m);
+const XMLCh RequestedAuthnContext::COMPARISON_MAXIMUM[] = UNICODE_LITERAL_7(m,a,x,i,m,u,m);
+const XMLCh RequestedAuthnContext::COMPARISON_BETTER[] = UNICODE_LITERAL_6(b,e,t,t,e,r);
+const XMLCh Request::LOCAL_NAME[] = {chNull};
+const XMLCh Request::TYPE_NAME[] = UNICODE_LITERAL_19(R,e,q,u,e,s,t,A,b,s,t,r,a,c,t,T,y,p,e);
+const XMLCh Request::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
+const XMLCh Request::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
+const XMLCh Request::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
+const XMLCh Request::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
+const XMLCh Request::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
+const XMLCh Response::LOCAL_NAME[] = UNICODE_LITERAL_8(R,e,s,p,o,n,s,e);
+const XMLCh Response::TYPE_NAME[] = UNICODE_LITERAL_12(R,e,s,p,o,n,s,e,T,y,p,e);
+const XMLCh Scoping::LOCAL_NAME[] = UNICODE_LITERAL_7(S,c,o,p,i,n,g);
+const XMLCh Scoping::TYPE_NAME[] = UNICODE_LITERAL_11(S,c,o,p,i,n,g,T,y,p,e);
+const XMLCh Scoping::PROXYCOUNT_ATTRIB_NAME[] = UNICODE_LITERAL_10(P,r,o,x,y,C,o,u,n,t);
+const XMLCh SessionIndex::LOCAL_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
+const XMLCh Status::LOCAL_NAME[] = UNICODE_LITERAL_6(S,t,a,t,u,s);
+const XMLCh Status::TYPE_NAME[] = UNICODE_LITERAL_10(S,t,a,t,u,s,T,y,p,e);
+const XMLCh StatusCode::LOCAL_NAME[] = UNICODE_LITERAL_10(S,t,a,t,u,s,C,o,d,e);
+const XMLCh StatusCode::TYPE_NAME[] = UNICODE_LITERAL_14(S,t,a,t,u,s,C,o,d,e,T,y,p,e);
+const XMLCh StatusCode::VALUE_ATTRIB_NAME[] = UNICODE_LITERAL_5(V,a,l,u,e);
+const XMLCh StatusDetail::LOCAL_NAME[] = UNICODE_LITERAL_12(S,t,a,t,u,s,D,e,t,a,i,l);
+const XMLCh StatusDetail::TYPE_NAME[] = UNICODE_LITERAL_16(S,t,a,t,u,s,D,e,t,a,i,l,T,y,p,e);
+const XMLCh StatusMessage::LOCAL_NAME[] = UNICODE_LITERAL_13(S,t,a,t,u,s,M,e,s,s,a,g,e);
+const XMLCh StatusResponse::LOCAL_NAME[] = {chNull};
+const XMLCh StatusResponse::TYPE_NAME[] = UNICODE_LITERAL_18(S,t,a,t,u,s,R,e,s,p,o,n,s,e,T,y,p,e);
+const XMLCh StatusResponse::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
+const XMLCh StatusResponse::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
+const XMLCh StatusResponse::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
+const XMLCh StatusResponse::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
+const XMLCh StatusResponse::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
+const XMLCh StatusResponse::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
+const XMLCh SubjectQuery::LOCAL_NAME[] = {chNull};
+const XMLCh SubjectQuery::TYPE_NAME[] = UNICODE_LITERAL_16(S,u,b,j,e,c,t,Q,u,e,r,y,T,y,p,e);
+const XMLCh Terminate::LOCAL_NAME[] = UNICODE_LITERAL_9(T,e,r,m,i,n,a,t,e);
+const XMLCh Terminate::TYPE_NAME[] = UNICODE_LITERAL_13(T,e,r,m,i,n,a,t,e,T,y,p,e);
diff --git a/saml/saml2/core/impl/Protocols20SchemaValidators.cpp b/saml/saml2/core/impl/Protocols20SchemaValidators.cpp
new file mode 100644 (file)
index 0000000..22838de
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+*  Copyright 2001-2006 Internet2
+ * 
+* Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Protocols20SchemaValidators.cpp
+ * 
+ * Schema-based validators for SAML 2.0 Protocols classes
+ */
+
+#include "internal.h"
+#include "exceptions.h"
+#include "saml2/core/Protocols.h"
+
+using namespace opensaml::saml2p;
+using namespace opensaml::saml2;
+using namespace opensaml;
+using namespace xmltooling;
+using namespace std;
+
+//TODO add in rules from normative spec document
+
+namespace opensaml {
+    namespace saml2p {
+        
+        XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,Artifact);
+        XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,GetComplete);
+        XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,NewID);
+        XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,RequesterID);
+        XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,SessionIndex);
+        XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,StatusMessage);
+
+        class SAML_DLLLOCAL checkWildcardNS {
+        public:
+            void operator()(const XMLObject* xmlObject) const {
+                const XMLCh* ns=xmlObject->getElementQName().getNamespaceURI();
+                if (XMLString::equals(ns,SAMLConstants::SAML20P_NS) || !ns || !*ns) {
+                    throw ValidationException(
+                        "Object contains an illegal extension child element ($1).",
+                        params(1,xmlObject->getElementQName().toString().c_str())
+                        );
+                }
+            }
+        };
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Extensions);
+            if (!ptr->hasChildren())
+                throw ValidationException("Extensions must have at least one child element.");
+            const list<XMLObject*>& anys=ptr->getXMLObjects();
+            for_each(anys.begin(),anys.end(),checkWildcardNS());
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,StatusCode);
+            XMLOBJECTVALIDATOR_REQUIRE(StatusCode,Value);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Status);
+            XMLOBJECTVALIDATOR_REQUIRE(Status,StatusCode);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,AssertionIDRequest);
+            XMLOBJECTVALIDATOR_REQUIRE(AssertionIDRequest,ID);
+            XMLOBJECTVALIDATOR_REQUIRE(AssertionIDRequest,Version);
+            XMLOBJECTVALIDATOR_REQUIRE(AssertionIDRequest,IssueInstant);
+            XMLOBJECTVALIDATOR_NONEMPTY(AssertionIDRequest,AssertionIDRef);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,RequestedAuthnContext);
+            if (ptr->getAuthnContextClassRefs().empty() && ptr->getAuthnContextDeclRefs().empty())
+                throw xmltooling::ValidationException("RequestedAuthnContext must have at least one AuthnContextClassRef or AuthnContextDeclRef"); 
+            if (!ptr->getAuthnContextClassRefs().empty() && !ptr->getAuthnContextDeclRefs().empty())
+                throw xmltooling::ValidationException("RequestedAuthnContext may not have both AuthnContextClassRef and AuthnContextDeclRef"); 
+            if (!XMLString::equals(ptr->getComparison(),RequestedAuthnContext::COMPARISON_EXACT) &&
+                !XMLString::equals(ptr->getComparison(),RequestedAuthnContext::COMPARISON_MINIMUM) &&
+                !XMLString::equals(ptr->getComparison(),RequestedAuthnContext::COMPARISON_MAXIMUM) &&
+                !XMLString::equals(ptr->getComparison(),RequestedAuthnContext::COMPARISON_BETTER))
+                throw ValidationException("Comparison must be one of: 'exact', 'minimum', 'maximum', or 'better'.");
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,AuthnQuery);
+            XMLOBJECTVALIDATOR_REQUIRE(AuthnQuery,Subject);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,AttributeQuery);
+            XMLOBJECTVALIDATOR_REQUIRE(AttributeQuery,Subject);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,AuthzDecisionQuery);
+            XMLOBJECTVALIDATOR_REQUIRE(AuthzDecisionQuery,Resource);
+            XMLOBJECTVALIDATOR_REQUIRE(AuthzDecisionQuery,Subject);
+            XMLOBJECTVALIDATOR_NONEMPTY(AuthzDecisionQuery,Action);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,IDPEntry);
+            XMLOBJECTVALIDATOR_REQUIRE(IDPEntry,ProviderID);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,IDPList);
+            XMLOBJECTVALIDATOR_NONEMPTY(IDPList,IDPEntry);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Scoping);
+            pair<bool,int> pc = ptr->getProxyCount();
+            if (pc.first && pc.second < 0) 
+                throw xmltooling::ValidationException("ProxyCount attribute on Scoping element must be non-negative"); 
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,AuthnRequest);
+            //TODO no schema, but need spec constraints
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,StatusResponse);
+            XMLOBJECTVALIDATOR_REQUIRE(StatusResponse,Status);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Response);
+            XMLOBJECTVALIDATOR_REQUIRE(Response,Status);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,ArtifactResolve);
+            XMLOBJECTVALIDATOR_REQUIRE(ArtifactResolve,Artifact);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,ArtifactResponse);
+            XMLOBJECTVALIDATOR_REQUIRE(ArtifactResponse,Status);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,NewEncryptedID);
+            XMLOBJECTVALIDATOR_REQUIRE(NewEncryptedID,EncryptedData);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,ManageNameIDRequest);
+            XMLOBJECTVALIDATOR_ONLYONEOF(ManageNameIDRequest,NameID,EncryptedID);
+            XMLOBJECTVALIDATOR_ONLYONEOF3(ManageNameIDRequest,NewID,NewEncryptedID,Terminate);
+        END_XMLOBJECTVALIDATOR;
+
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,ManageNameIDResponse);
+            XMLOBJECTVALIDATOR_REQUIRE(ManageNameIDResponse,Status);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,LogoutRequest);
+            XMLOBJECTVALIDATOR_ONLYONEOF3(LogoutRequest,BaseID,NameID,EncryptedID);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,LogoutResponse);
+            XMLOBJECTVALIDATOR_REQUIRE(LogoutResponse,Status);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,NameIDMappingRequest);
+            XMLOBJECTVALIDATOR_ONLYONEOF3(NameIDMappingRequest,BaseID,NameID,EncryptedID);
+            XMLOBJECTVALIDATOR_REQUIRE(NameIDMappingRequest,NameIDPolicy);
+        END_XMLOBJECTVALIDATOR;
+
+        BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,NameIDMappingResponse);
+            XMLOBJECTVALIDATOR_REQUIRE(NameIDMappingResponse,Status);
+            XMLOBJECTVALIDATOR_ONLYONEOF(NameIDMappingResponse,NameID,EncryptedID);
+        END_XMLOBJECTVALIDATOR;
+
+
+    };
+};
+
+#define REGISTER_ELEMENT(cname) \
+    q=QName(SAMLConstants::SAML20P_NS,cname::LOCAL_NAME); \
+    XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
+    ProtocolSchemaValidators.registerValidator(q,new cname##SchemaValidator())
+    
+#define REGISTER_TYPE(cname) \
+    q=QName(SAMLConstants::SAML20P_NS,cname::TYPE_NAME); \
+    XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
+    ProtocolSchemaValidators.registerValidator(q,new cname##SchemaValidator())
+
+#define REGISTER_ELEMENT_NOVAL(cname) \
+    q=QName(SAMLConstants::SAML20P_NS,cname::LOCAL_NAME); \
+    XMLObjectBuilder::registerBuilder(q,new cname##Builder());
+    
+#define REGISTER_TYPE_NOVAL(cname) \
+    q=QName(SAMLConstants::SAML20P_NS,cname::TYPE_NAME); \
+    XMLObjectBuilder::registerBuilder(q,new cname##Builder());
+
+ValidatorSuite opensaml::saml2p::ProtocolSchemaValidators("ProtocolSchemaValidators");
+
+void opensaml::saml2p::registerProtocolClasses() {
+    QName q;
+    REGISTER_ELEMENT(Artifact);
+    REGISTER_ELEMENT(ArtifactResolve);
+    REGISTER_ELEMENT(ArtifactResponse);
+    REGISTER_ELEMENT(AssertionIDRequest);
+    REGISTER_ELEMENT(AttributeQuery);
+    REGISTER_ELEMENT(AuthnQuery);
+    REGISTER_ELEMENT(AuthnRequest);
+    REGISTER_ELEMENT(AuthzDecisionQuery);
+    REGISTER_ELEMENT(Extensions);
+    REGISTER_ELEMENT(GetComplete);
+    REGISTER_ELEMENT(IDPEntry);
+    REGISTER_ELEMENT(IDPList);
+    REGISTER_ELEMENT(LogoutRequest);
+    REGISTER_ELEMENT(LogoutResponse);
+    REGISTER_ELEMENT(ManageNameIDRequest);
+    REGISTER_ELEMENT(ManageNameIDResponse);
+    REGISTER_ELEMENT(NameIDMappingRequest);
+    REGISTER_ELEMENT(NameIDMappingResponse);
+    REGISTER_ELEMENT_NOVAL(NameIDPolicy);
+    REGISTER_ELEMENT(NewEncryptedID);
+    REGISTER_ELEMENT(NewID);
+    REGISTER_ELEMENT(RequestedAuthnContext);
+    REGISTER_ELEMENT(RequesterID);
+    REGISTER_ELEMENT(Response);
+    REGISTER_ELEMENT(Scoping);
+    REGISTER_ELEMENT(SessionIndex);
+    REGISTER_ELEMENT(Status);
+    REGISTER_ELEMENT(StatusCode);
+    REGISTER_ELEMENT_NOVAL(StatusDetail);
+    REGISTER_ELEMENT(StatusMessage);
+    REGISTER_ELEMENT_NOVAL(Terminate);
+    REGISTER_TYPE(ArtifactResolve);
+    REGISTER_TYPE(ArtifactResponse);
+    REGISTER_TYPE(AssertionIDRequest);
+    REGISTER_TYPE(AttributeQuery);
+    REGISTER_TYPE(AuthnQuery);
+    REGISTER_TYPE(AuthnRequest);
+    REGISTER_TYPE(AuthzDecisionQuery);
+    REGISTER_TYPE(Extensions);
+    REGISTER_TYPE(IDPEntry);
+    REGISTER_TYPE(IDPList);
+    REGISTER_TYPE(LogoutRequest);
+    REGISTER_TYPE(ManageNameIDRequest);
+    REGISTER_TYPE(NameIDMappingRequest);
+    REGISTER_TYPE(NameIDMappingResponse);
+    REGISTER_TYPE_NOVAL(NameIDPolicy);
+    REGISTER_TYPE(RequestedAuthnContext);
+    REGISTER_TYPE(Response);
+    REGISTER_TYPE(Scoping);
+    REGISTER_TYPE(Status);
+    REGISTER_TYPE(StatusCode);
+    REGISTER_TYPE(StatusResponse);
+    REGISTER_TYPE_NOVAL(StatusDetail);
+    REGISTER_TYPE_NOVAL(Terminate);
+}
index 39a97ca..7039371 100644 (file)
@@ -1,3 +1,8 @@
 /Debug
 /*.user
 /*.cpp
+/.deps
+/.libs
+/Makefile
+/Makefile.in
+/samltest
index f7594ae..b959c5a 100644 (file)
@@ -22,7 +22,38 @@ samltest_h = \
     saml1/core/impl/AttributeTest.h \
     saml1/core/impl/AudienceRestrictionConditionTest.h \
     saml1/core/impl/AudienceTest.h \
-    saml1/core/impl/AuthenticationStatementTest.h
+    saml1/core/impl/AuthenticationStatementTest.h \
+    saml2/core/impl/Artifact20Test.h \
+    saml2/core/impl/ArtifactResolve20Test.h \
+    saml2/core/impl/ArtifactResponse20Test.h \
+    saml2/core/impl/AssertionIDRequest20Test.h \
+    saml2/core/impl/AttributeQuery20Test.h \
+    saml2/core/impl/AuthnQuery20Test.h \
+    saml2/core/impl/AuthnRequest20Test.h \
+    saml2/core/impl/AuthzDecisionQuery20Test.h \
+    saml2/core/impl/GetComplete20Test.h \
+    saml2/core/impl/IDPEntry20Test.h \
+    saml2/core/impl/IDPList20Test.h \
+    saml2/core/impl/LogoutRequest20Test.h \
+    saml2/core/impl/LogoutResponse20Test.h \
+    saml2/core/impl/ManageNameIDRequest20Test.h \
+    saml2/core/impl/ManageNameIDResponse20Test.h \
+    saml2/core/impl/NameIDMappingRequest20Test.h \
+    saml2/core/impl/NameIDMappingResponse20Test.h \
+    saml2/core/impl/NameIDPolicy20Test.h \
+    saml2/core/impl/NewEncryptedID20Test.h \
+    saml2/core/impl/NewID20Test.h \
+    saml2/core/impl/RequesterID20Test.h \
+    saml2/core/impl/RequestedAuthnContext20Test.h \
+    saml2/core/impl/Response20Test.h \
+    saml2/core/impl/Scoping20Test.h \
+    saml2/core/impl/SessionIndex20Test.h \
+    saml2/core/impl/Status20Test.h \
+    saml2/core/impl/StatusCode20Test.h \
+    saml2/core/impl/StatusDetail20Test.h \
+    saml2/core/impl/StatusMessage20Test.h \
+    saml2/core/impl/StatusResponse20Test.h\
+    saml2/core/impl/Terminate20Test.h
 
 noinst_HEADERS = \
     internal.h \
index b9779b3..a305b85 100644 (file)
Binary files a/samltest/data/saml2/core/impl/ArtifactResolveChildElements.xml and b/samltest/data/saml2/core/impl/ArtifactResolveChildElements.xml differ
index 182eb13..8223b53 100644 (file)
Binary files a/samltest/data/saml2/core/impl/ArtifactResponseChildElements.xml and b/samltest/data/saml2/core/impl/ArtifactResponseChildElements.xml differ
index 8721282..bcf511e 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AssertionIDRequestChildElements.xml and b/samltest/data/saml2/core/impl/AssertionIDRequestChildElements.xml differ
index e1a94ef..8bf961d 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AttributeQueryChildElements.xml and b/samltest/data/saml2/core/impl/AttributeQueryChildElements.xml differ
index 6e70021..65fa548 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AuthnQueryChildElements.xml and b/samltest/data/saml2/core/impl/AuthnQueryChildElements.xml differ
index 15cb696..490b54a 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AuthnRequest.xml and b/samltest/data/saml2/core/impl/AuthnRequest.xml differ
index e87ac3d..fc29464 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AuthnRequestChildElements.xml and b/samltest/data/saml2/core/impl/AuthnRequestChildElements.xml differ
index 2e79c37..9e9eea1 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AuthnRequestOptionalAttributes.xml and b/samltest/data/saml2/core/impl/AuthnRequestOptionalAttributes.xml differ
index 7db4c65..b264109 100644 (file)
Binary files a/samltest/data/saml2/core/impl/AuthzDecisionQueryChildElements.xml and b/samltest/data/saml2/core/impl/AuthzDecisionQueryChildElements.xml differ
index 5349675..2fef7a2 100644 (file)
Binary files a/samltest/data/saml2/core/impl/LogoutRequestChildElements.xml and b/samltest/data/saml2/core/impl/LogoutRequestChildElements.xml differ
index 731b911..b4d29be 100644 (file)
Binary files a/samltest/data/saml2/core/impl/LogoutResponseChildElements.xml and b/samltest/data/saml2/core/impl/LogoutResponseChildElements.xml differ
index fab47ac..660c94c 100644 (file)
Binary files a/samltest/data/saml2/core/impl/ManageNameIDRequestChildElements.xml and b/samltest/data/saml2/core/impl/ManageNameIDRequestChildElements.xml differ
index 53bebc6..76ca449 100644 (file)
Binary files a/samltest/data/saml2/core/impl/ManageNameIDResponseChildElements.xml and b/samltest/data/saml2/core/impl/ManageNameIDResponseChildElements.xml differ
index 1f9dae7..89e0086 100644 (file)
Binary files a/samltest/data/saml2/core/impl/NameIDMappingRequestChildElements.xml and b/samltest/data/saml2/core/impl/NameIDMappingRequestChildElements.xml differ
index f1b51c6..ad1cdde 100644 (file)
Binary files a/samltest/data/saml2/core/impl/NameIDMappingResponseChildElements.xml and b/samltest/data/saml2/core/impl/NameIDMappingResponseChildElements.xml differ
index 330538c..08e69cb 100644 (file)
Binary files a/samltest/data/saml2/core/impl/NameIDPolicy.xml and b/samltest/data/saml2/core/impl/NameIDPolicy.xml differ
index b2e7868..effbe3f 100644 (file)
Binary files a/samltest/data/saml2/core/impl/NameIDPolicyOptionalAttributes.xml and b/samltest/data/saml2/core/impl/NameIDPolicyOptionalAttributes.xml differ
diff --git a/samltest/data/saml2/core/impl/NewEncryptedID.xml b/samltest/data/saml2/core/impl/NewEncryptedID.xml
new file mode 100644 (file)
index 0000000..82d7d20
Binary files /dev/null and b/samltest/data/saml2/core/impl/NewEncryptedID.xml differ
diff --git a/samltest/data/saml2/core/impl/NewEncryptedIDChildElements.xml b/samltest/data/saml2/core/impl/NewEncryptedIDChildElements.xml
new file mode 100644 (file)
index 0000000..d91405c
Binary files /dev/null and b/samltest/data/saml2/core/impl/NewEncryptedIDChildElements.xml differ
index 3ba323e..9c1577f 100644 (file)
Binary files a/samltest/data/saml2/core/impl/ResponseChildElements.xml and b/samltest/data/saml2/core/impl/ResponseChildElements.xml differ
diff --git a/samltest/data/saml2/core/impl/StatusResponse.xml b/samltest/data/saml2/core/impl/StatusResponse.xml
new file mode 100644 (file)
index 0000000..f49dc40
Binary files /dev/null and b/samltest/data/saml2/core/impl/StatusResponse.xml differ
diff --git a/samltest/data/saml2/core/impl/StatusResponseChildElements.xml b/samltest/data/saml2/core/impl/StatusResponseChildElements.xml
new file mode 100644 (file)
index 0000000..7b5b997
Binary files /dev/null and b/samltest/data/saml2/core/impl/StatusResponseChildElements.xml differ
diff --git a/samltest/data/saml2/core/impl/StatusResponseOptionalAttributes.xml b/samltest/data/saml2/core/impl/StatusResponseOptionalAttributes.xml
new file mode 100644 (file)
index 0000000..a465020
Binary files /dev/null and b/samltest/data/saml2/core/impl/StatusResponseOptionalAttributes.xml differ
diff --git a/samltest/saml2/core/impl/.gitignore b/samltest/saml2/core/impl/.gitignore
new file mode 100644 (file)
index 0000000..e16b497
--- /dev/null
@@ -0,0 +1 @@
+/*.cpp
diff --git a/samltest/saml2/core/impl/Artifact20Test.h b/samltest/saml2/core/impl/Artifact20Test.h
new file mode 100644 (file)
index 0000000..b826c78
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class Artifact20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+    XMLCh* expectedContent;
+
+public:
+    void setUp() {
+        expectedContent=XMLString::transcode("abc123");
+        singleElementFile = data_path + "saml2/core/impl/Artifact.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        XMLString::release(&expectedContent);
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        Artifact* artifact = dynamic_cast<Artifact*>(xo.get());
+        TS_ASSERT(artifact!=NULL);
+        assertEquals("Artifact text content", expectedContent, artifact->getArtifact());
+    }
+
+    void testSingleElementMarshall() {
+        Artifact * artifact = ArtifactBuilder::buildArtifact();
+        artifact->setArtifact(expectedContent);
+        assertEquals(expectedDOM, artifact);
+    }
+
+
+};
diff --git a/samltest/saml2/core/impl/ArtifactResolve20Test.h b/samltest/saml2/core/impl/ArtifactResolve20Test.h
new file mode 100644 (file)
index 0000000..ad2bb4e
--- /dev/null
@@ -0,0 +1,122 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class ArtifactResolve20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/ArtifactResolve.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/ArtifactResolveOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/ArtifactResolveChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        ArtifactResolve* request = dynamic_cast<ArtifactResolve*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("ID attribute", expectedID, request->getID());\r
+        assertEquals("Version attribute", expectedVersion, request->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), request->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getArtifact()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        ArtifactResolve* request = dynamic_cast<ArtifactResolve*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("Consent attribute", expectedConsent, request->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, request->getDestination());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getArtifact()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        ArtifactResolve* request= dynamic_cast<ArtifactResolve*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        TS_ASSERT(request->getIssuer()!=NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getArtifact()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        ArtifactResolve* request=ArtifactResolveBuilder::buildArtifactResolve();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, request);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        ArtifactResolve* request=ArtifactResolveBuilder::buildArtifactResolve();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        request->setConsent(expectedConsent);\r
+        request->setDestination(expectedDestination);\r
+        assertEquals(expectedOptionalAttributesDOM, request);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        ArtifactResolve* request=ArtifactResolveBuilder::buildArtifactResolve();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        request->addNamespace(*ns);\r
+        request->setIssuer(IssuerBuilder::buildIssuer());\r
+        request->setArtifact(ArtifactBuilder::buildArtifact());\r
+        assertEquals(expectedChildElementsDOM, request);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/ArtifactResponse20Test.h b/samltest/saml2/core/impl/ArtifactResponse20Test.h
new file mode 100644 (file)
index 0000000..e01b9f9
--- /dev/null
@@ -0,0 +1,154 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class ArtifactResponse20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedInResponseTo; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+    // The payload will be an AuthnRequest in this test.\r
+    // AuthnRequest marshaller autogenerates ID, Version and IssueInstant if they are NULL,\r
+    // so have to agree on something to put in the control XML\r
+    XMLCh* authnRequestID;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("def456"); \r
+        expectedInResponseTo = XMLString::transcode("abc123"); \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://sp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        authnRequestID = XMLString::transcode("test1"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/ArtifactResponse.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/ArtifactResponseOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/ArtifactResponseChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedInResponseTo);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&authnRequestID);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        ArtifactResponse* response = dynamic_cast<ArtifactResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("ID attribute", expectedID, response->getID());\r
+        assertEquals("Version attribute", expectedVersion, response->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), response->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+        TS_ASSERT(response->getPayload()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        ArtifactResponse* response = dynamic_cast<ArtifactResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, response->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, response->getDestination());\r
+        assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+        TS_ASSERT(response->getPayload()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        ArtifactResponse* response= dynamic_cast<ArtifactResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        TS_ASSERT(response->getIssuer()!=NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()!=NULL);\r
+        TS_ASSERT(response->getPayload()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        ArtifactResponse* response = ArtifactResponseBuilder::buildArtifactResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, response);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        ArtifactResponse* response = ArtifactResponseBuilder::buildArtifactResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        response->setConsent(expectedConsent);\r
+        response->setDestination(expectedDestination);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        assertEquals(expectedOptionalAttributesDOM, response);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        ArtifactResponse* response = ArtifactResponseBuilder::buildArtifactResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        response->addNamespace(*ns);\r
+        response->setIssuer(IssuerBuilder::buildIssuer());\r
+        response->setStatus(StatusBuilder::buildStatus());\r
+\r
+        AuthnRequest* authnRequest = AuthnRequestBuilder::buildAuthnRequest();\r
+        authnRequest->setIssueInstant(expectedIssueInstant);\r
+        authnRequest->setID(authnRequestID);\r
+        response->setPayload(authnRequest);\r
+\r
+        assertEquals(expectedChildElementsDOM, response);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/AssertionIDRequest20Test.h b/samltest/saml2/core/impl/AssertionIDRequest20Test.h
new file mode 100644 (file)
index 0000000..8a6dda1
--- /dev/null
@@ -0,0 +1,124 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class AssertionIDRequest20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/AssertionIDRequest.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/AssertionIDRequestOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/AssertionIDRequestChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        AssertionIDRequest* request = dynamic_cast<AssertionIDRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("ID attribute", expectedID, request->getID());\r
+        assertEquals("Version attribute", expectedVersion, request->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), request->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TSM_ASSERT_EQUALS("# of AssertionIDRef child elements", 0, request->getAssertionIDRefs().size());\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        AssertionIDRequest* request = dynamic_cast<AssertionIDRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("Consent attribute", expectedConsent, request->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, request->getDestination());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TSM_ASSERT_EQUALS("# of AssertionIDRef child elements", 0, request->getAssertionIDRefs().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        AssertionIDRequest* request= dynamic_cast<AssertionIDRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        TS_ASSERT(request->getIssuer()!=NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TSM_ASSERT_EQUALS("# of AssertionIDRef child elements", 3, request->getAssertionIDRefs().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        AssertionIDRequest* request=AssertionIDRequestBuilder::buildAssertionIDRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, request);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        AssertionIDRequest* request=AssertionIDRequestBuilder::buildAssertionIDRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        request->setConsent(expectedConsent);\r
+        request->setDestination(expectedDestination);\r
+        assertEquals(expectedOptionalAttributesDOM, request);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        AssertionIDRequest* request=AssertionIDRequestBuilder::buildAssertionIDRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        request->addNamespace(*ns);\r
+        request->setIssuer(IssuerBuilder::buildIssuer());\r
+        request->getAssertionIDRefs().push_back(AssertionIDRefBuilder::buildAssertionIDRef());\r
+        request->getAssertionIDRefs().push_back(AssertionIDRefBuilder::buildAssertionIDRef());\r
+        request->getAssertionIDRefs().push_back(AssertionIDRefBuilder::buildAssertionIDRef());\r
+        assertEquals(expectedChildElementsDOM, request);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/AttributeQuery20Test.h b/samltest/saml2/core/impl/AttributeQuery20Test.h
new file mode 100644 (file)
index 0000000..7e9e4df
--- /dev/null
@@ -0,0 +1,127 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class AttributeQuery20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/AttributeQuery.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/AttributeQueryOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/AttributeQueryChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        AttributeQuery* query = dynamic_cast<AttributeQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        assertEquals("ID attribute", expectedID, query->getID());\r
+        assertEquals("Version attribute", expectedVersion, query->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), query->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(query->getIssuer()==NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        AttributeQuery* query = dynamic_cast<AttributeQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        assertEquals("Consent attribute", expectedConsent, query->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, query->getDestination());\r
+\r
+        TS_ASSERT(query->getIssuer()==NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        AttributeQuery* query= dynamic_cast<AttributeQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        TS_ASSERT(query->getIssuer()!=NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()!=NULL);\r
+        TSM_ASSERT_EQUALS("# of Attribute child elements", 4, query->getAttributes().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        AttributeQuery* query=AttributeQueryBuilder::buildAttributeQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        //query->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, query);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        AttributeQuery* query=AttributeQueryBuilder::buildAttributeQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        //query->setVersion(expectedVersion);\r
+        query->setConsent(expectedConsent);\r
+        query->setDestination(expectedDestination);\r
+        assertEquals(expectedOptionalAttributesDOM, query);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        AttributeQuery* query=AttributeQueryBuilder::buildAttributeQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        query->addNamespace(*ns);\r
+        query->setIssuer(IssuerBuilder::buildIssuer());\r
+        query->setSubject(SubjectBuilder::buildSubject());\r
+        query->getAttributes().push_back(AttributeBuilder::buildAttribute());\r
+        query->getAttributes().push_back(AttributeBuilder::buildAttribute());\r
+        query->getAttributes().push_back(AttributeBuilder::buildAttribute());\r
+        query->getAttributes().push_back(AttributeBuilder::buildAttribute());\r
+        assertEquals(expectedChildElementsDOM, query);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/AuthnQuery20Test.h b/samltest/saml2/core/impl/AuthnQuery20Test.h
new file mode 100644 (file)
index 0000000..23275bd
--- /dev/null
@@ -0,0 +1,131 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class AuthnQuery20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+    XMLCh* expectedSessionIndex; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+        expectedSessionIndex = XMLString::transcode("session12345"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/AuthnQuery.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/AuthnQueryOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/AuthnQueryChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&expectedSessionIndex);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        AuthnQuery* query = dynamic_cast<AuthnQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        assertEquals("ID attribute", expectedID, query->getID());\r
+        assertEquals("Version attribute", expectedVersion, query->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), query->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(query->getIssuer()==NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()==NULL);\r
+        TS_ASSERT(query->getRequestedAuthnContext()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        AuthnQuery* query = dynamic_cast<AuthnQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        assertEquals("Consent attribute", expectedConsent, query->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, query->getDestination());\r
+        assertEquals("SessionIndex attribute", expectedSessionIndex, query->getSessionIndex());\r
+\r
+        TS_ASSERT(query->getIssuer()==NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()==NULL);\r
+        TS_ASSERT(query->getRequestedAuthnContext()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        AuthnQuery* query= dynamic_cast<AuthnQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        TS_ASSERT(query->getIssuer()!=NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()!=NULL);\r
+        TS_ASSERT(query->getRequestedAuthnContext()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        AuthnQuery* query=AuthnQueryBuilder::buildAuthnQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        //query->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, query);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        AuthnQuery* query=AuthnQueryBuilder::buildAuthnQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        //query->setVersion(expectedVersion);\r
+        query->setConsent(expectedConsent);\r
+        query->setDestination(expectedDestination);\r
+        query->setSessionIndex(expectedSessionIndex);\r
+        assertEquals(expectedOptionalAttributesDOM, query);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        AuthnQuery* query=AuthnQueryBuilder::buildAuthnQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        query->addNamespace(*ns);\r
+        query->setIssuer(IssuerBuilder::buildIssuer());\r
+        query->setSubject(SubjectBuilder::buildSubject());\r
+        query->setRequestedAuthnContext(RequestedAuthnContextBuilder::buildRequestedAuthnContext());\r
+        assertEquals(expectedChildElementsDOM, query);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/AuthnRequest20Test.h b/samltest/saml2/core/impl/AuthnRequest20Test.h
new file mode 100644 (file)
index 0000000..979beac
--- /dev/null
@@ -0,0 +1,182 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class AuthnRequest20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    DateTime* expectedIssueInstant; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    bool expectedForceAuthn; \r
+    bool expectedIsPassive; \r
+    XMLCh* expectedProtocolBinding; \r
+    int expectedAssertionConsumerServiceIndex;\r
+    XMLCh* expectedAssertionConsumerServiceURL; \r
+    int expectedAttributeConsumingServiceIndex;\r
+    XMLCh* expectedProviderName;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedForceAuthn = true;\r
+        expectedIsPassive = true;\r
+        expectedProtocolBinding = XMLString::transcode("urn:string:protocol-binding");\r
+        expectedAssertionConsumerServiceIndex = 3;\r
+        expectedAssertionConsumerServiceURL = XMLString::transcode("http://sp.example.org/acs");\r
+        expectedAttributeConsumingServiceIndex = 2;\r
+        expectedProviderName = XMLString::transcode("Example Org");\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/AuthnRequest.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/AuthnRequestOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/AuthnRequestChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&expectedProtocolBinding);\r
+        XMLString::release(&expectedAssertionConsumerServiceURL);\r
+        XMLString::release(&expectedProviderName);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        AuthnRequest* request = dynamic_cast<AuthnRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("ID attribute", expectedID, request->getID());\r
+        assertEquals("Version attribute", expectedVersion, request->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), request->getIssueInstant()->getFormattedString());\r
+        TSM_ASSERT_EQUALS("ForceAuthn attribute presence", false, request->ForceAuthn().first);\r
+        TSM_ASSERT_EQUALS("IsPassive attribute presence", false, request->IsPassive().first);\r
+        TSM_ASSERT_EQUALS("AssertionConsumerServiceIndex attribute presence",false, request->getAssertionConsumerServiceIndex().first);\r
+        TSM_ASSERT_EQUALS("AttributeConsumingServiceIndex attribute presence", false, request->getAttributeConsumingServiceIndex().first);\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getSubject()==NULL);\r
+        TS_ASSERT(request->getNameIDPolicy()==NULL);\r
+        TS_ASSERT(request->getConditions()==NULL);\r
+        TS_ASSERT(request->getRequestedAuthnContext()==NULL);\r
+        TS_ASSERT(request->getScoping()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        AuthnRequest* request = dynamic_cast<AuthnRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, request->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, request->getDestination());\r
+        TSM_ASSERT_EQUALS("ForceAuthn attribute presence", true, request->ForceAuthn().first);\r
+        TSM_ASSERT_EQUALS("ForceAuthn attribute value", expectedForceAuthn, request->ForceAuthn().second);\r
+        TSM_ASSERT_EQUALS("IsPassive attribute presence", true, request->IsPassive().first);\r
+        TSM_ASSERT_EQUALS("IsPassive attribute value", expectedIsPassive, request->IsPassive().second);\r
+        assertEquals("ProtocolBinding attribute", expectedProtocolBinding,request->getProtocolBinding());\r
+        TSM_ASSERT_EQUALS("AssertionConsumerServiceIndex attribute presence",true, request->getAssertionConsumerServiceIndex().first);\r
+        TSM_ASSERT_EQUALS("AssertionConsumerServiceIndex attribute value",expectedAssertionConsumerServiceIndex, request->getAssertionConsumerServiceIndex().second);\r
+        assertEquals("AssertionConsumerServierURL attribute", expectedAssertionConsumerServiceURL, request->getAssertionConsumerServiceURL());\r
+        TSM_ASSERT_EQUALS("AttributeConsumingServiceIndex attribute presence", true, request->getAttributeConsumingServiceIndex().first);\r
+        TSM_ASSERT_EQUALS("AttributeConsumingServiceIndex attribute value", expectedAttributeConsumingServiceIndex, request->getAttributeConsumingServiceIndex().second);\r
+        assertEquals("ProviderName attribute", expectedProviderName, request->getProviderName());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getSubject()==NULL);\r
+        TS_ASSERT(request->getNameIDPolicy()==NULL);\r
+        TS_ASSERT(request->getConditions()==NULL);\r
+        TS_ASSERT(request->getRequestedAuthnContext()==NULL);\r
+        TS_ASSERT(request->getScoping()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        AuthnRequest* request= dynamic_cast<AuthnRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        TS_ASSERT(request->getIssuer()!=NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getSubject()!=NULL);\r
+        TS_ASSERT(request->getNameIDPolicy()!=NULL);\r
+        TS_ASSERT(request->getConditions()!=NULL);\r
+        TS_ASSERT(request->getRequestedAuthnContext()!=NULL);\r
+        TS_ASSERT(request->getScoping()!=NULL);\r
+        TSM_ASSERT_EQUALS("ForceAuthn attribute presence", false, request->ForceAuthn().first);\r
+        TSM_ASSERT_EQUALS("IsPassive attribute presence", false, request->IsPassive().first);\r
+        TSM_ASSERT_EQUALS("AssertionConsumerServiceIndex attribute presence",false, request->getAssertionConsumerServiceIndex().first);\r
+        TSM_ASSERT_EQUALS("AttributeConsumingServiceIndex attribute presence", false, request->getAttributeConsumingServiceIndex().first);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        AuthnRequest* request=AuthnRequestBuilder::buildAuthnRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, request);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        AuthnRequest* request=AuthnRequestBuilder::buildAuthnRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        request->setConsent(expectedConsent);\r
+        request->setDestination(expectedDestination);\r
+        request->ForceAuthn(expectedForceAuthn);\r
+        request->IsPassive(expectedIsPassive);\r
+        request->setProtocolBinding(expectedProtocolBinding);\r
+        request->setAssertionConsumerServiceIndex(expectedAssertionConsumerServiceIndex);\r
+        request->setAssertionConsumerServiceURL(expectedAssertionConsumerServiceURL);\r
+        request->setAttributeConsumingServiceIndex(expectedAttributeConsumingServiceIndex);\r
+        request->setProviderName(expectedProviderName);\r
+        assertEquals(expectedOptionalAttributesDOM, request);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        AuthnRequest* request=AuthnRequestBuilder::buildAuthnRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        request->addNamespace(*ns);\r
+        request->setIssuer(IssuerBuilder::buildIssuer());\r
+        request->setSubject(SubjectBuilder::buildSubject());\r
+        request->setNameIDPolicy(NameIDPolicyBuilder::buildNameIDPolicy());\r
+        request->setConditions(ConditionsBuilder::buildConditions());\r
+        request->setRequestedAuthnContext(RequestedAuthnContextBuilder::buildRequestedAuthnContext());\r
+        request->setScoping(ScopingBuilder::buildScoping());\r
+        assertEquals(expectedChildElementsDOM, request);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/AuthzDecisionQuery20Test.h b/samltest/saml2/core/impl/AuthzDecisionQuery20Test.h
new file mode 100644 (file)
index 0000000..1e892a8
--- /dev/null
@@ -0,0 +1,137 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class AuthzDecisionQuery20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+    XMLCh* expectedResource; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+        expectedResource = XMLString::transcode("urn:string:resource");\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/AuthzDecisionQuery.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/AuthzDecisionQueryOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/AuthzDecisionQueryChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&expectedResource);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        AuthzDecisionQuery* query = dynamic_cast<AuthzDecisionQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        assertEquals("ID attribute", expectedID, query->getID());\r
+        assertEquals("Version attribute", expectedVersion, query->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), query->getIssueInstant()->getFormattedString());\r
+        assertEquals("Resource attribute", expectedResource, query->getResource());\r
+\r
+        TS_ASSERT(query->getIssuer()==NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()==NULL);\r
+        TSM_ASSERT_EQUALS("# of Action child elements", 0, query->getActions().size());\r
+        TS_ASSERT(query->getEvidence()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        AuthzDecisionQuery* query = dynamic_cast<AuthzDecisionQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        assertEquals("Consent attribute", expectedConsent, query->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, query->getDestination());\r
+\r
+        TS_ASSERT(query->getIssuer()==NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()==NULL);\r
+        TSM_ASSERT_EQUALS("# of Action child elements", 0, query->getActions().size());\r
+        TS_ASSERT(query->getEvidence()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        AuthzDecisionQuery* query= dynamic_cast<AuthzDecisionQuery*>(xo.get());\r
+        TS_ASSERT(query!=NULL);\r
+        TS_ASSERT(query->getIssuer()!=NULL);\r
+        TS_ASSERT(query->getSignature()==NULL);\r
+        TS_ASSERT(query->getExtensions()==NULL);\r
+        TS_ASSERT(query->getSubject()!=NULL);\r
+        TSM_ASSERT_EQUALS("# of Action child elements", 2, query->getActions().size());\r
+        TS_ASSERT(query->getEvidence()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        AuthzDecisionQuery* query=AuthzDecisionQueryBuilder::buildAuthzDecisionQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        //query->setVersion(expectedVersion);\r
+        query->setResource(expectedResource);\r
+        assertEquals(expectedDOM, query);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        AuthzDecisionQuery* query=AuthzDecisionQueryBuilder::buildAuthzDecisionQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        //query->setVersion(expectedVersion);\r
+        query->setConsent(expectedConsent);\r
+        query->setDestination(expectedDestination);\r
+        query->setResource(expectedResource);\r
+        assertEquals(expectedOptionalAttributesDOM, query);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        AuthzDecisionQuery* query=AuthzDecisionQueryBuilder::buildAuthzDecisionQuery();\r
+        query->setID(expectedID);\r
+        query->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        query->addNamespace(*ns);\r
+        query->setIssuer(IssuerBuilder::buildIssuer());\r
+        query->setSubject(SubjectBuilder::buildSubject());\r
+        query->getActions().push_back(ActionBuilder::buildAction());\r
+        query->getActions().push_back(ActionBuilder::buildAction());\r
+        query->setEvidence(EvidenceBuilder::buildEvidence());\r
+        assertEquals(expectedChildElementsDOM, query);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/GetComplete20Test.h b/samltest/saml2/core/impl/GetComplete20Test.h
new file mode 100644 (file)
index 0000000..d50ca98
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class GetComplete20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+    XMLCh* expectedContent;
+
+public:
+    void setUp() {
+        expectedContent=XMLString::transcode("http://sp.example.org/idplist.xml");
+        singleElementFile = data_path + "saml2/core/impl/GetComplete.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        XMLString::release(&expectedContent);
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        GetComplete* gc = dynamic_cast<GetComplete*>(xo.get());
+        TS_ASSERT(gc!=NULL);
+        assertEquals("GetComplete text content", expectedContent, gc->getGetComplete());
+    }
+
+    void testSingleElementMarshall() {
+        GetComplete * gc = GetCompleteBuilder::buildGetComplete();
+        gc->setGetComplete(expectedContent);
+        assertEquals(expectedDOM, gc);
+    }
+
+
+};
diff --git a/samltest/saml2/core/impl/IDPEntry20Test.h b/samltest/saml2/core/impl/IDPEntry20Test.h
new file mode 100644 (file)
index 0000000..f51d740
--- /dev/null
@@ -0,0 +1,77 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class IDPEntry20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedProviderID; \r
+    XMLCh* expectedName; \r
+    XMLCh* expectedLoc;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedProviderID = XMLString::transcode("urn:string:providerid");; \r
+        expectedName = XMLString::transcode("Example IdP"); \r
+        expectedLoc = XMLString::transcode("http://idp.example.org/endpoint"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/IDPEntry.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/IDPEntryOptionalAttributes.xml";\r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedProviderID);\r
+        XMLString::release(&expectedName);\r
+        XMLString::release(&expectedLoc);\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        IDPEntry* entry = dynamic_cast<IDPEntry*>(xo.get());\r
+        TS_ASSERT(entry!=NULL);\r
+        assertEquals("ProviderID attribute", expectedProviderID, entry->getProviderID());\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        IDPEntry* entry = dynamic_cast<IDPEntry*>(xo.get());\r
+        TS_ASSERT(entry!=NULL);\r
+        assertEquals("ProviderID attribute", expectedProviderID, entry->getProviderID());\r
+        assertEquals("Name attribute", expectedName, entry->getName());\r
+        assertEquals("Loc attribute", expectedLoc, entry->getLoc());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        IDPEntry* entry=IDPEntryBuilder::buildIDPEntry();\r
+        entry->setProviderID(expectedProviderID);\r
+        assertEquals(expectedDOM, entry);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        IDPEntry* entry=IDPEntryBuilder::buildIDPEntry();\r
+        entry->setProviderID(expectedProviderID);\r
+        entry->setName(expectedName);\r
+        entry->setLoc(expectedLoc);\r
+        assertEquals(expectedOptionalAttributesDOM, entry);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/IDPList20Test.h b/samltest/saml2/core/impl/IDPList20Test.h
new file mode 100644 (file)
index 0000000..2231829
--- /dev/null
@@ -0,0 +1,68 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class IDPList20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+\r
+public:\r
+    void setUp() {\r
+        singleElementFile = data_path + "saml2/core/impl/IDPList.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/IDPListChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        IDPList* list = dynamic_cast<IDPList*>(xo.get());\r
+        TS_ASSERT(list!=NULL);\r
+\r
+        TS_ASSERT(list->getGetComplete()==NULL);\r
+        TSM_ASSERT_EQUALS("# of IDPEntry child elements", 0, list->getIDPEntrys().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        IDPList* list= dynamic_cast<IDPList*>(xo.get());\r
+        TS_ASSERT(list!=NULL);\r
+        TS_ASSERT(list->getGetComplete()!=NULL);\r
+        TSM_ASSERT_EQUALS("# of IDPEntry child elements", 3, list->getIDPEntrys().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        IDPList* list=IDPListBuilder::buildIDPList();\r
+        assertEquals(expectedDOM, list);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        IDPList* list=IDPListBuilder::buildIDPList();\r
+        list->getIDPEntrys().push_back(IDPEntryBuilder::buildIDPEntry());\r
+        list->getIDPEntrys().push_back(IDPEntryBuilder::buildIDPEntry());\r
+        list->getIDPEntrys().push_back(IDPEntryBuilder::buildIDPEntry());\r
+        list->setGetComplete(GetCompleteBuilder::buildGetComplete());\r
+        assertEquals(expectedChildElementsDOM, list);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/LogoutRequest20Test.h b/samltest/saml2/core/impl/LogoutRequest20Test.h
new file mode 100644 (file)
index 0000000..ab87823
--- /dev/null
@@ -0,0 +1,144 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class LogoutRequest20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    DateTime* expectedIssueInstant; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    XMLCh* expectedReason; \r
+    DateTime* expectedNotOnOrAfter; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+        expectedReason = XMLString::transcode("urn:string:reason"); \r
+        expectedNotOnOrAfter = new DateTime(XMLString::transcode("2006-02-21T20:45:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/LogoutRequest.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/LogoutRequestOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/LogoutRequestChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&expectedReason);\r
+        delete expectedIssueInstant;\r
+        delete expectedNotOnOrAfter;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        LogoutRequest* request = dynamic_cast<LogoutRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("ID attribute", expectedID, request->getID());\r
+        assertEquals("Version attribute", expectedVersion, request->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), request->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getBaseID()==NULL);\r
+        TS_ASSERT(request->getNameID()==NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TSM_ASSERT_EQUALS("# of SessionIndex child elements", 0, request->getSessionIndexs().size());\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        LogoutRequest* request = dynamic_cast<LogoutRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, request->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, request->getDestination());\r
+        assertEquals("Reason attribute", expectedReason, request->getReason());\r
+        assertEquals("NotOnOrAfter attribute", expectedNotOnOrAfter->getFormattedString(), request->getNotOnOrAfter()->getFormattedString());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getBaseID()==NULL);\r
+        TS_ASSERT(request->getNameID()==NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TSM_ASSERT_EQUALS("# of SessionIndex child elements", 0, request->getSessionIndexs().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        LogoutRequest* request= dynamic_cast<LogoutRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        TS_ASSERT(request->getIssuer()!=NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getBaseID()==NULL);\r
+        TS_ASSERT(request->getNameID()!=NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TSM_ASSERT_EQUALS("# of SessionIndex child elements", 2, request->getSessionIndexs().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        LogoutRequest* request=LogoutRequestBuilder::buildLogoutRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, request);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        LogoutRequest* request=LogoutRequestBuilder::buildLogoutRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        request->setConsent(expectedConsent);\r
+        request->setDestination(expectedDestination);\r
+        request->setReason(expectedReason);\r
+        request->setNotOnOrAfter(expectedNotOnOrAfter);\r
+        assertEquals(expectedOptionalAttributesDOM, request);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        LogoutRequest* request=LogoutRequestBuilder::buildLogoutRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        request->addNamespace(*ns);\r
+        request->setIssuer(IssuerBuilder::buildIssuer());\r
+        request->setNameID(NameIDBuilder::buildNameID());\r
+        request->getSessionIndexs().push_back(SessionIndexBuilder::buildSessionIndex());\r
+        request->getSessionIndexs().push_back(SessionIndexBuilder::buildSessionIndex());\r
+        assertEquals(expectedChildElementsDOM, request);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/LogoutResponse20Test.h b/samltest/saml2/core/impl/LogoutResponse20Test.h
new file mode 100644 (file)
index 0000000..40c9a4e
--- /dev/null
@@ -0,0 +1,138 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class LogoutResponse20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedInResponseTo; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("def456"); \r
+        expectedInResponseTo = XMLString::transcode("abc123"); \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://sp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/LogoutResponse.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/LogoutResponseOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/LogoutResponseChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedInResponseTo);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        LogoutResponse* response = dynamic_cast<LogoutResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("ID attribute", expectedID, response->getID());\r
+        assertEquals("Version attribute", expectedVersion, response->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), response->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        LogoutResponse* response = dynamic_cast<LogoutResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, response->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, response->getDestination());\r
+        assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        LogoutResponse* response= dynamic_cast<LogoutResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        TS_ASSERT(response->getIssuer()!=NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        LogoutResponse* response = LogoutResponseBuilder::buildLogoutResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, response);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        LogoutResponse* response = LogoutResponseBuilder::buildLogoutResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        response->setConsent(expectedConsent);\r
+        response->setDestination(expectedDestination);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        assertEquals(expectedOptionalAttributesDOM, response);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        LogoutResponse* response = LogoutResponseBuilder::buildLogoutResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        response->addNamespace(*ns);\r
+        response->setIssuer(IssuerBuilder::buildIssuer());\r
+        response->setStatus(StatusBuilder::buildStatus());\r
+\r
+        assertEquals(expectedChildElementsDOM, response);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/ManageNameIDRequest20Test.h b/samltest/saml2/core/impl/ManageNameIDRequest20Test.h
new file mode 100644 (file)
index 0000000..ad26ac1
--- /dev/null
@@ -0,0 +1,136 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class ManageNameIDRequest20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    DateTime* expectedIssueInstant; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/ManageNameIDRequest.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/ManageNameIDRequestOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/ManageNameIDRequestChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        ManageNameIDRequest* request = dynamic_cast<ManageNameIDRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("ID attribute", expectedID, request->getID());\r
+        assertEquals("Version attribute", expectedVersion, request->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), request->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getNameID()==NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TS_ASSERT(request->getNewID()==NULL);\r
+        TS_ASSERT(request->getNewEncryptedID()==NULL);\r
+        TS_ASSERT(request->getTerminate()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        ManageNameIDRequest* request = dynamic_cast<ManageNameIDRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, request->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, request->getDestination());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getNameID()==NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TS_ASSERT(request->getNewID()==NULL);\r
+        TS_ASSERT(request->getNewEncryptedID()==NULL);\r
+        TS_ASSERT(request->getTerminate()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        ManageNameIDRequest* request= dynamic_cast<ManageNameIDRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        TS_ASSERT(request->getIssuer()!=NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getNameID()!=NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TS_ASSERT(request->getNewID()!=NULL);\r
+        TS_ASSERT(request->getNewEncryptedID()==NULL);\r
+        TS_ASSERT(request->getTerminate()==NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        ManageNameIDRequest* request=ManageNameIDRequestBuilder::buildManageNameIDRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, request);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        ManageNameIDRequest* request=ManageNameIDRequestBuilder::buildManageNameIDRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        request->setConsent(expectedConsent);\r
+        request->setDestination(expectedDestination);\r
+        assertEquals(expectedOptionalAttributesDOM, request);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        ManageNameIDRequest* request=ManageNameIDRequestBuilder::buildManageNameIDRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        request->addNamespace(*ns);\r
+        request->setIssuer(IssuerBuilder::buildIssuer());\r
+        request->setNameID(NameIDBuilder::buildNameID());\r
+        request->setNewID(NewIDBuilder::buildNewID());\r
+        assertEquals(expectedChildElementsDOM, request);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/ManageNameIDResponse20Test.h b/samltest/saml2/core/impl/ManageNameIDResponse20Test.h
new file mode 100644 (file)
index 0000000..d7a9105
--- /dev/null
@@ -0,0 +1,138 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class ManageNameIDResponse20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedInResponseTo; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("def456"); \r
+        expectedInResponseTo = XMLString::transcode("abc123"); \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://sp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/ManageNameIDResponse.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/ManageNameIDResponseOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/ManageNameIDResponseChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedInResponseTo);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        ManageNameIDResponse* response = dynamic_cast<ManageNameIDResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("ID attribute", expectedID, response->getID());\r
+        assertEquals("Version attribute", expectedVersion, response->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), response->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        ManageNameIDResponse* response = dynamic_cast<ManageNameIDResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, response->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, response->getDestination());\r
+        assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        ManageNameIDResponse* response= dynamic_cast<ManageNameIDResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        TS_ASSERT(response->getIssuer()!=NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        ManageNameIDResponse* response = ManageNameIDResponseBuilder::buildManageNameIDResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, response);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        ManageNameIDResponse* response = ManageNameIDResponseBuilder::buildManageNameIDResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        response->setConsent(expectedConsent);\r
+        response->setDestination(expectedDestination);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        assertEquals(expectedOptionalAttributesDOM, response);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        ManageNameIDResponse* response = ManageNameIDResponseBuilder::buildManageNameIDResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        response->addNamespace(*ns);\r
+        response->setIssuer(IssuerBuilder::buildIssuer());\r
+        response->setStatus(StatusBuilder::buildStatus());\r
+\r
+        assertEquals(expectedChildElementsDOM, response);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/NameIDMappingRequest20Test.h b/samltest/saml2/core/impl/NameIDMappingRequest20Test.h
new file mode 100644 (file)
index 0000000..877a0da
--- /dev/null
@@ -0,0 +1,133 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class NameIDMappingRequest20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedVersion; \r
+    DateTime* expectedIssueInstant; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("abc123");; \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://idp.example.org/endpoint"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/NameIDMappingRequest.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/NameIDMappingRequestOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/NameIDMappingRequestChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        NameIDMappingRequest* request = dynamic_cast<NameIDMappingRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        assertEquals("ID attribute", expectedID, request->getID());\r
+        assertEquals("Version attribute", expectedVersion, request->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), request->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getBaseID()==NULL);\r
+        TS_ASSERT(request->getNameID()==NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TS_ASSERT(request->getNameIDPolicy()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        NameIDMappingRequest* request = dynamic_cast<NameIDMappingRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, request->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, request->getDestination());\r
+\r
+        TS_ASSERT(request->getIssuer()==NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getBaseID()==NULL);\r
+        TS_ASSERT(request->getNameID()==NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TS_ASSERT(request->getNameIDPolicy()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        NameIDMappingRequest* request= dynamic_cast<NameIDMappingRequest*>(xo.get());\r
+        TS_ASSERT(request!=NULL);\r
+        TS_ASSERT(request->getIssuer()!=NULL);\r
+        TS_ASSERT(request->getSignature()==NULL);\r
+        TS_ASSERT(request->getExtensions()==NULL);\r
+        TS_ASSERT(request->getBaseID()==NULL);\r
+        TS_ASSERT(request->getNameID()!=NULL);\r
+        TS_ASSERT(request->getEncryptedID()==NULL);\r
+        TS_ASSERT(request->getNameIDPolicy()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        NameIDMappingRequest* request=NameIDMappingRequestBuilder::buildNameIDMappingRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, request);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        NameIDMappingRequest* request=NameIDMappingRequestBuilder::buildNameIDMappingRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        //request->setVersion(expectedVersion);\r
+        request->setConsent(expectedConsent);\r
+        request->setDestination(expectedDestination);\r
+        assertEquals(expectedOptionalAttributesDOM, request);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        NameIDMappingRequest* request=NameIDMappingRequestBuilder::buildNameIDMappingRequest();\r
+        request->setID(expectedID);\r
+        request->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        request->addNamespace(*ns);\r
+        request->setIssuer(IssuerBuilder::buildIssuer());\r
+        request->setNameID(NameIDBuilder::buildNameID());\r
+        request->setNameIDPolicy(NameIDPolicyBuilder::buildNameIDPolicy());\r
+        assertEquals(expectedChildElementsDOM, request);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/NameIDMappingResponse20Test.h b/samltest/saml2/core/impl/NameIDMappingResponse20Test.h
new file mode 100644 (file)
index 0000000..379ee7e
--- /dev/null
@@ -0,0 +1,145 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class NameIDMappingResponse20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedInResponseTo; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("def456"); \r
+        expectedInResponseTo = XMLString::transcode("abc123"); \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://sp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/NameIDMappingResponse.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/NameIDMappingResponseOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/NameIDMappingResponseChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedInResponseTo);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        NameIDMappingResponse* response = dynamic_cast<NameIDMappingResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("ID attribute", expectedID, response->getID());\r
+        assertEquals("Version attribute", expectedVersion, response->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), response->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+        TS_ASSERT(response->getNameID()==NULL);\r
+        TS_ASSERT(response->getEncryptedID()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        NameIDMappingResponse* response = dynamic_cast<NameIDMappingResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, response->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, response->getDestination());\r
+        assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+        TS_ASSERT(response->getNameID()==NULL);\r
+        TS_ASSERT(response->getEncryptedID()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        NameIDMappingResponse* response= dynamic_cast<NameIDMappingResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        TS_ASSERT(response->getIssuer()!=NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()!=NULL);\r
+        TS_ASSERT(response->getNameID()!=NULL);\r
+        TS_ASSERT(response->getEncryptedID()==NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        NameIDMappingResponse* response = NameIDMappingResponseBuilder::buildNameIDMappingResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, response);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        NameIDMappingResponse* response = NameIDMappingResponseBuilder::buildNameIDMappingResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        response->setConsent(expectedConsent);\r
+        response->setDestination(expectedDestination);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        assertEquals(expectedOptionalAttributesDOM, response);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        NameIDMappingResponse* response = NameIDMappingResponseBuilder::buildNameIDMappingResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        response->addNamespace(*ns);\r
+        response->setIssuer(IssuerBuilder::buildIssuer());\r
+        response->setStatus(StatusBuilder::buildStatus());\r
+        response->setNameID(NameIDBuilder::buildNameID());\r
+\r
+        assertEquals(expectedChildElementsDOM, response);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/NameIDPolicy20Test.h b/samltest/saml2/core/impl/NameIDPolicy20Test.h
new file mode 100644 (file)
index 0000000..27418c2
--- /dev/null
@@ -0,0 +1,76 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class NameIDPolicy20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedFormat; \r
+    XMLCh* expectedSPNameQualifier; \r
+    bool expectedAllowCreate;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedFormat = XMLString::transcode("urn:string:format");; \r
+        expectedSPNameQualifier = XMLString::transcode("urn:string:spname"); \r
+        expectedAllowCreate=true;\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/NameIDPolicy.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/NameIDPolicyOptionalAttributes.xml";\r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedFormat);\r
+        XMLString::release(&expectedSPNameQualifier);\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        NameIDPolicy* policy = dynamic_cast<NameIDPolicy*>(xo.get());\r
+        TS_ASSERT(policy!=NULL);\r
+        TSM_ASSERT_EQUALS("AllowCreate attribute presence", false, policy->AllowCreate().first);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        NameIDPolicy* policy = dynamic_cast<NameIDPolicy*>(xo.get());\r
+        TS_ASSERT(policy!=NULL);\r
+        assertEquals("Format attribute", expectedFormat, policy->getFormat());\r
+        assertEquals("SPNameQualifier attribute", expectedSPNameQualifier, policy->getSPNameQualifier());\r
+        TSM_ASSERT_EQUALS("AllowCreate attribute presence", true, policy->AllowCreate().first);\r
+        TSM_ASSERT_EQUALS("AllowCreate attribute value", expectedAllowCreate, policy->AllowCreate().second);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        NameIDPolicy* policy=NameIDPolicyBuilder::buildNameIDPolicy();\r
+        assertEquals(expectedDOM, policy);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        NameIDPolicy* policy=NameIDPolicyBuilder::buildNameIDPolicy();\r
+        policy->setFormat(expectedFormat);\r
+        policy->setSPNameQualifier(expectedSPNameQualifier);\r
+        policy->AllowCreate(expectedAllowCreate);\r
+        assertEquals(expectedOptionalAttributesDOM, policy);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/NewEncryptedID20Test.h b/samltest/saml2/core/impl/NewEncryptedID20Test.h
new file mode 100644 (file)
index 0000000..e9a3ef7
--- /dev/null
@@ -0,0 +1,71 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <xmltooling/encryption/Encryption.h>\r
+#include <xmltooling/util/XMLConstants.h>\r
+\r
+using namespace opensaml;\r
+using namespace opensaml::saml2p;\r
+using namespace xmlencryption;\r
+\r
+class NewEncryptedID20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+\r
+public:\r
+    void setUp() {\r
+        singleElementFile = data_path + "saml2/core/impl/NewEncryptedID.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/NewEncryptedIDChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        NewEncryptedID* encID = dynamic_cast<NewEncryptedID*>(xo.get());\r
+        TS_ASSERT(encID!=NULL);\r
+        TSM_ASSERT("EncryptedData child element", encID->getEncryptedData()==NULL);\r
+        TSM_ASSERT_EQUALS("# of EncryptedKey child elements", 0, encID->getEncryptedKeys().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        NewEncryptedID* encID = dynamic_cast<NewEncryptedID*>(xo.get());\r
+        TS_ASSERT(encID!=NULL);\r
+        TSM_ASSERT("EncryptedData child element", encID->getEncryptedData()!=NULL);\r
+        TSM_ASSERT_EQUALS("# of EncryptedKey child elements", 2, encID->getEncryptedKeys().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        NewEncryptedID* encID=NewEncryptedIDBuilder::buildNewEncryptedID();\r
+        assertEquals(expectedDOM, encID);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        NewEncryptedID* encID=NewEncryptedIDBuilder::buildNewEncryptedID();\r
+        // Do this just so don't have to redeclare the xenc namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(xmltooling::XMLConstants::XMLENC_NS, xmltooling::XMLConstants::XMLENC_PREFIX);\r
+        encID->addNamespace(*ns);\r
+        encID->setEncryptedData(EncryptedDataBuilder::buildEncryptedData());\r
+        encID->getEncryptedKeys().push_back(EncryptedKeyBuilder::buildEncryptedKey());\r
+        encID->getEncryptedKeys().push_back(EncryptedKeyBuilder::buildEncryptedKey());\r
+        assertEquals(expectedChildElementsDOM, encID);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/NewID20Test.h b/samltest/saml2/core/impl/NewID20Test.h
new file mode 100644 (file)
index 0000000..6fa1ed9
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class NewID20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+    XMLCh* expectedContent;
+
+public:
+    void setUp() {
+        expectedContent=XMLString::transcode("SomeSAMLNameID");
+        singleElementFile = data_path + "saml2/core/impl/NewID.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        XMLString::release(&expectedContent);
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        NewID* newid = dynamic_cast<NewID*>(xo.get());
+        TS_ASSERT(newid!=NULL);
+        assertEquals("NewID text content", expectedContent, newid->getNewID());
+    }
+
+    void testSingleElementMarshall() {
+        NewID * newid = NewIDBuilder::buildNewID();
+        newid->setNewID(expectedContent);
+        assertEquals(expectedDOM, newid);
+    }
+
+
+};
diff --git a/samltest/saml2/core/impl/RequestedAuthnContext20Test.h b/samltest/saml2/core/impl/RequestedAuthnContext20Test.h
new file mode 100644 (file)
index 0000000..8695b55
--- /dev/null
@@ -0,0 +1,95 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class RequestedAuthnContext20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedComparison; \r
+\r
+public:\r
+    void setUp() {\r
+        expectedComparison = XMLString::transcode("exact"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/RequestedAuthnContext.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/RequestedAuthnContextOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/RequestedAuthnContextChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedComparison);\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        RequestedAuthnContext* rac = dynamic_cast<RequestedAuthnContext*>(xo.get());\r
+        TS_ASSERT(rac !=NULL);\r
+        TS_ASSERT(rac->getComparison()==NULL);\r
+\r
+        TSM_ASSERT_EQUALS("# of AuthnContextClassRef child elements", 0, rac->getAuthnContextClassRefs().size());\r
+        TSM_ASSERT_EQUALS("# of AuthnContextDeclRef child elements", 0, rac->getAuthnContextDeclRefs().size());\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        RequestedAuthnContext* rac = dynamic_cast<RequestedAuthnContext*>(xo.get());\r
+        TS_ASSERT(rac!=NULL);\r
+        assertEquals("Comparison attribute", expectedComparison, rac->getComparison());\r
+\r
+        TSM_ASSERT_EQUALS("# of AuthnContextClassRef child elements", 0, rac->getAuthnContextClassRefs().size());\r
+        TSM_ASSERT_EQUALS("# of AuthnContextDeclRef child elements", 0, rac->getAuthnContextDeclRefs().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        RequestedAuthnContext* rac = dynamic_cast<RequestedAuthnContext*>(xo.get());\r
+        TS_ASSERT(rac !=NULL);\r
+        TS_ASSERT(rac->getComparison()==NULL);\r
+\r
+        TSM_ASSERT_EQUALS("# of AuthnContextClassRef child elements", 3, rac->getAuthnContextClassRefs().size());\r
+        TSM_ASSERT_EQUALS("# of AuthnContextDeclRef child elements", 0, rac->getAuthnContextDeclRefs().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        RequestedAuthnContext* rac=RequestedAuthnContextBuilder::buildRequestedAuthnContext();\r
+        assertEquals(expectedDOM, rac);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        RequestedAuthnContext* rac=RequestedAuthnContextBuilder::buildRequestedAuthnContext();\r
+        rac->setComparison(expectedComparison);\r
+        assertEquals(expectedOptionalAttributesDOM, rac);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        RequestedAuthnContext* rac=RequestedAuthnContextBuilder::buildRequestedAuthnContext();\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        rac->addNamespace(*ns);\r
+        rac->getAuthnContextClassRefs().push_back(AuthnContextClassRefBuilder::buildAuthnContextClassRef());\r
+        rac->getAuthnContextClassRefs().push_back(AuthnContextClassRefBuilder::buildAuthnContextClassRef());\r
+        rac->getAuthnContextClassRefs().push_back(AuthnContextClassRefBuilder::buildAuthnContextClassRef());\r
+        assertEquals(expectedChildElementsDOM, rac);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/RequesterID20Test.h b/samltest/saml2/core/impl/RequesterID20Test.h
new file mode 100644 (file)
index 0000000..c9f1ccf
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class RequesterID20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+    XMLCh* expectedContent;
+
+public:
+    void setUp() {
+        expectedContent=XMLString::transcode("urn:string:requester");
+        singleElementFile = data_path + "saml2/core/impl/RequesterID.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        XMLString::release(&expectedContent);
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        RequesterID* reqid = dynamic_cast<RequesterID*>(xo.get());
+        TS_ASSERT(reqid!=NULL);
+        assertEquals("RequesterID text content", expectedContent, reqid->getRequesterID());
+    }
+
+    void testSingleElementMarshall() {
+        RequesterID * reqid = RequesterIDBuilder::buildRequesterID();
+        reqid->setRequesterID(expectedContent);
+        assertEquals(expectedDOM, reqid);
+    }
+
+
+};
diff --git a/samltest/saml2/core/impl/Response20Test.h b/samltest/saml2/core/impl/Response20Test.h
new file mode 100644 (file)
index 0000000..8989446
--- /dev/null
@@ -0,0 +1,180 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+\r
+class Response20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedInResponseTo; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+    // Assertion marshaller autogenerates ID, Version and IssueInstant if they are NULL,\r
+    // so have to agree on something to put in the control XML\r
+    XMLCh* assertionID1, * assertionID2, * assertionID3;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("def456"); \r
+        expectedInResponseTo = XMLString::transcode("abc123"); \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://sp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        assertionID1 = XMLString::transcode("test1"); \r
+        assertionID2= XMLString::transcode("test2"); \r
+        assertionID3 = XMLString::transcode("test3"); \r
+\r
+        singleElementFile = data_path + "saml2/core/impl/Response.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/ResponseOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/ResponseChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedInResponseTo);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&assertionID1);\r
+        XMLString::release(&assertionID2);\r
+        XMLString::release(&assertionID3);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        Response* response = dynamic_cast<Response*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("ID attribute", expectedID, response->getID());\r
+        assertEquals("Version attribute", expectedVersion, response->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), response->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+        TSM_ASSERT_EQUALS("# of Assertion child elements", 0, response->getAssertions().size());\r
+        TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 0, response->getEncryptedAssertions().size());\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        Response* response = dynamic_cast<Response*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, response->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, response->getDestination());\r
+        assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+        TSM_ASSERT_EQUALS("# of Assertion child elements", 0, response->getAssertions().size());\r
+        TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 0, response->getEncryptedAssertions().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        Response* response= dynamic_cast<Response*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        TS_ASSERT(response->getIssuer()!=NULL);\r
+        TS_ASSERT(response->getSignature()!=NULL);\r
+        TS_ASSERT(response->getExtensions()!=NULL);\r
+        TS_ASSERT(response->getStatus()!=NULL);\r
+        TSM_ASSERT_EQUALS("# of Assertion child elements", 3, response->getAssertions().size());\r
+        TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 1, response->getEncryptedAssertions().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        Response* response = ResponseBuilder::buildResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, response);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        Response* response = ResponseBuilder::buildResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        response->setConsent(expectedConsent);\r
+        response->setDestination(expectedDestination);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        assertEquals(expectedOptionalAttributesDOM, response);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        Response* response = ResponseBuilder::buildResponse();\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        response->addNamespace(*ns);\r
+        response->setIssuer(IssuerBuilder::buildIssuer());\r
+        // If the form of the default, basic, empty signature that is emittted changes wrt whitespace, etc,\r
+        // this will probably break the test.  In that case need to fix the control XML.\r
+        response->setSignature(xmlsignature::SignatureBuilder::buildSignature());\r
+        response->setExtensions(ExtensionsBuilder::buildExtensions());\r
+        response->setStatus(StatusBuilder::buildStatus());\r
+\r
+        Assertion* assertion=NULL;\r
+\r
+        assertion = AssertionBuilder::buildAssertion();\r
+        assertion->setIssueInstant(expectedIssueInstant);\r
+        assertion->setID(assertionID1);\r
+        response->getAssertions().push_back(assertion);\r
+\r
+        assertion = AssertionBuilder::buildAssertion();\r
+        assertion->setIssueInstant(expectedIssueInstant);\r
+        assertion->setID(assertionID2);\r
+        response->getAssertions().push_back(assertion);\r
+\r
+        response->getEncryptedAssertions().push_back((EncryptedAssertionBuilder::buildEncryptedAssertion()));\r
+\r
+        assertion = AssertionBuilder::buildAssertion();\r
+        assertion->setIssueInstant(expectedIssueInstant);\r
+        assertion->setID(assertionID3);\r
+        response->getAssertions().push_back(assertion);\r
+\r
+\r
+        assertEquals(expectedChildElementsDOM, response);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/Scoping20Test.h b/samltest/saml2/core/impl/Scoping20Test.h
new file mode 100644 (file)
index 0000000..4db0986
--- /dev/null
@@ -0,0 +1,91 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+class Scoping20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    int expectedProxycount;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedProxycount = 5;\r
+        singleElementFile = data_path + "saml2/core/impl/Scoping.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/ScopingOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/ScopingChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        Scoping* scoping = dynamic_cast<Scoping*>(xo.get());\r
+        TS_ASSERT(scoping!=NULL);\r
+\r
+        TSM_ASSERT_EQUALS("ProxyCount attribute presence", false, scoping->getProxyCount().first);\r
+        TS_ASSERT(scoping->getIDPList()==NULL);\r
+        TSM_ASSERT_EQUALS("# of RequesterID child elements", 0, scoping->getRequesterIDs().size());\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        Scoping* scoping = dynamic_cast<Scoping*>(xo.get());\r
+        TS_ASSERT(scoping!=NULL);\r
+\r
+        TSM_ASSERT_EQUALS("ProxyCount attribute presence", true, scoping->getProxyCount().first);\r
+        TSM_ASSERT_EQUALS("ProxyCount attribute value", expectedProxycount, scoping->getProxyCount().second);\r
+        TS_ASSERT(scoping->getIDPList()==NULL);\r
+        TSM_ASSERT_EQUALS("# of RequesterID child elements", 0, scoping->getRequesterIDs().size());\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        Scoping* scoping= dynamic_cast<Scoping*>(xo.get());\r
+        TS_ASSERT(scoping!=NULL);\r
+\r
+        TSM_ASSERT_EQUALS("ProxyCount attribute presence", false, scoping->getProxyCount().first);\r
+        TS_ASSERT(scoping->getIDPList()!=NULL);\r
+        TSM_ASSERT_EQUALS("# of RequesterID child elements", 3, scoping->getRequesterIDs().size());\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        Scoping* scoping=ScopingBuilder::buildScoping();\r
+        assertEquals(expectedDOM, scoping);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        Scoping* scoping=ScopingBuilder::buildScoping();\r
+        scoping->setProxyCount(expectedProxycount);\r
+        assertEquals(expectedOptionalAttributesDOM, scoping);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        Scoping* scoping=ScopingBuilder::buildScoping();\r
+        scoping->setIDPList(IDPListBuilder::buildIDPList());\r
+        scoping->getRequesterIDs().push_back(RequesterIDBuilder::buildRequesterID());\r
+        scoping->getRequesterIDs().push_back(RequesterIDBuilder::buildRequesterID());\r
+        scoping->getRequesterIDs().push_back(RequesterIDBuilder::buildRequesterID());\r
+        assertEquals(expectedChildElementsDOM, scoping);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/SessionIndex20Test.h b/samltest/saml2/core/impl/SessionIndex20Test.h
new file mode 100644 (file)
index 0000000..694522d
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class SessionIndex20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+    XMLCh* expectedContent;
+
+public:
+    void setUp() {
+        expectedContent=XMLString::transcode("Session1234");
+        singleElementFile = data_path + "saml2/core/impl/SessionIndex.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        XMLString::release(&expectedContent);
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        SessionIndex* si = dynamic_cast<SessionIndex*>(xo.get());
+        TS_ASSERT(si!=NULL);
+        assertEquals("SessionIndex text content", expectedContent, si->getSessionIndex());
+    }
+
+    void testSingleElementMarshall() {
+        SessionIndex * si = SessionIndexBuilder::buildSessionIndex();
+        si->setSessionIndex(expectedContent);
+        assertEquals(expectedDOM, si);
+    }
+
+
+};
diff --git a/samltest/saml2/core/impl/Status20Test.h b/samltest/saml2/core/impl/Status20Test.h
new file mode 100644 (file)
index 0000000..da96080
--- /dev/null
@@ -0,0 +1,66 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+\r
+using namespace opensaml::saml2p;\r
+\r
+class Status20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+\r
+public:\r
+    void setUp() {\r
+        singleElementFile = data_path + "saml2/core/impl/Status.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/StatusChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        Status* status = dynamic_cast<Status*>(xo.get());\r
+        TS_ASSERT(status!=NULL);\r
+        TSM_ASSERT("StatusCode child element", status->getStatusCode()==NULL);\r
+        TSM_ASSERT("StatusMessage child element", status->getStatusMessage()==NULL);\r
+        TSM_ASSERT("StatusDetail child element", status->getStatusDetail()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        Status* status = dynamic_cast<Status*>(xo.get());\r
+        TS_ASSERT(status!=NULL);\r
+        TSM_ASSERT("StatusCode child element", status->getStatusCode()!=NULL);\r
+        TSM_ASSERT("StatusMessage child element", status->getStatusMessage()!=NULL);\r
+        TSM_ASSERT("StatusDetail child element", status->getStatusDetail()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        Status* status=StatusBuilder::buildStatus();\r
+        assertEquals(expectedDOM, status);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        Status* status=StatusBuilder::buildStatus();\r
+        status->setStatusCode(StatusCodeBuilder::buildStatusCode());\r
+        status->setStatusMessage(StatusMessageBuilder::buildStatusMessage());\r
+        status->setStatusDetail(StatusDetailBuilder::buildStatusDetail());\r
+        assertEquals(expectedChildElementsDOM, status);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/StatusCode20Test.h b/samltest/saml2/core/impl/StatusCode20Test.h
new file mode 100644 (file)
index 0000000..139d48b
--- /dev/null
@@ -0,0 +1,66 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+\r
+using namespace opensaml::saml2p;\r
+\r
+class StatusCode20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* Value;\r
+\r
+public:\r
+    void setUp() {\r
+        Value=XMLString::transcode("urn:string");\r
+        singleElementFile = data_path + "saml2/core/impl/StatusCode.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/StatusCodeChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&Value);\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        StatusCode* sc = dynamic_cast<StatusCode*>(xo.get());\r
+        TS_ASSERT(sc!=NULL);\r
+        assertEquals("Value attribute", Value, sc->getValue());\r
+        TSM_ASSERT("StatusCode child element", sc->getStatusCode()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        StatusCode* sc = dynamic_cast<StatusCode*>(xo.get());\r
+        TS_ASSERT(sc!=NULL);\r
+        TSM_ASSERT("StatusCode child element", sc->getStatusCode()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        StatusCode* sc=StatusCodeBuilder::buildStatusCode();\r
+        sc->setValue(Value);\r
+        assertEquals(expectedDOM, sc);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        StatusCode* sc=StatusCodeBuilder::buildStatusCode();\r
+        StatusCode* scChild=StatusCodeBuilder::buildStatusCode();\r
+        sc->setStatusCode(scChild);\r
+        assertEquals(expectedChildElementsDOM, sc);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/StatusDetail20Test.h b/samltest/saml2/core/impl/StatusDetail20Test.h
new file mode 100644 (file)
index 0000000..03880ff
--- /dev/null
@@ -0,0 +1,61 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+\r
+using namespace opensaml::saml2p;\r
+\r
+class StatusDetail20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+\r
+public:\r
+    void setUp() {\r
+        singleElementFile = data_path + "saml2/core/impl/StatusDetail.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/StatusDetailChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        StatusDetail* sd= dynamic_cast<StatusDetail*>(xo.get());\r
+        TS_ASSERT(sd!=NULL);\r
+        TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getDetails().size(), 0);\r
+    }\r
+\r
+    //TODO test with some XMLObject child elements from another namespace\r
+    void IGNOREtestChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        StatusDetail* sd= dynamic_cast<StatusDetail*>(xo.get());\r
+        TS_ASSERT(sd!=NULL);\r
+        TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getDetails().size(), 3);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        StatusDetail* sd=StatusDetailBuilder::buildStatusDetail();\r
+        assertEquals(expectedDOM, sd);\r
+    }\r
+\r
+    //TODO test with some XMLObject child elements from another namespace\r
+    void IGNOREtestChildElementsMarshall() {\r
+        StatusDetail* sd=StatusDetailBuilder::buildStatusDetail();\r
+        assertEquals(expectedChildElementsDOM, sd);\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/StatusMessage20Test.h b/samltest/saml2/core/impl/StatusMessage20Test.h
new file mode 100644 (file)
index 0000000..170a3bb
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class StatusMessage20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+    XMLCh* expectedContent;
+
+public:
+    void setUp() {
+        expectedContent=XMLString::transcode("Status Message");
+        singleElementFile = data_path + "saml2/core/impl/StatusMessage.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        XMLString::release(&expectedContent);
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        StatusMessage* sm = dynamic_cast<StatusMessage*>(xo.get());
+        TS_ASSERT(sm!=NULL);
+        assertEquals("StatusMessage text content", expectedContent, sm->getMessage());
+    }
+
+    void testSingleElementMarshall() {
+        StatusMessage * sm = StatusMessageBuilder::buildStatusMessage();
+        sm->setMessage(expectedContent);
+        assertEquals(expectedDOM, sm);
+    }
+
+
+};
diff --git a/samltest/saml2/core/impl/StatusResponse20Test.h b/samltest/saml2/core/impl/StatusResponse20Test.h
new file mode 100644 (file)
index 0000000..834dbd4
--- /dev/null
@@ -0,0 +1,186 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml2/core/Protocols.h>\r
+#include <saml/util/SAMLConstants.h>\r
+\r
+using namespace opensaml::saml2p;\r
+using namespace opensaml::saml2;\r
+\r
+/*\r
+   This tests building an element of type StatusResponseType with a non-SAML element name and namespace\r
+ */\r
+\r
+class StatusResponse20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
+    XMLCh* expectedID; \r
+    XMLCh* expectedInResponseTo; \r
+    XMLCh* expectedVersion; \r
+    XMLCh* expectedConsent; \r
+    XMLCh* expectedDestination; \r
+    DateTime* expectedIssueInstant; \r
+\r
+    //TODO possibly move these up to SAMLObjectBaseTestCase, for use in optional helper methods below\r
+    XMLCh* elementName;\r
+    XMLCh* elementNS;\r
+    XMLCh* elementPrefix;\r
+    const XMLCh* typeName;\r
+    const XMLCh* typeNS;\r
+    const XMLCh* typePrefix;\r
+\r
+public:\r
+    void setUp() {\r
+        expectedID = XMLString::transcode("def456"); \r
+        expectedInResponseTo = XMLString::transcode("abc123"); \r
+        expectedVersion = XMLString::transcode("2.0"); \r
+        expectedConsent = XMLString::transcode("urn:string:consent"); \r
+        expectedDestination = XMLString::transcode("http://sp.example.org/endpoint"); \r
+        expectedIssueInstant = new DateTime(XMLString::transcode("2006-02-21T16:40:00.000Z"));\r
+\r
+        elementName = XMLString::transcode("Foo");;\r
+        elementNS = XMLString::transcode("http://www.example.org/test");\r
+        elementPrefix = XMLString::transcode("test");;\r
+        typeName = StatusResponse::TYPE_NAME;\r
+        typeNS = SAMLConstants::SAML20P_NS;\r
+        typePrefix = SAMLConstants::SAML20P_PREFIX;\r
+\r
+        singleElementFile = data_path + "saml2/core/impl/StatusResponse.xml";\r
+        singleElementOptionalAttributesFile = data_path + "saml2/core/impl/StatusResponseOptionalAttributes.xml";\r
+        childElementsFile  = data_path + "saml2/core/impl/StatusResponseChildElements.xml";    \r
+        SAMLObjectBaseTestCase::setUp();\r
+    }\r
+    \r
+    void tearDown() {\r
+        XMLString::release(&expectedID);\r
+        XMLString::release(&expectedInResponseTo);\r
+        XMLString::release(&expectedVersion);\r
+        XMLString::release(&expectedConsent);\r
+        XMLString::release(&expectedDestination);\r
+        XMLString::release(&elementName);\r
+        XMLString::release(&elementNS);\r
+        XMLString::release(&elementPrefix);\r
+        delete expectedIssueInstant;\r
+        SAMLObjectBaseTestCase::tearDown();\r
+    }\r
+\r
+    //TODO possibly move this functionality up to SAMLObjectBaseTestCase, as optional helper method\r
+    void checkNameAndType(XMLObject* xo) {\r
+        assertEquals("Element name", elementName, xo->getElementQName().getLocalPart());\r
+        assertEquals("Element namespace", elementNS, xo->getElementQName().getNamespaceURI());\r
+        assertEquals("Element namespace prefix", elementPrefix, xo->getElementQName().getPrefix());\r
+\r
+        assertEquals("Schema type name", typeName, xo->getSchemaType()->getLocalPart());\r
+        assertEquals("Schema type namespace", typeNS, xo->getSchemaType()->getNamespaceURI());\r
+        assertEquals("Schema type namespace prefix", typePrefix, xo->getSchemaType()->getPrefix());\r
+    }\r
+\r
+    //TODO possibly move this functionality up to SAMLObjectBaseTestCase, as optional helper method\r
+    XMLObject * buildObject() {\r
+        const XMLObjectBuilder* builder = XMLObjectBuilder::getBuilder(QName(typeNS,typeName));\r
+        QName type(typeNS,typeName,typePrefix);\r
+        return builder->buildObject(elementNS, elementName, elementPrefix, &type);\r
+    }\r
+\r
+    void testSingleElementUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
+        StatusResponse* response = dynamic_cast<StatusResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        checkNameAndType(response);\r
+\r
+        assertEquals("ID attribute", expectedID, response->getID());\r
+        assertEquals("Version attribute", expectedVersion, response->getVersion());\r
+        assertEquals("IssueInstant attribute", expectedIssueInstant->getFormattedString(), response->getIssueInstant()->getFormattedString());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));\r
+        StatusResponse* response = dynamic_cast<StatusResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        checkNameAndType(response);\r
+\r
+        assertEquals("Consent attribute", expectedConsent, response->getConsent());\r
+        assertEquals("Destination attribute", expectedDestination, response->getDestination());\r
+        assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());\r
+\r
+        TS_ASSERT(response->getIssuer()==NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()==NULL);\r
+    }\r
+\r
+    void testChildElementsUnmarshall() {\r
+        auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
+        StatusResponse* response= dynamic_cast<StatusResponse*>(xo.get());\r
+        TS_ASSERT(response!=NULL);\r
+\r
+        checkNameAndType(response);\r
+\r
+        TS_ASSERT(response->getIssuer()!=NULL);\r
+        TS_ASSERT(response->getSignature()==NULL);\r
+        TS_ASSERT(response->getExtensions()==NULL);\r
+        TS_ASSERT(response->getStatus()!=NULL);\r
+    }\r
+\r
+    void testSingleElementMarshall() {\r
+        StatusResponse* response = dynamic_cast<StatusResponse*>(buildObject());\r
+        TS_ASSERT(response!=NULL);\r
+        checkNameAndType(response);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        assertEquals(expectedDOM, response);\r
+    }\r
+\r
+    void testSingleElementOptionalAttributesMarshall() {\r
+        StatusResponse* response = dynamic_cast<StatusResponse*>(buildObject());\r
+        TS_ASSERT(response!=NULL);\r
+        checkNameAndType(response);\r
+\r
+        response->setID(expectedID);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        //response->setVersion(expectedVersion);\r
+        response->setConsent(expectedConsent);\r
+        response->setDestination(expectedDestination);\r
+        response->setInResponseTo(expectedInResponseTo);\r
+        assertEquals(expectedOptionalAttributesDOM, response);\r
+    }\r
+\r
+    void testChildElementsMarshall() {\r
+        StatusResponse* response = dynamic_cast<StatusResponse*>(buildObject());\r
+        TS_ASSERT(response!=NULL);\r
+        checkNameAndType(response);\r
+\r
+        response->setID(expectedID);\r
+        response->setIssueInstant(expectedIssueInstant);\r
+        // Do this just so don't have to redeclare the saml namespace prefix on every child element in the control XML file\r
+        Namespace* ns = new Namespace(opensaml::SAMLConstants::SAML20_NS, opensaml::SAMLConstants::SAML20_PREFIX);\r
+        response->addNamespace(*ns);\r
+        response->setIssuer(IssuerBuilder::buildIssuer());\r
+        response->setStatus(StatusBuilder::buildStatus());\r
+        assertEquals(expectedChildElementsDOM, response);\r
+        delete ns;\r
+    }\r
+\r
+};\r
diff --git a/samltest/saml2/core/impl/Terminate20Test.h b/samltest/saml2/core/impl/Terminate20Test.h
new file mode 100644 (file)
index 0000000..d086094
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "internal.h"
+#include <saml/saml2/core/Protocols.h>
+
+using namespace opensaml::saml2p;
+
+class Terminate20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+
+public:
+    void setUp() {
+        singleElementFile = data_path + "saml2/core/impl/Terminate.xml";
+        SAMLObjectBaseTestCase::setUp();
+    }
+    
+    void tearDown() {
+        SAMLObjectBaseTestCase::tearDown();
+    }
+
+    void testSingleElementUnmarshall() {
+        auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
+        Terminate* terminate = dynamic_cast<Terminate*>(xo.get());
+        TS_ASSERT(terminate!=NULL);
+    }
+
+    void testSingleElementMarshall() {
+        Terminate * terminate = TerminateBuilder::buildTerminate();
+        assertEquals(expectedDOM, terminate);
+    }
+
+
+};
diff --git a/schemas/.gitignore b/schemas/.gitignore
new file mode 100644 (file)
index 0000000..182ce7d
--- /dev/null
@@ -0,0 +1,5 @@
+/Makefile
+/Makefile.in
+/saml10-catalog.xml
+/saml11-catalog.xml
+/saml20-catalog.xml