[jboss-cvs] Picketlink SVN: r202 - in federation/trunk: picketlink-fed-tests and 10 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Apr 9 11:44:21 EDT 2010
Author: anil.saldhana at jboss.com
Date: 2010-04-09 11:44:21 -0400 (Fri, 09 Apr 2010)
New Revision: 202
Added:
federation/trunk/picketlink-fed-tests/
federation/trunk/picketlink-fed-tests/.classpath
federation/trunk/picketlink-fed-tests/.project
federation/trunk/picketlink-fed-tests/.settings/
federation/trunk/picketlink-fed-tests/.settings/org.eclipse.jdt.core.prefs
federation/trunk/picketlink-fed-tests/pom.xml
federation/trunk/picketlink-fed-tests/src/
federation/trunk/picketlink-fed-tests/src/test/
federation/trunk/picketlink-fed-tests/src/test/java/
federation/trunk/picketlink-fed-tests/src/test/java/org/
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
federation/trunk/picketlink-fed-tests/src/test/resources/
Log:
integration tests
Property changes on: federation/trunk/picketlink-fed-tests
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Added: federation/trunk/picketlink-fed-tests/.classpath
===================================================================
--- federation/trunk/picketlink-fed-tests/.classpath (rev 0)
+++ federation/trunk/picketlink-fed-tests/.classpath 2010-04-09 15:44:21 UTC (rev 202)
@@ -0,0 +1,11 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var" path="M2_REPO/net/sf/httpunit/1.7.0/httpunit-1.7.0.jar" sourcepath="M2_REPO/net/sf/httpunit/1.7.0/httpunit-1.7.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/rhino/js/1.6R7/js-1.6R7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/1.9.12/nekohtml-1.9.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+</classpath>
\ No newline at end of file
Added: federation/trunk/picketlink-fed-tests/.project
===================================================================
--- federation/trunk/picketlink-fed-tests/.project (rev 0)
+++ federation/trunk/picketlink-fed-tests/.project 2010-04-09 15:44:21 UTC (rev 202)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>picketlink-fed-tests</name>
+ <comment>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Property changes on: federation/trunk/picketlink-fed-tests/.settings
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Added: federation/trunk/picketlink-fed-tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- federation/trunk/picketlink-fed-tests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ federation/trunk/picketlink-fed-tests/.settings/org.eclipse.jdt.core.prefs 2010-04-09 15:44:21 UTC (rev 202)
@@ -0,0 +1,5 @@
+#Thu Apr 08 09:45:56 CDT 2010
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: federation/trunk/picketlink-fed-tests/pom.xml
===================================================================
--- federation/trunk/picketlink-fed-tests/pom.xml (rev 0)
+++ federation/trunk/picketlink-fed-tests/pom.xml 2010-04-09 15:44:21 UTC (rev 202)
@@ -0,0 +1,109 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-fed-parent</artifactId>
+ <version>1.0.3.CR2-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>picketlink-fed-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>PicketLink Federation Tests</name>
+ <url>http://labs.jboss.org/portal/picketlink/</url>
+ <description>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <properties>
+ <java.endorsed.dirs>${basedir}/src/test/resources/endorsed</java.endorsed.dirs>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>false</testFailureIgnore>
+ <includes>
+ <include>**/**TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <argLine>-Djava.endorsed.dirs=${basedir}/src/test/resources/endorsed</argLine>
+ <useFile>false</useFile>
+ <trimStackTrace>false</trimStackTrace>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.7.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.6R7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+ -link http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Property changes on: federation/trunk/picketlink-fed-tests/src
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test/java
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test/java/org
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Property changes on: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
Added: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java (rev 0)
+++ federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2010-04-09 15:44:21 UTC (rev 202)
@@ -0,0 +1,87 @@
+/*
+ * 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.picketlink.test.integration.saml2;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.SubmitButton;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+/**
+ * <p>
+ * Unit test the SAML2 Global Log Out scenarios.
+ * </p>
+ * <p>
+ * <b>Note:</b> This test expects that a set of endpoints that are configured
+ * for the test are available. You may have to start web containers offline
+ * for the endpoints to be live.
+ * </p>
+ *
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 8, 2010
+ */
+public class SAML2PostBindingGlobalLogOutUnitTestCase
+{
+ @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 );
+ WebConversation webConversation = new WebConversation();
+
+ WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
+ WebForm loginForm = webResponse.getForms()[0];
+ loginForm.setParameter("j_username", "manager" );
+ loginForm.setParameter("j_password", "tomcat" );
+ SubmitButton submitButton = loginForm.getSubmitButtons()[0];
+ submitButton.click();
+
+ webResponse = webConversation.getCurrentPage();
+ assertTrue( " Reached the sales index page ", webResponse.getText().contains( "SalesTool" ));
+
+ //Employee Application Login
+ webResponse = webConversation.getResponse( SERVICE_2_URL );
+ assertTrue( " Reached the employee index page ", webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Logout from sales
+ webResponse = webConversation.getResponse( SERVICE_1_URL + LOGOUT_URL );
+ assertTrue( "Reached logged out page", webResponse.getText().contains( "logged" ) );
+
+ //Hit the Sales App again
+ webResponse = webConversation.getResponse( SERVICE_1_URL );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains( "Login" ));
+
+ //Hit the Employee App again
+ webResponse = webConversation.getResponse( SERVICE_2_URL );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains( "Login" ));
+ }
+}
\ No newline at end of file
Added: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java (rev 0)
+++ federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java 2010-04-09 15:44:21 UTC (rev 202)
@@ -0,0 +1,87 @@
+/*
+ * 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.picketlink.test.integration.saml2;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.SubmitButton;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+/**
+ * <p>
+ * Unit test the SAML2 Global Log Out scenarios.
+ * </p>
+ * <p>
+ * <b>Note:</b> This test expects that a set of endpoints that are configured
+ * for the test are available. You may have to start web containers offline
+ * for the endpoints to be live.
+ * </p>
+ *
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 8, 2010
+ */
+public class SAML2RedirectBindingGlobalLogOutUnitTestCase
+{
+ @Test
+ public void testSAMLRedirectBindingGLO() throws Exception
+ {
+ String SERVICE_1_URL = System.getProperty( "SERVICE_1_URL", "http://localhost:8080/sales/" );
+ String SERVICE_2_URL = System.getProperty( "SERVICE_2_URL", "http://localhost:8080/employee/" );
+ String LOGOUT_URL = "?GLO=true";
+
+ //Sales Application Login
+ WebRequest serviceRequest1 = new GetMethodWebRequest( SERVICE_1_URL );
+ WebConversation webConversation = new WebConversation();
+
+ WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
+ WebForm loginForm = webResponse.getForms()[0];
+ loginForm.setParameter("j_username", "manager" );
+ loginForm.setParameter("j_password", "tomcat" );
+ SubmitButton submitButton = loginForm.getSubmitButtons()[0];
+ submitButton.click();
+
+ webResponse = webConversation.getCurrentPage();
+ assertTrue( " Reached the sales index page ", webResponse.getText().contains( "SalesTool" ));
+
+ //Employee Application Login
+ webResponse = webConversation.getResponse( SERVICE_2_URL );
+ assertTrue( " Reached the employee index page ", webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Logout from sales
+ webResponse = webConversation.getResponse( SERVICE_1_URL + LOGOUT_URL );
+ assertTrue( "Reached logged out page", webResponse.getText().contains( "logged" ) );
+
+ //Hit the Sales App again
+ webResponse = webConversation.getResponse( SERVICE_1_URL );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains( "Login" ));
+
+ //Hit the Employee App again
+ webResponse = webConversation.getResponse( SERVICE_2_URL );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains( "Login" ));
+ }
+}
\ No newline at end of file
Property changes on: federation/trunk/picketlink-fed-tests/src/test/resources
___________________________________________________________________
Name: svn:ignore
+ target
target-eclipse
eclipse-target
.classpath
.project
.settings
More information about the jboss-cvs-commits
mailing list