Picketlink SVN: r274 - federation/trunk/picketlink-webapps/picketlink-sts/src/main/webapp/WEB-INF.
by picketlink-commits@lists.jboss.org
Author: sguilhen(a)redhat.com
Date: 2010-06-04 09:29:50 -0400 (Fri, 04 Jun 2010)
New Revision: 274
Modified:
federation/trunk/picketlink-webapps/picketlink-sts/src/main/webapp/WEB-INF/web.xml
Log:
SOA-2105: fixed PicketLink sample application web.xml. Security is now applied to all HTTP methods.
Modified: federation/trunk/picketlink-webapps/picketlink-sts/src/main/webapp/WEB-INF/web.xml
===================================================================
--- federation/trunk/picketlink-webapps/picketlink-sts/src/main/webapp/WEB-INF/web.xml 2010-06-04 00:26:28 UTC (rev 273)
+++ federation/trunk/picketlink-webapps/picketlink-sts/src/main/webapp/WEB-INF/web.xml 2010-06-04 13:29:50 UTC (rev 274)
@@ -17,8 +17,6 @@
<web-resource-collection>
<web-resource-name>UsernameService</web-resource-name>
<url-pattern>/*</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
14 years, 6 months
Picketlink SVN: r273 - in federation/trunk/picketlink-fed-tests: src/test/java/org/picketlink/test/integration/saml2 and 6 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2010-06-03 20:26:28 -0400 (Thu, 03 Jun 2010)
New Revision: 273
Added:
federation/trunk/picketlink-fed-tests/ant-build.xml
federation/trunk/picketlink-fed-tests/src/test/resources/jbossas/
federation/trunk/picketlink-fed-tests/src/test/resources/jbossas/5.1.0.GA/
federation/trunk/picketlink-fed-tests/src/test/resources/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip
federation/trunk/picketlink-fed-tests/src/test/resources/scripts/
federation/trunk/picketlink-fed-tests/src/test/resources/scripts/stopjboss.sh
federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/
federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/6.0.26/
federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/6.0.26/apache-tomcat-6.0.26.zip
federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/log4j.xml
federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/tomcat-users.xml
Modified:
federation/trunk/picketlink-fed-tests/pom.xml
federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
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
Log:
start on integration testing on jbas, tomcat
Added: federation/trunk/picketlink-fed-tests/ant-build.xml
===================================================================
--- federation/trunk/picketlink-fed-tests/ant-build.xml (rev 0)
+++ federation/trunk/picketlink-fed-tests/ant-build.xml 2010-06-04 00:26:28 UTC (rev 273)
@@ -0,0 +1,96 @@
+<project default="init" name="PicketLink Federation Integration Test Suite">
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath path="${depclasspath}"/>
+ </taskdef>
+ <property name="JBAS_DEPLOY" location="${basedir}/target/jboss-5.1.0.GA/server/default/deploy/" />
+ <property name="TOMCAT" location="${basedir}/target/apache-tomcat-6.0.26/" />
+ <property name="TOMCAT_DEPLOY" location="${basedir}/target/apache-tomcat-6.0.26/webapps/" />
+ <property name="TOMCAT_LIB" location="${basedir}/target/apache-tomcat-6.0.26/lib/" />
+ <property environment="env" />
+
+ <target name="init-jboss">
+ <!-- Unzip JBoss AS and Tomcat -->
+ <echo>Unzip JBOSS AS 5.1.0.GA</echo>
+ <unzip src="${basedir}/src/test/resources/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip"
+ dest="${basedir}/target"/>
+ </target>
+ <target name="init-tomcat">
+ <echo>Unzip Apache Tomcat 6.0.26</echo>
+ <unzip src="${basedir}/src/test/resources/tomcat/6.0.26/apache-tomcat-6.0.26.zip"
+ dest="${basedir}/target"/>
+ </target>
+
+
+ <target name="tomcat-thirdparty-deps" depends="init-tomcat" >
+ <copy file="${localRepository}/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" todir="${TOMCAT_LIB}"/>
+ </target>
+
+ <target name="copy-picketlink-tomcat" depends="tomcat-thirdparty-deps" >
+ <copy file="../picketlink-bindings/target/picketlink-bindings-${version}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="../picketlink-bindings-jboss/target/picketlink-bindings-jboss-${version}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="../assembly/target/picketlink-fed-${version}.jar" todir="${TOMCAT_LIB}"/>
+
+ <unzip src="../picketlink-webapps/assembly/target/picketlink-fed-webapps-assembly-${version}.zip"
+ dest="${TOMCAT_DEPLOY}"/>
+
+ <move todir="${TOMCAT_DEPLOY}">
+ <fileset dir="${TOMCAT_DEPLOY}/picketlink">
+ <include name="**/*.war"/>
+ </fileset>
+ </move>
+
+ <copy file="${basedir}/src/test/resources/tomcat/tomcat-users.xml"
+ todir="${TOMCAT}/conf" />
+ <copy file="${basedir}/src/test/resources/tomcat/log4j.xml"
+ todir="${TOMCAT}/lib" />
+ <chmod dir="${basedir}/target/apache-tomcat-6.0.26/bin" perm="700" includes="**/*.sh"/>
+ <chmod dir="${basedir}/target/apache-tomcat-6.0.26/bin" perm="700" includes="**/*.jar"/>
+ </target>
+
+ <target name="copy-picketlink-jbas" depends="init-jboss" >
+ <mkdir dir="${basedir}/target/jboss-5.1.0.GA/server/default/deploy/picketlink" />
+ <copy file="../picketlink-bindings/target/picketlink-bindings-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="../picketlink-bindings-jboss/target/picketlink-bindings-jboss-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="../assembly/target/picketlink-fed-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <unzip src="../picketlink-webapps/assembly/target/picketlink-fed-webapps-assembly-${version}.zip"
+ dest="${JBAS_DEPLOY}"/>
+
+ <chmod file="${basedir}/target/jboss-5.1.0.GA/bin/run.sh" perm="700"/>
+ </target>
+
+ <target name="start-jboss" depends="copy-picketlink-jbas" >
+ <echo>Starting Local 8080 </echo>
+ <exec executable="${basedir}/target/jboss-5.1.0.GA/bin/run.sh"
+ osfamily="unix" spawn="true" />
+ <waitfor maxwait="1" maxwaitunit="minute"
+ checkevery="100" checkeveryunit="millisecond">
+ <http url="http://localhost:8080" />
+ </waitfor>
+ <echo>:Local 8080 Started</echo>
+ </target>
+
+ <target name="start-tomcat" depends="copy-picketlink-tomcat" >
+ <echo>Starting Local 8080 </echo>
+ <exec executable="${TOMCAT_DEPLOY}/../bin/startup.sh"
+ osfamily="unix" spawn="true" />
+ <waitfor maxwait="25" maxwaitunit="second"
+ checkevery="100" checkeveryunit="millisecond">
+ <http url="http://localhost:8080" />
+ </waitfor>
+ <echo>:Local 8080 Started</echo>
+ </target>
+
+ <target name="stop-jboss">
+ <echo>Stopping Local 8080 </echo>
+ <echo>Going to Kill the JBoss Process</echo>
+ <exec executable="${basedir}/src/test/resources/scripts/stopjboss.sh"
+ osfamily="unix" />
+ </target>
+
+ <target name="stop-tomcat">
+ <echo>Stopping Local 8080 </echo>
+ <echo>Going to stop tomcat</echo>
+ <exec executable="${TOMCAT_DEPLOY}/../bin/shutdown.sh"
+ osfamily="unix" />
+ </target>
+</project>
Modified: federation/trunk/picketlink-fed-tests/pom.xml
===================================================================
--- federation/trunk/picketlink-fed-tests/pom.xml 2010-06-03 20:07:13 UTC (rev 272)
+++ federation/trunk/picketlink-fed-tests/pom.xml 2010-06-04 00:26:28 UTC (rev 273)
@@ -34,9 +34,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
+ <phase>test</phase>
+ <!-- <skipTests>true</skipTests> -->
<printSummary>true</printSummary>
<disableXmlReport>false</disableXmlReport>
- <testFailureIgnore>false</testFailureIgnore>
+ <testFailureIgnore>true</testFailureIgnore>
<includes>
<include>**/**TestCase.java</include>
</includes>
@@ -45,7 +47,68 @@
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
</configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>phase-1</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="version" value="${version}"/>
+ <ant antfile="${basedir}/ant-build.xml" target="start-jboss" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>phase-2</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="version" value="${version}"/>
+ <property name="localRepository" value="${user.home}/.m2/repository"/>
+ <ant antfile="${basedir}/ant-build.xml" target="stop-jboss" />
+ <ant antfile="${basedir}/ant-build.xml" target="start-tomcat" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>phase-3</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="version" value="${version}"/>
+ <ant antfile="${basedir}/ant-build.xml" target="stop-tomcat" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
@@ -79,6 +142,12 @@
<version>2.9.1</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b2</version>
+ </dependency>
+
</dependencies>
<reporting>
Modified: federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java 2010-06-03 20:07:13 UTC (rev 272)
+++ federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java 2010-06-04 00:26:28 UTC (rev 273)
@@ -70,13 +70,13 @@
private void hitURLs( String url1, String url2, String url3, String url4 ) throws Exception
{
- //Sales post Application Login
+ //Sales post Application Login
WebRequest serviceRequest1 = new GetMethodWebRequest( url1 );
WebConversation webConversation = new WebConversation();
WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
WebForm loginForm = webResponse.getForms()[0];
- loginForm.setParameter("j_username", "manager" );
+ loginForm.setParameter("j_username", "tomcat" );
loginForm.setParameter("j_password", "tomcat" );
SubmitButton submitButton = loginForm.getSubmitButtons()[0];
submitButton.click();
@@ -112,4 +112,4 @@
webResponse = webConversation.getResponse( url2 );
assertTrue( " Reached the Login page ", webResponse.getText().contains( "Login" ));
}
-}
\ No newline at end of file
+}
Modified: 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 2010-06-03 20:07:13 UTC (rev 272)
+++ federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2010-06-04 00:26:28 UTC (rev 273)
@@ -60,7 +60,7 @@
WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
WebForm loginForm = webResponse.getForms()[0];
- loginForm.setParameter("j_username", "manager" );
+ loginForm.setParameter("j_username", "tomcat" );
loginForm.setParameter("j_password", "tomcat" );
SubmitButton submitButton = loginForm.getSubmitButtons()[0];
submitButton.click();
@@ -84,4 +84,4 @@
webResponse = webConversation.getResponse( SERVICE_2_URL );
assertTrue( " Reached the Login page ", webResponse.getText().contains( "Login" ));
}
-}
\ No newline at end of file
+}
Modified: 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 2010-06-03 20:07:13 UTC (rev 272)
+++ federation/trunk/picketlink-fed-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java 2010-06-04 00:26:28 UTC (rev 273)
@@ -47,11 +47,13 @@
*/
public class SAML2RedirectBindingGlobalLogOutUnitTestCase
{
+
+ String SERVICE_1_URL = System.getProperty( "SERVICE_3_URL", "http://localhost:8080/sales/" );
+ String SERVICE_2_URL = System.getProperty( "SERVICE_4_URL", "http://localhost:8080/employee/" );
+
@Test
public void testSAMLRedirectBindingGLO() throws Exception
{
- String SERVICE_1_URL = System.getProperty( "SERVICE_3_URL", "http://localhost:8080/sales/" );
- String SERVICE_2_URL = System.getProperty( "SERVICE_4_URL", "http://localhost:8080/employee/" );
String LOGOUT_URL = "?GLO=true";
//Sales Application Login
@@ -60,7 +62,7 @@
WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
WebForm loginForm = webResponse.getForms()[0];
- loginForm.setParameter("j_username", "manager" );
+ loginForm.setParameter("j_username", "tomcat" );
loginForm.setParameter("j_password", "tomcat" );
SubmitButton submitButton = loginForm.getSubmitButtons()[0];
submitButton.click();
@@ -84,4 +86,4 @@
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/resources/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip
===================================================================
(Binary files differ)
Property changes on: federation/trunk/picketlink-fed-tests/src/test/resources/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: federation/trunk/picketlink-fed-tests/src/test/resources/scripts/stopjboss.sh
===================================================================
--- federation/trunk/picketlink-fed-tests/src/test/resources/scripts/stopjboss.sh (rev 0)
+++ federation/trunk/picketlink-fed-tests/src/test/resources/scripts/stopjboss.sh 2010-06-04 00:26:28 UTC (rev 273)
@@ -0,0 +1,2 @@
+#!/bin/ksh
+ps -u`whoami` -opid,comm,args | grep "org.jboss.Main" | awk '{ print $1 }' | xargs kill -9
Property changes on: federation/trunk/picketlink-fed-tests/src/test/resources/scripts/stopjboss.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/6.0.26/apache-tomcat-6.0.26.zip
===================================================================
(Binary files differ)
Property changes on: federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/6.0.26/apache-tomcat-6.0.26.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/log4j.xml
===================================================================
--- federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/log4j.xml (rev 0)
+++ federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/log4j.xml 2010-06-04 00:26:28 UTC (rev 273)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!--
+ | For more configuration information and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="../logs/server.log"/>
+ <param name="Append" value="false"/>
+ <!--
+ Set the threshold via a system property. Note this is parsed by log4j,
+ so the full JBoss system property format is not supported; e.g.
+ setting a default via ${jboss.server.log.threshold:WARN} will not work.
+ -->
+ <param name="Threshold" value="TRACE"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] (Thread) Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.jboss">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.picketlink">
+ <priority value="TRACE"/>
+ </category>
+
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/tomcat-users.xml
===================================================================
--- federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/tomcat-users.xml (rev 0)
+++ federation/trunk/picketlink-fed-tests/src/test/resources/tomcat/tomcat-users.xml 2010-06-04 00:26:28 UTC (rev 273)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tomcat-users>
+ <role rolename="Sales"/>
+ <role rolename="manager"/>
+ <role rolename="user"/>
+ <role rolename="Employee"/>
+ <user username="manager" password="tomcat" roles="manager,Sales,Employee"/>
+ <user username="tomcat" password="tomcat" roles="manager,Sales,Employee"/>
+</tomcat-users>
14 years, 7 months