Author: pskopek(a)redhat.com
Date: 2012-05-02 12:24:03 -0400 (Wed, 02 May 2012)
New Revision: 1555
Added:
integration-tests/branches/eap6/picketlink-int-webapps/claims/src/main/webapp/META-INF/
integration-tests/branches/eap6/picketlink-int-webapps/claims/src/main/webapp/META-INF/jboss-deployment-structure.xml
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/SAMLTestsDeployerHelper.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/STSTestsDeployerHelper.java
integration-tests/branches/eap6/product-preparation/roles.properties
integration-tests/branches/eap6/product-preparation/users.properties
Removed:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java
Modified:
integration-tests/branches/eap6/parent/pom.xml
integration-tests/branches/eap6/picketlink-saml-tests/pom.xml
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml11/SAML11IDPFirstUnitTestCase.java
integration-tests/branches/eap6/picketlink-sts-tests/.classpath
integration-tests/branches/eap6/picketlink-sts-tests/pom.xml
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/CacheInvalidationUnitTestCase.java
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java
integration-tests/branches/eap6/product-preparation/
integration-tests/branches/eap6/product-preparation/pom.xml
Log:
EAP6 fixes
Modified: integration-tests/branches/eap6/parent/pom.xml
===================================================================
--- integration-tests/branches/eap6/parent/pom.xml 2012-04-23 09:59:53 UTC (rev 1554)
+++ integration-tests/branches/eap6/parent/pom.xml 2012-05-02 16:24:03 UTC (rev 1555)
@@ -1,5 +1,5 @@
<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>
+ <parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
<version>5</version>
@@ -11,7 +11,7 @@
<version>2.0.0-SNAPSHOT</version>
<name>PicketLink Integration Tests - Parent</name>
<
url>http://labs.jboss.org/portal/picketlink/</url>
- <description>PicketLink is a cross-cutting project that handles identity needs
for the JEMS projects</description>
+ <description>PicketLink is a cross-cutting project that handles identity needs
for the JEMS projects</description>
<licenses>
<license>
<name>lgpl</name>
@@ -28,20 +28,50 @@
</scm>
<properties>
- <pl-version>2.0.0</pl-version>
- <pl-trust-version>2.0.0.final</pl-trust-version>
-
<pl-fed-webapps-assembly-version>2.0.1.1.final</pl-fed-webapps-assembly-version>
- <maven.compiler.target>1.6</maven.compiler.target>
- <eap-home>${basedir}/target/jboss-eap-5.1/jboss-as</eap-home>
- <EAP_ZIP>jboss-eap-noauth-5.1.1.zip</EAP_ZIP>
- <!-- EAP_ZIP>jboss-eap-noauth-5.1.2-ER1.zip</EAP_ZIP -->
-
<CXF_INSTALLER_ZIP>jboss-ep-ws-cxf-5.1.2-ER1-installer.zip</CXF_INSTALLER_ZIP>
- <downloadURL.prefix>file:///mnt/jqa/eap/5.1.2.ER1</downloadURL.prefix>
- <EAP_URL>${downloadURL.prefix}/${EAP_ZIP}</EAP_URL>
-
<CXF_INSTALLER_URL>${downloadURL.prefix}/${CXF_INSTALLER_ZIP}</CXF_INSTALLER_URL>
- <jboss.profile>default</jboss.profile>
-
<jboss.dist>${basedir}/../product-preparation/target/jboss-eap-5.1</jboss.dist>
- <property name="localRepository"
value="${user.home}/.m2/repository"/>
+ <!-- MEAD repo tag -->
+
<
mead-repo>http://download.lab.bos.redhat.com/rel-eng/repos/jb-eap-6-rh...
+
+ <!-- PicketLink version default values -->
+ <pl-version>2.1.0-SNAPSHOT</pl-version>
+ <!-- pl-webapps-main-version>${pl-version}</pl-webapps-main-version
-->
+ <pl-webapps-main-version>2.1.0-SNAPSHOT</pl-webapps-main-version>
+ <pl-trust-version>2.0.0.final</pl-trust-version>
+
<pl-fed-webapps-assembly-version>2.0.3.Final</pl-fed-webapps-assembly-version>
+ <xerces-version>2.9.1-redhat-1</xerces-version>
+ <jbossxacml-version>2.0.7.Final-redhat-1</jbossxacml-version>
+
+ <!-- PicketLink for AS7 values
+ <pl-version>2.0.1.final</pl-version>
+ <pl-trust-version>2.0.1.final</pl-trust-version>
+
<pl-fed-webapps-assembly-version>2.0.1.1.final</pl-fed-webapps-assembly-version>
+ -->
+
+ <maven.compiler.target>1.6</maven.compiler.target>
+ <eap5-home>${basedir}/target/jboss-eap-5.1/jboss-as</eap5-home>
+ <eap6-home>${basedir}/target/jbossas</eap6-home>
+ <!--
EAP_DIR>/home/pskopek/projects/as7.work/jboss-as/build/target/jboss-as-7.1.0.CR1-SNAPSHOT</EAP_DIR
-->
+
+ <EAP5_ZIP>jboss-eap-noauth-5.1.2-ER1.zip</EAP5_ZIP>
+
<downloadURL5.prefix>file:///mnt/jqa/eap/5.1.2.ER1</downloadURL5.prefix>
+
+ <EAP6_ZIP>jboss-eap-6.0.0.ER6-pl-2.1.0.zip</EAP6_ZIP>
+ <!--
downloadURL6.prefix>file:///mnt/globalsync/rhel/devel/candidates/JBEAP/JBEAP-6.0.0-ER5</downloadURL6.prefix
-->
+
<downloadURL6.prefix>file:///home/pskopek/tmp/eap6/er6</downloadURL6.prefix>
+
+ <EAP6_URL>${downloadURL6.prefix}/${EAP6_ZIP}</EAP6_URL>
+ <EAP5_URL>${downloadURL5.prefix}/${EAP5_ZIP}</EAP5_URL>
+
+
<CXF_INSTALLER_ZIP>jboss-ep-ws-cxf-5.1.2-ER1-installer.zip</CXF_INSTALLER_ZIP>
+
<CXF_INSTALLER_URL>${downloadURL5.prefix}/${CXF_INSTALLER_ZIP}</CXF_INSTALLER_URL>
+ <jboss.profile>default</jboss.profile>
+
+
<jboss.dist>${basedir}/../product-preparation/target/jboss-eap-5.1</jboss.dist>
+
<jboss6.dist>${basedir}/../product-preparation/target/jbossas</jboss6.dist>
+
+
+ <arquillian.version>1.0.0.Final</arquillian.version>
+
<version.arg.jbossas.managed>7.1.1.Final</version.arg.jbossas.managed>
+ <property name="localRepository"
value="${user.home}/.m2/repository"/>
</properties>
@@ -75,7 +105,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
+ <version>1.4</version>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself.-->
<plugin>
@@ -93,7 +123,7 @@
<artifactId>
maven-antrun-plugin
</artifactId>
- <versionRange>[1.7,)</versionRange>
+ <versionRange>[1.4,)</versionRange>
<goals>
<goal>run</goal>
</goals>
@@ -115,7 +145,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.9</version>
+ <version>2.10</version>
</plugin>
</plugins>
</reporting>
@@ -156,30 +186,92 @@
<enabled>false</enabled>
</releases>
</repository>
+ <repository>
+ <id>mead.jboss.org</id>
+ <name>JBoss MEAD tag Repository</name>
+ <layout>default</layout>
+ <url>${mead-repo}</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-core</artifactId>
+ <version>${pl-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>idp-as7</artifactId>
+ <version>${pl-version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>pdp-as7</artifactId>
+ <version>${pl-version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-sts-as7</artifactId>
+ <version>${pl-version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-fed-webapps-as7-assembly</artifactId>
+ <version>${pl-fed-webapps-assembly-version}</version>
+ <type>zip</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>${xerces-version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>1.0-SP4</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.4</version>
+ <version>4.10-redhat-1</version>
<scope>test</scope>
</dependency>
+ <!-- Arquillian bill of materials, used to configure Arquillian versions
-->
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-bom</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ <version>${version.arg.jbossas.managed}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache</groupId>
+ <groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
- <version>1.4.3</version>
+ <version>1.5.1-redhat-1</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -188,6 +280,18 @@
<version>1.0.3</version>
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>3.1.0.GA-redhat-1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <optional>true</optional>
+ </dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
@@ -208,8 +312,8 @@
</dependency>
<dependency>
<groupId>org.jboss.security</groupId>
- <artifactId>jbossxacml</artifactId>
- <version>2.0.4</version>
+ <artifactId>jboss-xacml</artifactId>
+ <version>${jbossxacml-version}</version>
</dependency>
<dependency>
<groupId>org.openid4java</groupId>
@@ -234,6 +338,12 @@
<version>6.1.18</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.remoting3</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ <version>3.2.4.GA-redhat-1</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
Added:
integration-tests/branches/eap6/picketlink-int-webapps/claims/src/main/webapp/META-INF/jboss-deployment-structure.xml
===================================================================
---
integration-tests/branches/eap6/picketlink-int-webapps/claims/src/main/webapp/META-INF/jboss-deployment-structure.xml
(rev 0)
+++
integration-tests/branches/eap6/picketlink-int-webapps/claims/src/main/webapp/META-INF/jboss-deployment-structure.xml 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,10 @@
+<jboss-deployment-structure>
+
+ <deployment>
+ <!-- Add picketlink module dependency -->
+ <dependencies>
+ <module name="org.picketlink" />
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
+
Modified: integration-tests/branches/eap6/picketlink-saml-tests/pom.xml
===================================================================
--- integration-tests/branches/eap6/picketlink-saml-tests/pom.xml 2012-04-23 09:59:53 UTC
(rev 1554)
+++ integration-tests/branches/eap6/picketlink-saml-tests/pom.xml 2012-05-02 16:24:03 UTC
(rev 1555)
@@ -38,7 +38,7 @@
<printSummary>true</printSummary>
<disableXmlReport>false</disableXmlReport>
<includes>
- <include>**/**TestCase.java</include>
+ <include>**/*TestCase.java</include>
</includes>
<forkMode>pertest</forkMode>
<argLine>-Djava.endorsed.dirs=${basedir}/src/test/resources/endorsed</argLine>
@@ -55,6 +55,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
@@ -74,10 +79,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>apache-xerces</groupId>
+ <groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
Added:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/SAMLTestsDeployerHelper.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/SAMLTestsDeployerHelper.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/SAMLTestsDeployerHelper.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,105 @@
+package org.picketlink.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * <p>
+ * Class that manages deployments for Arquillian based tests.
+ * </p>
+ * <p>
+ * <b>Note:</b> This class can be super class of test case classes that wish
to deploy all deployments or
+ * simply use static calls and pick deployments one needs.
+ * </p>
+ *
+ * @author pskopek(a)redhat.com
+ * @since Nov 28, 2011
+ */
+
+public class SAMLTestsDeployerHelper {
+
+ public static String WEBAPPS_LOCATION = "target/picketlink";
+
+ @Deployment(name = "pdp.war", order = 1, testable = false)
+ public static WebArchive importPdpWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/pdp.war"));
+ }
+
+ @Deployment(name = "idp.war", order = 2, testable = false)
+ public static WebArchive importIdpWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/idp.war"));
+ }
+
+ @Deployment(name = "idp-sig.war", order = 3, testable = false)
+ public static WebArchive importIdpSigWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/idp-sig.war"));
+ }
+
+ @Deployment(name = "picketlink-sts.war", order = 4, testable = false)
+ public static WebArchive importStsWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/picketlink-sts.war"));
+ }
+
+ @Deployment(name = "sales.war", order = 5, testable = false)
+ public static WebArchive importSalesWar() throws IOException {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/sales.war"));
+ }
+
+ @Deployment(name = "sales-post.war", order = 6, testable = false)
+ public static WebArchive importSalesPostWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/sales-post.war"));
+ }
+
+ @Deployment(name = "sales-post-sig.war", order = 7, testable = false)
+ public static WebArchive importSalesPostSigWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/sales-post-sig.war"));
+ }
+
+ @Deployment(name = "employee.war", order = 8, testable = false)
+ public static WebArchive importEmployeeWar() throws IOException {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/employee.war"));
+ }
+
+ @Deployment(name = "employee-post.war", order = 9, testable = false)
+ public static WebArchive importEmployeePostWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/employee-post.war"));
+ }
+
+ @Deployment(name = "employee-post-sig.war", order = 10, testable = false)
+ public static WebArchive importEmployeePostSigWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/employee-post-sig.war"));
+ }
+
+ @Deployment(name = "claims.war", order = 11, testable = false)
+ public static WebArchive importClaimsWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new
File("../picketlink-int-webapps/claims/target/claims.war"));
+ }
+
+ @Deployment(name = "sales-saml11.war", order = 12, testable = false)
+ public static WebArchive importSalesSaml11War() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/sales-saml11.war"));
+ }
+
+ @Deployment(name = "employee-saml11.war", order = 13, testable = false)
+ public static WebArchive importEmployeeSaml11War() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/employee-saml11.war"));
+ }
+
+}
Modified:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml11/SAML11IDPFirstUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml11/SAML11IDPFirstUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml11/SAML11IDPFirstUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -23,6 +23,10 @@
import static org.junit.Assert.assertTrue;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import com.meterware.httpunit.GetMethodWebRequest;
@@ -32,6 +36,8 @@
import com.meterware.httpunit.WebLink;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
+import org.junit.runner.RunWith;
+import org.picketlink.test.integration.SAMLTestsDeployerHelper;
/**
* <p>
@@ -47,11 +53,23 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 7, 2011
*/
+(a)RunWith(Arquillian.class)
public class SAML11IDPFirstUnitTestCase
{
String IDP_URL = System.getProperty( "IDP_URL",
"http://localhost:8080/idp/" );
-
+
+ @Deployment(name = "idp.war", order = 1, testable = false)
+ public static WebArchive importIdpWar() {
+ return SAMLTestsDeployerHelper.importIdpWar();
+ }
+
+ @Deployment(name = "sales-saml11.war", order = 2, testable = false)
+ public static WebArchive importSalesSaml11War() {
+ return SAMLTestsDeployerHelper.importSalesSaml11War();
+ }
+
@Test
+ @RunAsClient
public void testSAML11() throws Exception
{
System.out.println("Trying "+ IDP_URL);
Deleted:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -1,124 +0,0 @@
-/*
- * 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(a)redhat.com
- * @since Apr 8, 2010
- */
-public class SAML2MixedBindingGlobalLogOutUnitTestCase
-{
- 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 SERVICE_3_URL = System.getProperty( "SERVICE_3_URL",
"http://localhost:8080/sales/" );
- String SERVICE_4_URL = System.getProperty( "SERVICE_4_URL",
"http://localhost:8080/employee/" );
-
- String LOGOUT_URL = "?GLO=true";
-
- @Test
- public void testSAMLMixedBindingWithPostFirstGlobalLogOut() throws Exception
- {
- hitURLs(SERVICE_1_URL, SERVICE_2_URL, SERVICE_3_URL, SERVICE_4_URL);
- }
-
- @Test
- public void testSAMLMixedBindingWithRedirectFirstGlobalLogOut() throws Exception
- {
- hitURLs(SERVICE_3_URL, SERVICE_4_URL, SERVICE_1_URL, SERVICE_2_URL);
- }
-
-
- private void hitURLs( String url1, String url2, String url3, String url4 ) throws
Exception
- {
- System.out.println("Trying "+ url1);
- //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", "tomcat" );
- 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 post Application Login
- System.out.println("Trying "+ url2);
- webResponse = webConversation.getResponse( url2 );
- assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
-
- //Sales Application Login
- System.out.println("Trying "+ url3);
- webResponse = webConversation.getResponse( url3 );
- assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "SalesTool" ));
-
- //Employee Application Login
- System.out.println("Trying "+ url4);
- webResponse = webConversation.getResponse( url4 );
- assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
-
- //Logout from sales
- System.out.println("Trying "+ url1 + LOGOUT_URL);
- webResponse = webConversation.getResponse( url1 + LOGOUT_URL );
- assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
-
- //Hit the Sales Apps again
- System.out.println("Trying "+ url1);
- webResponse = webConversation.getResponse( url1 );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
- System.out.println("Trying "+ url3);
- webResponse = webConversation.getResponse( url3 );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
-
- //Hit the Employee Apps again
- System.out.println("Trying "+ url2);
- webResponse = webConversation.getResponse( url2 );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
- System.out.println("Trying "+ url2);
- webResponse = webConversation.getResponse( url2 );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
- }
-}
Added:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2MixedBindingGlobalLogOutUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,130 @@
+/*
+ * 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.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.runner.RunWith;
+
+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;
+import org.picketlink.test.integration.SAMLTestsDeployerHelper;
+
+/**
+ * <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(a)redhat.com
+ * @since Apr 8, 2010
+ */
+(a)RunWith(Arquillian.class)
+public class SAML2MixedBindingGlobalLogOutUnitTestCase extends SAMLTestsDeployerHelper
+{
+ 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 SERVICE_3_URL = System.getProperty( "SERVICE_3_URL",
"http://localhost:8080/sales/" );
+ String SERVICE_4_URL = System.getProperty( "SERVICE_4_URL",
"http://localhost:8080/employee/" );
+
+ String LOGOUT_URL = "?GLO=true";
+
+ @Test
+ @RunAsClient
+ public void testSAMLMixedBindingWithPostFirstGlobalLogOut() throws Exception
+ {
+ hitURLs(SERVICE_1_URL, SERVICE_2_URL, SERVICE_3_URL, SERVICE_4_URL);
+ }
+
+ @Test
+ @RunAsClient
+ public void testSAMLMixedBindingWithRedirectFirstGlobalLogOut() throws Exception
+ {
+ hitURLs(SERVICE_3_URL, SERVICE_4_URL, SERVICE_1_URL, SERVICE_2_URL);
+ }
+
+ private void hitURLs( String url1, String url2, String url3, String url4 ) throws
Exception
+ {
+ System.out.println("Trying "+ url1);
+ //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", "tomcat" );
+ 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 post Application Login
+ System.out.println("Trying "+ url2);
+ webResponse = webConversation.getResponse( url2 );
+ assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Sales Application Login
+ System.out.println("Trying "+ url3);
+ webResponse = webConversation.getResponse( url3 );
+ assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "SalesTool" ));
+
+ //Employee Application Login
+ System.out.println("Trying "+ url4);
+ webResponse = webConversation.getResponse( url4 );
+ assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Logout from sales
+ System.out.println("Trying "+ url1 + LOGOUT_URL);
+ webResponse = webConversation.getResponse( url1 + LOGOUT_URL );
+ assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
+
+ //Hit the Sales Apps again
+ System.out.println("Trying "+ url1);
+ webResponse = webConversation.getResponse( url1 );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+ System.out.println("Trying "+ url3);
+ webResponse = webConversation.getResponse( url3 );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+
+ //Hit the Employee Apps again
+ System.out.println("Trying "+ url2);
+ webResponse = webConversation.getResponse( url2 );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+ System.out.println("Trying "+ url2);
+ webResponse = webConversation.getResponse( url2 );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+ }
+}
Deleted:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -1,102 +0,0 @@
-/*
- * 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(a)redhat.com
- * @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
- {
- //Sales Application Login
- System.out.println("Trying "+ getService1URL());
- WebRequest serviceRequest1 = new GetMethodWebRequest( getService1URL() );
- WebConversation webConversation = new WebConversation();
-
- WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
- WebForm loginForm = webResponse.getForms()[0];
- loginForm.setParameter("j_username", "tomcat" );
- 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
- System.out.println("Trying "+ getService2URL());
- webResponse = webConversation.getResponse( getService2URL() );
- assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
-
- //Logout from sales
-
- System.out.println("Trying "+ getService1URL() + LOGOUT_URL);
- webResponse = webConversation.getResponse( getService1URL() + LOGOUT_URL );
- assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
-
- //Hit the Sales App again
- System.out.println("Trying "+ getService1URL());
- webResponse = webConversation.getResponse( getService1URL() );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
-
- //Hit the Employee App again
- System.out.println("Trying "+ getService2URL());
- 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/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostBindingGlobalLogOutUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,109 @@
+/*
+ * 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.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+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;
+import org.junit.runner.RunWith;
+import org.picketlink.test.integration.SAMLTestsDeployerHelper;
+
+/**
+ * <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(a)redhat.com
+ * @since Apr 8, 2010
+ */
+
+(a)RunWith(Arquillian.class)
+public class SAML2PostBindingGlobalLogOutUnitTestCase extends SAMLTestsDeployerHelper
+{
+ 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
+ @RunAsClient
+ public void testSAMLPostBindingGlobalLogOut() throws Exception
+ {
+ //Sales Application Login
+ System.out.println("Trying "+ getService1URL());
+ WebRequest serviceRequest1 = new GetMethodWebRequest( getService1URL() );
+ WebConversation webConversation = new WebConversation();
+
+ WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
+ WebForm loginForm = webResponse.getForms()[0];
+ loginForm.setParameter("j_username", "tomcat" );
+ 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
+ System.out.println("Trying "+ getService2URL());
+ webResponse = webConversation.getResponse( getService2URL() );
+ assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Logout from sales
+
+ System.out.println("Trying "+ getService1URL() + LOGOUT_URL);
+ webResponse = webConversation.getResponse( getService1URL() + LOGOUT_URL );
+ assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
+
+ //Hit the Sales App again
+ System.out.println("Trying "+ getService1URL());
+ webResponse = webConversation.getResponse( getService1URL() );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+
+ //Hit the Employee App again
+ System.out.println("Trying "+ getService2URL());
+ 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
Deleted:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -1,43 +0,0 @@
-/*
- * 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_5_URL",
"http://localhost:8080/sales-post-sig/" );
- String SERVICE_6_URL = System.getProperty( "SERVICE_6_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
Added:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2PostSignatureGLOUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.runner.RunWith;
+
+/**
+ * Unit test the GLO scenarios involving two endpoints with SAML2 Post
+ * and Signature binding
+ * @author anil saldhana
+ */
+(a)RunWith(Arquillian.class)
+public class SAML2PostSignatureGLOUnitTestCase extends
SAML2PostBindingGlobalLogOutUnitTestCase
+{
+ String SERVICE_5_URL = System.getProperty( "SERVICE_5_URL",
"http://localhost:8080/sales-post-sig/" );
+ String SERVICE_6_URL = System.getProperty( "SERVICE_6_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
Deleted:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -1,95 +0,0 @@
-/*
- * 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(a)redhat.com
- * @since Apr 8, 2010
- */
-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 LOGOUT_URL = "?GLO=true";
-
- //Sales Application Login
-
- System.out.println("Trying "+ SERVICE_1_URL);
- 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", "tomcat" );
- 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
- System.out.println("Trying "+ SERVICE_2_URL);
- webResponse = webConversation.getResponse( SERVICE_2_URL );
- assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
-
- //Logout from sales
- System.out.println("Trying "+ SERVICE_1_URL + LOGOUT_URL);
- webResponse = webConversation.getResponse( SERVICE_1_URL + LOGOUT_URL );
- assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
-
- //Hit the Sales App again
- System.out.println("Trying "+ SERVICE_1_URL);
- webResponse = webConversation.getResponse( SERVICE_1_URL );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
-
- //Hit the Employee App again
- System.out.println("Trying "+ SERVICE_2_URL);
- webResponse = webConversation.getResponse( SERVICE_2_URL );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
- }
-}
\ No newline at end of file
Added:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2RedirectBindingGlobalLogOutUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,101 @@
+/*
+ * 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.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+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;
+import org.junit.runner.RunWith;
+import org.picketlink.test.integration.SAMLTestsDeployerHelper;
+
+/**
+ * <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(a)redhat.com
+ * @since Apr 8, 2010
+ */
+(a)RunWith(Arquillian.class)
+public class SAML2RedirectBindingGlobalLogOutUnitTestCase extends
SAMLTestsDeployerHelper
+{
+
+ 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
+ @RunAsClient
+ public void testSAMLRedirectBindingGLO() throws Exception
+ {
+ String LOGOUT_URL = "?GLO=true";
+
+ //Sales Application Login
+
+ System.out.println("Trying "+ SERVICE_1_URL);
+ 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", "tomcat" );
+ 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
+ System.out.println("Trying "+ SERVICE_2_URL);
+ webResponse = webConversation.getResponse( SERVICE_2_URL );
+ assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Logout from sales
+ System.out.println("Trying "+ SERVICE_1_URL + LOGOUT_URL);
+ webResponse = webConversation.getResponse( SERVICE_1_URL + LOGOUT_URL );
+ assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
+
+ //Hit the Sales App again
+ System.out.println("Trying "+ SERVICE_1_URL);
+ webResponse = webConversation.getResponse( SERVICE_1_URL );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+
+ //Hit the Employee App again
+ System.out.println("Trying "+ SERVICE_2_URL);
+ webResponse = webConversation.getResponse( SERVICE_2_URL );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+ }
+}
\ No newline at end of file
Deleted:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -1,54 +0,0 @@
-/*
- * 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.assertEquals;
-
-import org.junit.Test;
-
-import com.meterware.httpunit.GetMethodWebRequest;
-import com.meterware.httpunit.WebConversation;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.WebResponse;
-
-/**
- * Test for parsing the SAML2 Response
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 26, 2011
- */
-public class SAML2ResponseParsingUnitTestCase
-{
- String CLAIMS_URL = "http://localhost:8080/claims/claimsprocess.jsp";
-
- /**
- * PLFED-214: Uses the claims.war in the picketlink-int-webapps setup
- */
- @Test
- public void testADFSClaims() throws Exception
- {
- WebRequest serviceRequest1 = new GetMethodWebRequest( CLAIMS_URL );
- WebConversation webConversation = new WebConversation();
-
- WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
- assertEquals( 200, webResponse.getResponseCode());
- }
-}
\ No newline at end of file
Added:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/SAML2ResponseParsingUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,60 @@
+/*
+ * 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.assertEquals;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.Test;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+import org.junit.runner.RunWith;
+import org.picketlink.test.integration.SAMLTestsDeployerHelper;
+
+/**
+ * Test for parsing the SAML2 Response
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 26, 2011
+ */
+(a)RunWith(Arquillian.class)
+public class SAML2ResponseParsingUnitTestCase extends SAMLTestsDeployerHelper
+{
+ String CLAIMS_URL = "http://localhost:8080/claims/claimsprocess.jsp";
+
+ /**
+ * PLFED-214: Uses the claims.war in the picketlink-int-webapps setup
+ */
+ @Test
+ @RunAsClient
+ public void testADFSClaims() throws Exception
+ {
+ WebRequest serviceRequest1 = new GetMethodWebRequest( CLAIMS_URL );
+ WebConversation webConversation = new WebConversation();
+
+ WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
+ assertEquals( 200, webResponse.getResponseCode());
+ }
+}
\ No newline at end of file
Deleted:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -1,95 +0,0 @@
-/*
- * 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;
-
-/**
- * SAML Test for Standalone Web Containers
- * @author Anil.Saldhana(a)redhat.com
- * @since Aug 9, 2011
- */
-public class StandaloneSAMLUnitTestCase
-{
- String SERVICE_1_URL = System.getProperty( "SERVICE_1_URL",
"http://localhost:8080/sales-standalone/" );
- String SERVICE_2_URL = System.getProperty( "SERVICE_2_URL",
"http://localhost:8080/employee-standalone/" );
- String LOGOUT_URL = "?GLO=true";
-
-
- public String getService1URL()
- {
- return SERVICE_1_URL;
- }
- public String getService2URL()
- {
- return SERVICE_2_URL;
- }
-
- @Test
- public void testSAMLStandalone() throws Exception
- {
- //Sales Application Login
- System.out.println("Trying "+ getService1URL());
- WebRequest serviceRequest1 = new GetMethodWebRequest( getService1URL() );
- WebConversation webConversation = new WebConversation();
-
- WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
- WebForm loginForm = webResponse.getForms()[0];
- loginForm.setParameter("JBID_USERNAME", "manager" );
- loginForm.setParameter("JBID_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
- System.out.println("Trying "+ getService2URL());
- webResponse = webConversation.getResponse( getService2URL() );
- assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
-
- //Logout from sales
-
- System.out.println("Trying "+ getService1URL() + LOGOUT_URL);
- webResponse = webConversation.getResponse( getService1URL() + LOGOUT_URL );
- assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
-
- //Hit the Sales App again
- System.out.println("Trying "+ getService1URL());
- webResponse = webConversation.getResponse( getService1URL() );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
-
- //Hit the Employee App again
- System.out.println("Trying "+ getService2URL());
- webResponse = webConversation.getResponse( getService2URL() );
- assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
- }
-}
\ No newline at end of file
Added:
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-saml-tests/src/test/java/org/picketlink/test/integration/saml2/StandaloneSAMLUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,101 @@
+/*
+ * 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.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+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;
+import org.junit.runner.RunWith;
+import org.picketlink.test.integration.SAMLTestsDeployerHelper;
+
+/**
+ * SAML Test for Standalone Web Containers
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Aug 9, 2011
+ */
+(a)RunWith(Arquillian.class)
+public class StandaloneSAMLUnitTestCase extends SAMLTestsDeployerHelper
+{
+ String SERVICE_1_URL = System.getProperty( "SERVICE_1_URL",
"http://localhost:8080/sales-standalone/" );
+ String SERVICE_2_URL = System.getProperty( "SERVICE_2_URL",
"http://localhost:8080/employee-standalone/" );
+ String LOGOUT_URL = "?GLO=true";
+
+
+ public String getService1URL()
+ {
+ return SERVICE_1_URL;
+ }
+ public String getService2URL()
+ {
+ return SERVICE_2_URL;
+ }
+
+ @Test
+ @RunAsClient
+ public void testSAMLStandalone() throws Exception
+ {
+ //Sales Application Login
+ System.out.println("Trying "+ getService1URL());
+ WebRequest serviceRequest1 = new GetMethodWebRequest( getService1URL() );
+ WebConversation webConversation = new WebConversation();
+
+ WebResponse webResponse = webConversation.getResponse( serviceRequest1 );
+ WebForm loginForm = webResponse.getForms()[0];
+ loginForm.setParameter("JBID_USERNAME", "manager" );
+ loginForm.setParameter("JBID_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
+ System.out.println("Trying "+ getService2URL());
+ webResponse = webConversation.getResponse( getService2URL() );
+ assertTrue( " Reached the employee index page ",
webResponse.getText().contains( "EmployeeDashboard" ));
+
+ //Logout from sales
+
+ System.out.println("Trying "+ getService1URL() + LOGOUT_URL);
+ webResponse = webConversation.getResponse( getService1URL() + LOGOUT_URL );
+ assertTrue( "Reached logged out page", webResponse.getText().contains(
"logged" ) );
+
+ //Hit the Sales App again
+ System.out.println("Trying "+ getService1URL());
+ webResponse = webConversation.getResponse( getService1URL() );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+
+ //Hit the Employee App again
+ System.out.println("Trying "+ getService2URL());
+ webResponse = webConversation.getResponse( getService2URL() );
+ assertTrue( " Reached the Login page ", webResponse.getText().contains(
"Login" ));
+ }
+}
\ No newline at end of file
Modified: integration-tests/branches/eap6/picketlink-sts-tests/.classpath
===================================================================
--- integration-tests/branches/eap6/picketlink-sts-tests/.classpath 2012-04-23 09:59:53
UTC (rev 1554)
+++ integration-tests/branches/eap6/picketlink-sts-tests/.classpath 2012-05-02 16:24:03
UTC (rev 1555)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/test-classes"
path="src/test/java"/>
<classpathentry excluding="**" kind="src"
output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con"
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: integration-tests/branches/eap6/picketlink-sts-tests/pom.xml
===================================================================
--- integration-tests/branches/eap6/picketlink-sts-tests/pom.xml 2012-04-23 09:59:53 UTC
(rev 1554)
+++ integration-tests/branches/eap6/picketlink-sts-tests/pom.xml 2012-05-02 16:24:03 UTC
(rev 1555)
@@ -46,11 +46,8 @@
<dependencies>
<dependency>
- <groupId>org.picketlink.product</groupId>
- <artifactId>picketlink-core</artifactId>
- <version>${pl-version}</version>
- <scope>system</scope>
-
<systemPath>${jboss.dist}/picketlink/picketlink-federation/picketlink-core-${pl-version}.jar</systemPath>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-core</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.security</groupId>
@@ -121,6 +118,11 @@
<artifactId>ant-contrib</artifactId>
<version>1.0b2</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
Added:
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/STSTestsDeployerHelper.java
===================================================================
---
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/STSTestsDeployerHelper.java
(rev 0)
+++
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/STSTestsDeployerHelper.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,34 @@
+package org.picketlink.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * <p>
+ * Class that manages deployments for Arquillian based tests.
+ * </p>
+ * <p>
+ * <b>Note:</b> This class can be super class of test case classes that wish
to deploy all deployments or
+ * simply use static calls and pick deployments one needs.
+ * </p>
+ *
+ * @author pskopek(a)redhat.com
+ * @since Nov 28, 2011
+ */
+
+public class STSTestsDeployerHelper {
+
+ public static String WEBAPPS_LOCATION = "target/picketlink";
+
+ @Deployment(name = "picketlink-sts.war", order = 1, testable = false)
+ public static WebArchive importStsWar() {
+ return ShrinkWrap.createFromZipFile(WebArchive.class,
+ new File(WEBAPPS_LOCATION + "/picketlink-sts.war"));
+ }
+
+
+}
Modified:
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/CacheInvalidationUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/CacheInvalidationUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/CacheInvalidationUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -25,9 +25,13 @@
import javax.management.ObjectName;
import javax.naming.InitialContext;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.security.SimplePrincipal;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.picketlink.identity.federation.api.wstrust.WSTrustClient;
import org.picketlink.identity.federation.api.wstrust.WSTrustClient.SecurityInfo;
import org.picketlink.identity.federation.core.wstrust.SamlCredential;
@@ -35,6 +39,7 @@
import org.picketlink.identity.federation.core.wstrust.WSTrustUtil;
import org.picketlink.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken;
+import org.picketlink.test.integration.STSTestsDeployerHelper;
import org.w3c.dom.Element;
/**
@@ -48,7 +53,10 @@
* @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
* @since Jun 8, 2010
*/
-public class CacheInvalidationUnitTestCase
+(a)RunWith(Arquillian.class)
+@RunAsClient
+@Ignore
+public class CacheInvalidationUnitTestCase extends STSTestsDeployerHelper
{
/**
* <p>
Modified:
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java
===================================================================
---
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java 2012-04-23
09:59:53 UTC (rev 1554)
+++
integration-tests/branches/eap6/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java 2012-05-02
16:24:03 UTC (rev 1555)
@@ -39,8 +39,12 @@
import junit.framework.Assert;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.picketlink.identity.federation.api.wstrust.WSTrustClient;
import org.picketlink.identity.federation.api.wstrust.WSTrustClient.SecurityInfo;
import org.picketlink.identity.federation.core.saml.v1.SAML11Constants;
@@ -73,6 +77,7 @@
import org.picketlink.identity.xmlsec.w3.xmldsig.RSAKeyValueType;
import org.picketlink.identity.xmlsec.w3.xmldsig.X509CertificateType;
import org.picketlink.identity.xmlsec.w3.xmldsig.X509DataType;
+import org.picketlink.test.integration.STSTestsDeployerHelper;
import org.w3c.dom.Element;
/**
@@ -84,12 +89,15 @@
* @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
* @since Jun 8, 2010
*/
-public class PicketLinkSTSIntegrationUnitTestCase
+(a)RunWith(Arquillian.class)
+@RunAsClient
+public class PicketLinkSTSIntegrationUnitTestCase extends STSTestsDeployerHelper
{
private static WSTrustClient client;
private static Certificate certificate;
+
@BeforeClass
public static void initClient() throws Exception
{
@@ -115,6 +123,7 @@
* if an error occurs while running the test.
*/
@Test
+ //@Ignore
public void testIssueSAML11() throws Exception
{
Element assertionElement = client.issueToken(SAMLUtil.SAML11_TOKEN_TYPE);
Property changes on: integration-tests/branches/eap6/product-preparation
___________________________________________________________________
Modified: svn:ignore
- .settings
target
.project
+ .settings
target
.project
lib
webapps
Modified: integration-tests/branches/eap6/product-preparation/pom.xml
===================================================================
--- integration-tests/branches/eap6/product-preparation/pom.xml 2012-04-23 09:59:53 UTC
(rev 1554)
+++ integration-tests/branches/eap6/product-preparation/pom.xml 2012-05-02 16:24:03 UTC
(rev 1555)
@@ -19,19 +19,20 @@
<id>phase-1</id>
<phase>compile</phase>
<configuration>
- <target>
- <ant antfile="${basedir}/../ant-scripts/ant-build.xml"
target="unzip-jboss-distributed-test-deps">
- <property name="depclasspath"
refid="maven.dependency.classpath"/>
- <property name="version"
value="${pl-version}"/>
- <property name="pl-fed-webapps-assembly-version"
value="${pl-fed-webapps-assembly-version}"/>
- <property name="localRepository"
value="${user.home}/.m2/repository"/>
- <property name="pl-trust-version"
value="${pl-trust-version}"/>
- <property name="downloadURL.prefix"
value="${downloadURL.prefix}"/>
- <property name="jboss.profile"
value="${jboss.profile}"/>
- <property name="CXF_INSTALLER_ZIP"
value="${CXF_INSTALLER_ZIP}"/>
- <property name="EAP_ZIP"
value="${EAP_ZIP}"/>
- </ant>
- </target>
+ <tasks>
+ <property name="depclasspath"
refid="maven.dependency.classpath"/>
+ <property name="version"
value="${pl-version}"/>
+ <property name="localRepository"
value="${user.home}/.m2/repository"/>
+ <property name="pl-fed-webapps-assembly-version"
value="${pl-fed-webapps-assembly-version}"/>
+ <property name="localRepository"
value="${user.home}/.m2/repository"/>
+ <property name="pl-trust-version"
value="${pl-trust-version}"/>
+ <property name="downloadURL.prefix"
value="${downloadURL6.prefix}"/>
+ <property name="jboss.profile"
value="${jboss.profile}"/>
+ <property name="EAP_ZIP" value="${EAP6_ZIP}"
/>
+ <property name="EAP_URL" value="${EAP6_URL}"
/>
+ <property name="EAP_DIR" value="${EAP6_DIR}"
/>
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml"
target="download-eap" />
+ </tasks>
</configuration>
<goals>
<goal>run</goal>
Added: integration-tests/branches/eap6/product-preparation/roles.properties
===================================================================
--- integration-tests/branches/eap6/product-preparation/roles.properties
(rev 0)
+++ integration-tests/branches/eap6/product-preparation/roles.properties 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,2 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+admin=JBossAdmin,HttpInvoker
Added: integration-tests/branches/eap6/product-preparation/users.properties
===================================================================
--- integration-tests/branches/eap6/product-preparation/users.properties
(rev 0)
+++ integration-tests/branches/eap6/product-preparation/users.properties 2012-05-02
16:24:03 UTC (rev 1555)
@@ -0,0 +1,2 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+admin=admin