Author: anil.saldhana(a)jboss.com
Date: 2011-04-04 13:36:38 -0400 (Mon, 04 Apr 2011)
New Revision: 856
Added:
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
Modified:
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
Log:
add test for POST/Sig binding
Modified:
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2011-04-04
17:09:29 UTC (rev 855)
+++
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2011-04-04
17:36:38 UTC (rev 856)
@@ -46,16 +46,17 @@
* @since Apr 8, 2010
*/
public class SAML2PostBindingGlobalLogOutUnitTestCase
-{
+{
+ String SERVICE_1_URL = System.getProperty( "SERVICE_1_URL",
"http://localhost:8080/sales-post/" );
+ String SERVICE_2_URL = System.getProperty( "SERVICE_2_URL",
"http://localhost:8080/employee-post/" );
+ String LOGOUT_URL = "?GLO=true";
+
@Test
public void testSAMLPostBindingGlobalLogOut() throws Exception
{
- String SERVICE_1_URL = System.getProperty( "SERVICE_1_URL",
"http://localhost:8080/sales-post/" );
- String SERVICE_2_URL = System.getProperty( "SERVICE_2_URL",
"http://localhost:8080/employee-post/" );
- String LOGOUT_URL = "?GLO=true";
//Sales Application Login
- WebRequest serviceRequest1 = new GetMethodWebRequest( SERVICE_1_URL );
+ WebRequest serviceRequest1 = new GetMethodWebRequest( getService1URL() );
WebConversation webConversation = new WebConversation();
WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
@@ -69,19 +70,28 @@
assertTrue( " Reached the sales index page ",
webResponse.getText().contains( "SalesTool" ));
//Employee Application Login
- webResponse = webConversation.getResponse( SERVICE_2_URL );
+ webResponse = webConversation.getResponse( getService2URL() );
assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
//Logout from sales
- webResponse = webConversation.getResponse( SERVICE_1_URL + LOGOUT_URL );
+ webResponse = webConversation.getResponse( getService1URL() + LOGOUT_URL );
assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
//Hit the Sales App again
- webResponse = webConversation.getResponse( SERVICE_1_URL );
+ webResponse = webConversation.getResponse( getService1URL() );
assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
//Hit the Employee App again
- webResponse = webConversation.getResponse( SERVICE_2_URL );
+ webResponse = webConversation.getResponse( getService2URL() );
assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
}
-}
+
+ public String getService1URL()
+ {
+ return SERVICE_1_URL;
+ }
+ public String getService2URL()
+ {
+ return SERVICE_2_URL;
+ }
+}
\ No newline at end of file
Added:
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
===================================================================
---
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
(rev 0)
+++
integration-tests/trunk/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java 2011-04-04
17:36:38 UTC (rev 856)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.picketlink.test.integration.saml2;
+
+/**
+ * Unit test the GLO scenarios involving two endpoints with SAML2 Post
+ * and Signature binding
+ * @author anil saldhana
+ */
+public class SAML2PostSignatureGLOUnitTestCase extends
SAML2PostBindingGlobalLogOutUnitTestCase
+{
+ String SERVICE_5_URL = System.getProperty( "SERVICE_3_URL",
"http://localhost:8080/sales-post-sig/" );
+ String SERVICE_6_URL = System.getProperty( "SERVICE_4_URL",
"http://localhost:8080/employee-post-sig/" );
+ @Override
+ public String getService1URL()
+ {
+ return SERVICE_5_URL;
+ }
+ @Override
+ public String getService2URL()
+ {
+ return SERVICE_6_URL;
+ }
+}
\ No newline at end of file