-/*
- * 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;
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;
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());
}
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());
}
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);
void testSingleElementOptionalAttributesMarshall() {
Response* response = ResponseBuilder::buildResponse();
- TS_ASSERT(response!=NULL);
+ TS_ASSERT(response!=nullptr);
response->setID(expectedID);
response->setInResponseTo(expectedInResponseTo);
void testChildElementsMarshall() {
Response* response = ResponseBuilder::buildResponse();
- TS_ASSERT(response!=NULL);
+ TS_ASSERT(response!=nullptr);
response->setID(expectedID);
response->setIssueInstant(expectedIssueInstant);
response->setExtensions(ExtensionsBuilder::buildExtensions());
response->setStatus(StatusBuilder::buildStatus());
- Assertion* assertion=NULL;
+ Assertion* assertion=nullptr;
assertion = AssertionBuilder::buildAssertion();
assertion->setIssueInstant(expectedIssueInstant);