Author: anil.saldhana(a)jboss.com
Date: 2008-12-11 10:28:53 -0500 (Thu, 11 Dec 2008)
New Revision: 146
Added:
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnResponseUnitTestCase.java
Modified:
identity-federation/trunk/identity-fed-api/.classpath
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnRequestUnitTestCase.java
Log:
test updates
Modified: identity-federation/trunk/identity-fed-api/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-api/.classpath 2008-12-11 15:28:09 UTC (rev
145)
+++ identity-federation/trunk/identity-fed-api/.classpath 2008-12-11 15:28:53 UTC (rev
146)
@@ -8,5 +8,7 @@
<classpathentry combineaccessrules="false" kind="src"
path="/identity-fed-model"/>
<classpathentry kind="var"
path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
<classpathentry kind="var"
path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"/>
<classpathentry kind="output" path="target-eclipse"/>
</classpath>
Modified:
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnRequestUnitTestCase.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnRequestUnitTestCase.java 2008-12-11
15:28:09 UTC (rev 145)
+++
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnRequestUnitTestCase.java 2008-12-11
15:28:53 UTC (rev 146)
@@ -85,6 +85,9 @@
RequestedAuthnContextType requestedAuthnContext =
authnRequestType.getRequestedAuthnContext();
assertEquals(
"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
,requestedAuthnContext.getAuthnContextClassRef().get(0));
+
+ //Let us marshall it back to System out
+ JBossSAMLAuthnRequestFactory.marshall(authnRequestType, System.out);
}
/**
@@ -101,5 +104,9 @@
SignatureType signatureType = authnRequestType.getSignature();
assertNotNull("Signature is not null", signatureType);
+
+ //Let us marshall it back to System out
+ System.out.println(" ");
+ JBossSAMLAuthnRequestFactory.marshall(authnRequestType, System.out);
}
}
\ No newline at end of file
Added:
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnResponseUnitTestCase.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnResponseUnitTestCase.java
(rev 0)
+++
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SAML2AuthnResponseUnitTestCase.java 2008-12-11
15:28:53 UTC (rev 146)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.identity.federation.api.saml.v2;
+
+import
org.jboss.identity.federation.api.saml.v2.factories.JBossSAMLAuthnResponseFactory;
+import org.jboss.identity.federation.api.saml.v2.factories.JBossSAMLBaseFactory;
+import org.jboss.identity.federation.saml.v2.jboss.IDPInfoHolder;
+import org.jboss.identity.federation.saml.v2.jboss.IssuerInfoHolder;
+import org.jboss.identity.federation.saml.v2.jboss.JBossSAMLURIConstants;
+import org.jboss.identity.federation.saml.v2.jboss.SPInfoHolder;
+import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Unit Test the SAML2 Authn Response factory
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Dec 9, 2008
+ */
+public class SAML2AuthnResponseUnitTestCase extends TestCase
+{
+
+ public void testResponseTypeCreation() throws Exception
+ {
+ IssuerInfoHolder issuerHolder = new IssuerInfoHolder("http://idp");
+ issuerHolder.setStatusCode(JBossSAMLURIConstants.STATUS_SUCCESS.get());
+
+ IDPInfoHolder idp = new IDPInfoHolder();
+ idp.setNameIDFormatValue(JBossSAMLBaseFactory.createUUID().toString());
+
+ ResponseType rt =
JBossSAMLAuthnResponseFactory.createResponseType("response111",
+ new SPInfoHolder(), idp, issuerHolder);
+ assertNotNull(rt);
+
+ JBossSAMLAuthnResponseFactory.marshall(rt, System.out);
+ }
+}
\ No newline at end of file