[jboss-cvs] Picketlink SVN: r862 - in integration-tests/trunk: picketlink-trust-jbas51-native and 13 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 5 13:20:52 EDT 2011


Author: anil.saldhana at jboss.com
Date: 2011-04-05 13:20:52 -0400 (Tue, 05 Apr 2011)
New Revision: 862

Added:
   integration-tests/trunk/picketlink-trust-jbas51-native/
   integration-tests/trunk/picketlink-trust-jbas51-native/pom.xml
   integration-tests/trunk/picketlink-trust-tests/
   integration-tests/trunk/picketlink-trust-tests/pom.xml
   integration-tests/trunk/picketlink-trust-tests/src/
   integration-tests/trunk/picketlink-trust-tests/src/test/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/STSWSClientTestCase.java
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTest.java
   integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTestBean.java
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/domains/
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/domains/sts-jboss-beans.xml
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/handlers.xml
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-roles.properties
   integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-users.properties
Log:
trust tests


Property changes on: integration-tests/trunk/picketlink-trust-jbas51-native
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata


Added: integration-tests/trunk/picketlink-trust-jbas51-native/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-jbas51-native/pom.xml	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-jbas51-native/pom.xml	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,211 @@
+<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-integration-tests-parent</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+      <relativePath>../parent</relativePath>
+   </parent>
+   <modelVersion>4.0.0</modelVersion>
+   <artifactId>picketlink-integration-trust-jbas51-native</artifactId>
+   <packaging>jar</packaging>
+   <name>PicketLink Integration Tests for WS-Trust (STS) - Trust - JBoss AS 5.1 - Native Stack</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>
+   <build>
+     <plugins>
+       <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.5</version>
+          <configuration>
+            <phase>test</phase>
+           <!--  <skipTests>true</skipTests> -->
+            <testClassesDirectory>${basedir}/../picketlink-trust-tests/target/test-classes</testClassesDirectory>
+            <testResourcesDirectory>${basedir}/../picketlink-trust-tests/target/test-classes</testResourcesDirectory>
+            <printSummary>true</printSummary>
+            <disableXmlReport>false</disableXmlReport>
+            <includes>
+              <include>**/**TestCase.java</include>
+            </includes>
+            <forkMode>pertest</forkMode>
+            <argLine>-Djava.endorsed.dirs=${basedir}/target/jboss-5.1.0.GA/lib/endorsed</argLine>
+            <useFile>false</useFile>
+            <trimStackTrace>false</trimStackTrace>
+            <reportsDirectory>${project.build.directory}/surefire-reports-native</reportsDirectory>
+            <additionalClasspathElements>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jbossall-client.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jbossws-native-core.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jbossws-native-client.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jbossws-spi.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jbossws-native-jaxrpc.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jbossws-common.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/jboss-xml-binding.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/mail.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/wsdl4j.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/wstx.jar</additionalClasspathElement>
+              <additionalClasspathElement>${basedir}/target/jboss-5.1.0.GA/client/policy.jar</additionalClasspathElement>
+            </additionalClasspathElements>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+          <executions>
+            <execution>
+              <id>phase-1</id>
+              <phase>compile</phase>
+              <configuration>
+                <tasks>
+                 <property name="version" value="${project.version}"/>
+                 <property name="depclasspath" refid="maven.dependency.classpath"/>
+                 <property name="localRepository" value="${user.home}/.m2/repository"/>
+                 <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="init-jboss5" />
+                 <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="copy-sts-props-jbas5" />
+                 <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="copy-trust-settings-jbas5" />
+                 <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="start-jboss5" />
+                </tasks>
+              </configuration>
+              <goals>
+                <goal>run</goal>
+              </goals>
+            </execution>
+            <execution>
+              <id>phase-2</id>
+              <phase>test</phase>
+              <configuration>
+                <tasks>
+                 <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="stop-jboss5" />
+                </tasks>
+              </configuration>
+              <goals>
+                <goal>run</goal>
+              </goals>
+            </execution>
+          </executions>
+       </plugin>
+     </plugins>
+  </build>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.picketlink</groupId>
+         <artifactId>picketlink-fed</artifactId>
+         <version>${version}</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink</groupId>
+         <artifactId>picketlink-trust-jbossws</artifactId>
+         <version>${version}</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.security</groupId>
+         <artifactId>jbosssx-client</artifactId>
+         <version>2.0.4.SP6</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.jbossas</groupId>
+         <artifactId>jboss-as-server</artifactId>
+         <classifier>jmx-invoker-adaptor-client</classifier>
+         <version>5.1.0.GA</version>
+         <scope>test</scope>
+         <exclusions>
+           <exclusion>
+             <groupId>trove</groupId>
+             <artifactId>trove</artifactId>
+           </exclusion>
+           <exclusion>
+             <groupId>wutka-dtdparser</groupId>
+             <artifactId>dtdparser121</artifactId>
+           </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.jbossas</groupId>
+         <artifactId>jboss-as-server</artifactId>
+         <classifier>client</classifier>
+         <version>5.1.0.GA</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>httpunit</groupId>
+        <artifactId>httpunit</artifactId>
+        <version>1.7</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>rhino</groupId>
+        <artifactId>js</artifactId>
+        <version>1.6R7</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>apache-log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.2.14</version>
+      </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>
+      <dependency>
+        <groupId>ant-contrib</groupId>
+        <artifactId>ant-contrib</artifactId>
+        <version>1.0b2</version>
+      </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: integration-tests/trunk/picketlink-trust-tests
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata


Added: integration-tests/trunk/picketlink-trust-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/pom.xml	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/pom.xml	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,188 @@
+<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-integration-tests-parent</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+      <relativePath>../parent</relativePath>
+   </parent>
+   <modelVersion>4.0.0</modelVersion>
+   <artifactId>picketlink-integration-trust-tests</artifactId>
+   <packaging>jar</packaging>
+   <name>PicketLink Integration Tests for WS-Trust (STS) using the PicketLink Trust Framework</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>
+   <build>
+     <plugins>
+     
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId> 
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <finalName>picketlink-wstest</finalName>
+          <excludes>
+            <exclude>**/*jboss-beans.xml</exclude>
+            <exclude>**/*TestCase*</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      
+
+      <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.5</version>
+          <configuration>
+            <phase>test</phase>
+            <skipTests>true</skipTests>
+            <printSummary>true</printSummary>
+            <disableXmlReport>false</disableXmlReport>
+            <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>org.picketlink</groupId>
+         <artifactId>picketlink-fed</artifactId>
+         <version>${version}</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink</groupId>
+         <artifactId>picketlink-trust-jbossws</artifactId>
+         <version>${version}</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.security</groupId>
+         <artifactId>jbosssx-client</artifactId>
+         <version>2.0.4.SP6</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.ws.native</groupId>
+         <artifactId>jbossws-native-core</artifactId>
+         <version>3.4.1.GA</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.jbossas</groupId>
+         <artifactId>jboss-as-server</artifactId>
+         <classifier>jmx-invoker-adaptor-client</classifier>
+         <version>5.1.0.GA</version>
+         <scope>test</scope>
+         <exclusions>
+           <exclusion>
+             <groupId>trove</groupId>
+             <artifactId>trove</artifactId>
+           </exclusion>
+           <exclusion>
+             <groupId>wutka-dtdparser</groupId>
+             <artifactId>dtdparser121</artifactId>
+           </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.jbossas</groupId>
+         <artifactId>jboss-as-server</artifactId>
+         <classifier>client</classifier>
+         <version>5.1.0.GA</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>httpunit</groupId>
+        <artifactId>httpunit</artifactId>
+        <version>1.7</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>rhino</groupId>
+        <artifactId>js</artifactId>
+        <version>1.6R7</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>apache-log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.2.14</version>
+      </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>
+      <dependency>
+        <groupId>ant-contrib</groupId>
+        <artifactId>ant-contrib</artifactId>
+        <version>1.0b2</version>
+      </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: integration-tests/trunk/picketlink-trust-tests/src
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java/org
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata


Added: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/STSWSClientTestCase.java
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/STSWSClientTestCase.java	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/STSWSClientTestCase.java	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,82 @@
+/*
+ * 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.trust.tests;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+import org.junit.Test;
+import org.picketlink.identity.federation.api.wstrust.WSTrustClient;
+import org.picketlink.identity.federation.api.wstrust.WSTrustClient.SecurityInfo;
+import org.picketlink.identity.federation.core.wstrust.WSTrustException;
+import org.picketlink.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
+import org.picketlink.test.trust.ws.WSTest;
+import org.picketlink.trust.jbossws.SAML2Constants;
+import org.picketlink.trust.jbossws.handler.SAML2Handler;
+import org.w3c.dom.Element;
+
+/**
+ * A Simple WS Test for the SAML Profile of WSS
+ * @author Marcus Moyses
+ * @author Anil Saldhana
+ * @since Oct 3, 2010
+ */
+public class STSWSClientTestCase
+{
+   private static String username = "UserA";
+   private static String password = "PassA";
+   
+   @SuppressWarnings("rawtypes")
+   @Test
+   public void testWSInteraction() throws Exception {
+      WSTrustClient client = new WSTrustClient("PicketLinkSTS", "PicketLinkSTSPort",
+            "http://localhost:8080/picketlink-sts/PicketLinkSTS",
+            new SecurityInfo(username, password));
+    Element assertion = null;
+    try {
+        System.out.println("Invoking token service to get SAML assertion for " + username);
+        assertion = client.issueToken(SAMLUtil.SAML2_TOKEN_TYPE);
+        System.out.println("SAML assertion for " + username + " successfully obtained!");
+    } catch (WSTrustException wse) {
+        System.out.println("Unable to issue assertion: " + wse.getMessage());
+        wse.printStackTrace();
+        System.exit(1);
+    }
+
+    URL wsdl = new URL("http://localhost:8080/picketlink-wstest-tests/WSTestBean?wsdl");
+    QName serviceName = new QName("http://ws.trust.test.picketlink.org/", "WSTestBeanService");
+    Service service = Service.create(wsdl, serviceName);
+    WSTest port = service.getPort(new QName("http://ws.trust.test.picketlink.org/", "WSTestBeanPort"), WSTest.class);
+    BindingProvider bp = (BindingProvider)port;
+    bp.getRequestContext().put(SAML2Constants.SAML2_ASSERTION_PROPERTY, assertion);
+    List<Handler> handlers = bp.getBinding().getHandlerChain();
+    handlers.add(new SAML2Handler());
+    bp.getBinding().setHandlerChain(handlers); 
+    
+    port.echo("Test");
+   }
+}
\ No newline at end of file


Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata


Added: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTest.java
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTest.java	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTest.java	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,37 @@
+/*
+ * 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.trust.ws;
+
+import javax.ejb.Remote;
+import javax.jws.WebService;
+ 
+ at Remote
+ at WebService
+/**
+ * A Simple EJB3 Interface that just echoes a string
+ * @author Marcus Moyses
+ * @since Oct 3, 2010
+ */
+public interface WSTest
+{
+   public void echo(String echo);
+}

Added: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTestBean.java
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTestBean.java	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/WSTestBean.java	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,58 @@
+/*
+ * 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.trust.ws;
+
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+
+
+/**
+ * EJB3 implementation
+ * @author Marcus Moyses
+ * @since Oct 3, 2010
+ */
+ at Stateless
+ at WebService
+ at SecurityDomain("sts")
+ at RolesAllowed("testRole")
+ at HandlerChain(file="handlers.xml")
+public class WSTestBean implements WSTest
+{ 
+   @Resource
+   WebServiceContext wsCtx;
+
+   @WebMethod
+   public void echo(String echo) {
+      System.out.println("WSTest: " + echo);
+      System.out.println("Principal: " + wsCtx.getUserPrincipal());
+      System.out.println("Principal.getName(): " + wsCtx.getUserPrincipal().getName());
+      System.out.println("isUserInRole('testRole'): " + wsCtx.isUserInRole("testRole"));
+   }
+}
\ No newline at end of file


Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/resources
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata



Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/resources/domains
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata


Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/domains/sts-jboss-beans.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/domains/sts-jboss-beans.xml	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/domains/sts-jboss-beans.xml	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- ejb3 test application-policy definition -->
+   <application-policy xmlns="urn:jboss:security-beans:1.0" name="sts">
+      <authentication>
+         <login-module code="org.picketlink.identity.federation.bindings.jboss.auth.SAML2STSLoginModule" flag="required">
+            <module-option name="configFile">sts-config.properties</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+         <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+            <module-option name="usersProperties">sts-users.properties</module-option>
+            <module-option name="rolesProperties">sts-roles.properties</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+      </authentication>
+   </application-policy>
+   
+   <!-- ejb3 test application-policy definition -->
+   <application-policy xmlns="urn:jboss:security-beans:1.0" name="jmx-console">
+      <authentication>
+         <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+            <module-option name="usersProperties">sts-users.properties</module-option>
+            <module-option name="rolesProperties">sts-roles.properties</module-option>
+         </login-module>
+      </authentication>
+   </application-policy>
+
+</deployment>
\ No newline at end of file

Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/handlers.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/handlers.xml	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/handlers.xml	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+
+
+  <handler-chain>
+    <handler>
+      <handler-name>SAML2Handler</handler-name>
+      <handler-class>org.picketlink.trust.jbossws.handler.SAML2Handler</handler-class>
+    </handler>
+  </handler-chain>
+
+
+</handler-chains>
\ No newline at end of file


Property changes on: integration-tests/trunk/picketlink-trust-tests/src/test/resources/props
___________________________________________________________________
Added: svn:ignore
   + .settings
target
target-eclipse
eclipse-target
.project
.classpath
.metadata


Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-roles.properties
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-roles.properties	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-roles.properties	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,5 @@
+JBoss=STSClient
+UserA=STSClient,testRole,JBossAdmin
+UserB=STSClient
+UserC=STSClient
+admin=JBossAdmin
\ No newline at end of file

Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-users.properties
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-users.properties	                        (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/props/sts-users.properties	2011-04-05 17:20:52 UTC (rev 862)
@@ -0,0 +1,5 @@
+JBoss=JBoss
+UserA=PassA
+UserB=PassB
+UserC=PassC
+admin=admin
\ No newline at end of file



More information about the jboss-cvs-commits mailing list