Change license header, remove stale pkg files.
[shibboleth/cpp-opensaml.git] / samltest / saml2 / core / impl / Response20Test.h
index c833a6a..a33b33b 100644 (file)
@@ -1,22 +1,27 @@
-/*
- *  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
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * UCAID licenses this file to you 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
  *
- * 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.
+ * 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>
 #include <saml/util/SAMLConstants.h>
+#include <xmltooling/signature/Signature.h>
 
 using namespace opensaml::saml2p;
 using namespace opensaml::saml2;
@@ -30,7 +35,7 @@ class Response20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase
     XMLCh* expectedDestination; 
     DateTime* expectedIssueInstant; 
 
-    // Assertion marshaller autogenerates ID, Version and IssueInstant if they are NULL,
+    // Assertion marshaller autogenerates ID, Version and IssueInstant if they are nullptr,
     // so have to agree on something to put in the control XML
     XMLCh* assertionID1, * assertionID2, * assertionID3;
 
@@ -70,16 +75,16 @@ public:
     void testSingleElementUnmarshall() {
         auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
         Response* response = dynamic_cast<Response*>(xo.get());
-        TS_ASSERT(response!=NULL);
+        TS_ASSERT(response!=nullptr);
 
         assertEquals("ID attribute", expectedID, response->getID());
         assertEquals("Version attribute", expectedVersion, response->getVersion());
         TSM_ASSERT_EQUALS("IssueInstant attribute", expectedIssueInstant->getEpoch(), response->getIssueInstant()->getEpoch());
 
-        TS_ASSERT(response->getIssuer()==NULL);
-        TS_ASSERT(response->getSignature()==NULL);
-        TS_ASSERT(response->getExtensions()==NULL);
-        TS_ASSERT(response->getStatus()==NULL);
+        TS_ASSERT(response->getIssuer()==nullptr);
+        TS_ASSERT(response->getSignature()==nullptr);
+        TS_ASSERT(response->getExtensions()==nullptr);
+        TS_ASSERT(response->getStatus()==nullptr);
         TSM_ASSERT_EQUALS("# of Assertion child elements", 0, response->getAssertions().size());
         TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 0, response->getEncryptedAssertions().size());
     }
@@ -87,16 +92,16 @@ public:
     void testSingleElementOptionalAttributesUnmarshall() {
         auto_ptr<XMLObject> xo(unmarshallElement(singleElementOptionalAttributesFile));
         Response* response = dynamic_cast<Response*>(xo.get());
-        TS_ASSERT(response!=NULL);
+        TS_ASSERT(response!=nullptr);
 
         assertEquals("Consent attribute", expectedConsent, response->getConsent());
         assertEquals("Destination attribute", expectedDestination, response->getDestination());
         assertEquals("InResponseTo attribute", expectedInResponseTo, response->getInResponseTo());
 
-        TS_ASSERT(response->getIssuer()==NULL);
-        TS_ASSERT(response->getSignature()==NULL);
-        TS_ASSERT(response->getExtensions()==NULL);
-        TS_ASSERT(response->getStatus()==NULL);
+        TS_ASSERT(response->getIssuer()==nullptr);
+        TS_ASSERT(response->getSignature()==nullptr);
+        TS_ASSERT(response->getExtensions()==nullptr);
+        TS_ASSERT(response->getStatus()==nullptr);
         TSM_ASSERT_EQUALS("# of Assertion child elements", 0, response->getAssertions().size());
         TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 0, response->getEncryptedAssertions().size());
     }
@@ -104,19 +109,19 @@ public:
     void testChildElementsUnmarshall() {
         auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));
         Response* response= dynamic_cast<Response*>(xo.get());
-        TS_ASSERT(response!=NULL);
+        TS_ASSERT(response!=nullptr);
 
-        TS_ASSERT(response->getIssuer()!=NULL);
-        TS_ASSERT(response->getSignature()!=NULL);
-        TS_ASSERT(response->getExtensions()!=NULL);
-        TS_ASSERT(response->getStatus()!=NULL);
+        TS_ASSERT(response->getIssuer()!=nullptr);
+        TS_ASSERT(response->getSignature()!=nullptr);
+        TS_ASSERT(response->getExtensions()!=nullptr);
+        TS_ASSERT(response->getStatus()!=nullptr);
         TSM_ASSERT_EQUALS("# of Assertion child elements", 3, response->getAssertions().size());
         TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 1, response->getEncryptedAssertions().size());
     }
 
     void testSingleElementMarshall() {
         Response* response = ResponseBuilder::buildResponse();
-        TS_ASSERT(response!=NULL);
+        TS_ASSERT(response!=nullptr);
 
         response->setID(expectedID);
         response->setIssueInstant(expectedIssueInstant);
@@ -126,7 +131,7 @@ public:
 
     void testSingleElementOptionalAttributesMarshall() {
         Response* response = ResponseBuilder::buildResponse();
-        TS_ASSERT(response!=NULL);
+        TS_ASSERT(response!=nullptr);
 
         response->setID(expectedID);
         response->setInResponseTo(expectedInResponseTo);
@@ -140,7 +145,7 @@ public:
 
     void testChildElementsMarshall() {
         Response* response = ResponseBuilder::buildResponse();
-        TS_ASSERT(response!=NULL);
+        TS_ASSERT(response!=nullptr);
 
         response->setID(expectedID);
         response->setIssueInstant(expectedIssueInstant);
@@ -154,7 +159,7 @@ public:
         response->setExtensions(ExtensionsBuilder::buildExtensions());
         response->setStatus(StatusBuilder::buildStatus());
 
-        Assertion* assertion=NULL;
+        Assertion* assertion=nullptr;
 
         assertion = AssertionBuilder::buildAssertion();
         assertion->setIssueInstant(expectedIssueInstant);