You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/01/30 17:50:59 UTC
svn commit: r1780953 [3/9] - in
/axis/axis2/java/rampart/branches/RAMPART-289: ./ apidocs/ code-coverage/
etc/ legal/ modules/distribution/ modules/distribution/src/
modules/documentation/ modules/rampart-core/
modules/rampart-core/src/main/java/META-I...
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/pom.xml?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/pom.xml Mon Jan 30 17:50:58 2017
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -41,41 +41,6 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <id>copy-mars</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart</artifactId>
- <version>${project.version}</version>
- <type>mar</type>
- <overWrite>true</overWrite>
- <outputDirectory>target/artifacts</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rahas</artifactId>
- <version>${project.version}</version>
- <type>mar</type>
- <overWrite>true</overWrite>
- <outputDirectory>target/artifacts</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.axis2</groupId>
- <artifactId>addressing</artifactId>
- <version>${axis2.version}</version>
- <type>mar</type>
- <overWrite>true</overWrite>
- <outputDirectory>target/artifacts</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- <execution>
<id>copy-endorsed</id>
<phase>process-resources</phase>
<goals>
@@ -90,85 +55,120 @@
</executions>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-repo-maven-plugin</artifactId>
<executions>
<execution>
- <id>generate-source</id>
- <phase>process-resources</phase>
+ <id>create-test-repo</id>
<goals>
- <goal>run</goal>
+ <goal>create-test-repository</goal>
</goals>
<configuration>
- <tasks>
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <arg line="-uri src/main/resources/ping/ping.wsdl -ss -o target/generated-code -p org.apache.axis2.oasis.ping -d xmlbeans -g" />
- <classpath refid="maven.dependency.classpath" />
- <classpath refid="maven.compile.classpath" />
- <classpath refid="maven.runtime.classpath" />
- </java>
- <!-- copy the service impl -->
- <copy file="src/main/resources/ping/src/org/apache/axis2/oasis/ping/PingPortSkeleton.java" tofile="target/generated-code/src/org/apache/axis2/oasis/ping/PingPortSkeleton.java" overwrite="yes" />
- <!-- Password callback class for the interop service -->
- <copy file="src/main/resources/ping/src/org/apache/axis2/security/PWCallback.java" tofile="target/generated-code/src/org/apache/axis2/security/PWCallback.java" overwrite="yes" />
- <!-- Interop client -->
- <copy file="src/main/resources/ping/src/org/apache/axis2/security/InteropScenarioClient.java" tofile="target/generated-code/src/org/apache/axis2/security/InteropScenarioClient.java" overwrite="yes" />
-
- <copy todir="target/test-classes">
- <fileset dir="target/generated-code/resources">
- <include name="**/*" />
- </fileset>
- </copy>
-
-
- <javac srcdir="target/generated-code" destdir="target/classes" fork="true">
- <classpath refid="maven.dependency.classpath" />
- <classpath refid="maven.compile.classpath" />
- <classpath refid="maven.runtime.classpath" />
- </javac>
-
- </tasks>
+ <modules>addressing,rampart</modules>
+ <outputDirectory>target/test-classes</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-rampart-client-repo</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart,rahas</modules>
+ <outputDirectory>target/test-resources/rampart_client_repo</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-rampart-service-repo</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart,rahas</modules>
+ <axis2xml>src/test/resources/conf/axis2.xml</axis2xml>
+ <outputDirectory>target/test-resources/rampart_service_repo</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-rahas-client-repo</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart</modules>
+ <outputDirectory>target/test-resources/rahas_client_repo</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-rahas-service-repo-1</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart,rahas</modules>
+ <axis2xml>src/test/resources/conf/axis2.xml</axis2xml>
+ <outputDirectory>target/test-resources/rahas_service_repo_1</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-rahas-service-repo-3</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart,rahas</modules>
+ <axis2xml>src/test/resources/conf/axis2.xml</axis2xml>
+ <outputDirectory>target/test-resources/rahas_service_repo_3</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-default-security-client-repo</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart</modules>
+ <axis2xml>src/test/resources/conf/axis2.xml</axis2xml>
+ <configurationDirectory>conf</configurationDirectory>
+ <outputDirectory>target/test-resources/default_security_client_repo</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-rahas-service-repo-5</id>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <modules>addressing,rampart,rahas</modules>
+ <axis2xml>src/test/resources/conf/axis2.xml</axis2xml>
+ <outputDirectory>target/test-resources/rahas_service_repo_5</outputDirectory>
</configuration>
</execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
<execution>
<id>create-test-resources</id>
<phase>process-test-resources</phase>
<configuration>
<tasks>
<property name="addressing.mar" value="addressing-${axis2.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-classes/modules/addressing-${axis2.version}.mar" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-classes/modules/rampart-${project.version}.mar" />
<mkdir dir="target/temp-ramp" />
<mkdir dir="target/temp-ramp/META-INF" />
- <copy overwrite="yes" file="target/classes/org/apache/rampart/Service.class" tofile="target/temp-ramp/org/apache/rampart/Service.class" />
- <copy overwrite="yes" file="target/classes/org/apache/rampart/PWCallback.class" tofile="target/temp-ramp/org/apache/rampart/PWCallback.class" />
<copy overwrite="yes" file="src/test/resources/rampart/store.jks" tofile="target/temp-ramp/store.jks" />
<!--path id="ramp.client.props" location="test-resources/rampart"/-->
<!--maven:addPath id="maven.dependency.classpath" refid="ramp.client.props" -->
<mkdir dir="target/test-resources/rampart_client_repo" />
<mkdir dir="target/test-resources/rampart_client_repo/conf" />
- <mkdir dir="target/test-resources/rampart_client_repo/modules" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/rampart_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/rahas-${project.version}.mar" tofile="target/test-resources/rampart_client_repo/modules/rahas-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/rampart_client_repo/modules/addressing-${axis2.version}.mar" />
<mkdir dir="target/test-resources/rampart_service_repo" />
<mkdir dir="target/test-resources/rampart_service_repo/conf" />
<mkdir dir="target/test-resources/rampart_service_repo/services" />
- <mkdir dir="target/test-resources/rampart_service_repo/modules" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/rampart_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/rahas-${project.version}.mar" tofile="target/test-resources/rampart_service_repo/modules/rahas-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/rampart_service_repo/modules/addressing-${axis2.version}.mar" />
<!-- Service 1 -->
<copy overwrite="yes" file="src/test/resources/rampart/services-1.xml" tofile="target/temp-ramp/META-INF/services.xml" />
@@ -276,6 +276,10 @@
<!-- Service 34 -->
<copy overwrite="yes" file="src/test/resources/rampart/services-34.xml" tofile="target/temp-ramp/META-INF/services.xml" />
<jar jarfile="target/test-resources/rampart_service_repo/services/SecureService34.aar" basedir="target/temp-ramp" />
+
+ <!-- Service 35 -->
+ <copy overwrite="yes" file="src/test/resources/rampart/services-35.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/SecureService35.aar" basedir="target/temp-ramp" />
<!-- Service SC-1 -->
@@ -294,27 +298,36 @@
<jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC3.aar" basedir="target/temp-ramp" />
<!-- Service SC-4 This is with standard secure conversation specification -->
- <copy overwrite="yes" file="src/test/resources/rampart/issuer.properties" tofile="target/temp-ramp/issuer.properties"/>
- <copy overwrite="yes" file="src/test/resources/rampart/services-sc-4.xml" tofile="target/temp-ramp/META-INF/services.xml"/>
- <jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC4.aar" basedir="target/temp-ramp"/>
+ <copy overwrite="yes" file="src/test/resources/rampart/issuer.properties" tofile="target/temp-ramp/issuer.properties" />
+ <copy overwrite="yes" file="src/test/resources/rampart/services-sc-4.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC4.aar" basedir="target/temp-ramp" />
<!-- Service SC-5 This is with standard secure conversation specification -->
- <copy overwrite="yes" file="src/test/resources/rampart/issuer.properties" tofile="target/temp-ramp/issuer.properties"/>
- <copy overwrite="yes" file="src/test/resources/rampart/services-sc-5.xml" tofile="target/temp-ramp/META-INF/services.xml"/>
- <jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC5.aar" basedir="target/temp-ramp"/>
+ <copy overwrite="yes" file="src/test/resources/rampart/issuer.properties" tofile="target/temp-ramp/issuer.properties" />
+ <copy overwrite="yes" file="src/test/resources/rampart/services-sc-5.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC5.aar" basedir="target/temp-ramp" />
<!-- Service SC-6 This is with standard secure conversation specification -->
- <copy overwrite="yes" file="src/test/resources/rampart/issuer.properties" tofile="target/temp-ramp/issuer.properties"/>
- <copy overwrite="yes" file="src/test/resources/rampart/services-sc-6.xml" tofile="target/temp-ramp/META-INF/services.xml"/>
- <jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC6.aar" basedir="target/temp-ramp"/>
+ <copy overwrite="yes" file="src/test/resources/rampart/issuer.properties" tofile="target/temp-ramp/issuer.properties" />
+ <copy overwrite="yes" file="src/test/resources/rampart/services-sc-6.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/SecureServiceSC6.aar" basedir="target/temp-ramp" />
+
+ <!-- Kerberos Services -->
+ <copy overwrite="yes" file="src/test/resources/rampart/kerberos/KerberosOverTransportKeytab.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/KerberosOverTransportKeytab.aar" basedir="target/temp-ramp" />
+
+ <copy overwrite="yes" file="src/test/resources/rampart/kerberos/KerberosOverTransportPWCB.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/KerberosOverTransportPWCB.aar" basedir="target/temp-ramp" />
+
+ <copy overwrite="yes" file="src/test/resources/rampart/kerberos/KerberosDelegation.xml" tofile="target/temp-ramp/META-INF/services.xml" />
+ <jar jarfile="target/test-resources/rampart_service_repo/services/KerberosDelegation.aar" basedir="target/temp-ramp" />
+
<!--
Set up the infra for rahas tests and the rahas client repo
-->
<mkdir dir="target/temp-rahas" />
<mkdir dir="target/temp-rahas/META-INF" />
- <copy overwrite="yes" file="target/classes/org/apache/rahas/Service.class" tofile="target/temp-rahas/org/apache/rahas/Service.class" />
- <copy overwrite="yes" file="target/classes/org/apache/rahas/PWCallback.class" tofile="target/temp-rahas/org/apache/rahas/PWCallback.class" />
<copy overwrite="yes" todir="target/temp-rahas">
<fileset dir="src/test/resources/rahas">
<include name="issuer.properties" />
@@ -325,17 +338,10 @@
<!--addPath id="maven.dependency.classpath" refid="rahas.client.props"-->
<mkdir dir="target/test-resources/rahas_client_repo" />
<mkdir dir="target/test-resources/rahas_client_repo/conf" />
- <mkdir dir="target/test-resources/rahas_client_repo/modules" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/rahas_client_repo/modules/addressing-${axis2.version}.mar" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/rahas_client_repo/modules/rampart-${project.version}.mar" />
<!-- Rahas Test1: SAML Token test -->
<mkdir dir="target/test-resources/rahas_service_repo_1" />
<mkdir dir="target/test-resources/rahas_service_repo_1/conf" />
<mkdir dir="target/test-resources/rahas_service_repo_1/services" />
- <mkdir dir="target/test-resources/rahas_service_repo_1/modules" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/rahas_service_repo_1/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/rahas-${project.version}.mar" tofile="target/test-resources/rahas_service_repo_1/modules/rahas-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/rahas_service_repo_1/modules/addressing-${axis2.version}.mar" />
<!-- copy the services.xml and create the aar -->
<copy overwrite="yes" file="src/test/resources/rahas/s1-services.xml" tofile="target/temp-rahas/META-INF/services.xml" />
<jar jarfile="target/test-resources/rahas_service_repo_1/services/SecureService.aar" basedir="target/temp-rahas" />
@@ -346,211 +352,23 @@
<mkdir dir="target/test-resources/rahas_service_repo_3" />
<mkdir dir="target/test-resources/rahas_service_repo_3/conf" />
<mkdir dir="target/test-resources/rahas_service_repo_3/services" />
- <mkdir dir="target/test-resources/rahas_service_repo_3/modules" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/rahas_service_repo_3/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/rahas-${project.version}.mar" tofile="target/test-resources/rahas_service_repo_3/modules/rahas-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/rahas_service_repo_3/modules/addressing-${axis2.version}.mar" />
<!-- copy the services.xml and create the aar -->
<copy overwrite="yes" file="src/test/resources/rahas/s3-services.xml" tofile="target/temp-rahas/META-INF/services.xml" />
<jar jarfile="target/test-resources/rahas_service_repo_3/services/SecureService.aar" basedir="target/temp-rahas" />
<!--
Rahas Test 3 & 4: RahasSAMLTokenUTForHoKTest and RahasSAMLTokenUTForHoKV1205Test : END
-->
- <mkdir dir="target/test-resources/default_security_client_repo" />
- <mkdir dir="target/test-resources/default_security_client_repo/conf" />
- <mkdir dir="target/test-resources/default_security_client_repo/modules" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/default_security_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/default_security_client_repo/modules/addressing-${axis2.version}.mar" />
- <copy file="src/test/resources/conf/axis2.xml" tofile="target/test-resources/default_security_client_repo/conf/axis2.xml" />
<!--
RahasSAMLTokenAttributeTest
-->
<mkdir dir="target/test-resources/rahas_service_repo_5" />
<mkdir dir="target/test-resources/rahas_service_repo_5/conf" />
<mkdir dir="target/test-resources/rahas_service_repo_5/services" />
- <mkdir dir="target/test-resources/rahas_service_repo_5/modules" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/rahas_service_repo_5/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/rahas-${project.version}.mar" tofile="target/test-resources/rahas_service_repo_5/modules/rahas-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/rahas_service_repo_5/modules/addressing-${axis2.version}.mar" />
<!-- copy the services.xml and create the aar -->
<copy overwrite="yes" file="src/test/resources/rahas/s5-services.xml" tofile="target/temp-rahas/META-INF/services.xml" />
<jar jarfile="target/test-resources/rahas_service_repo_5/services/SecureService.aar" basedir="target/temp-rahas" />
<!--RahasAttributeTest END-->
- <!-- Scenario 1 -->
- <mkdir dir="target/test-resources/scenario1_client_repo" />
- <mkdir dir="target/test-resources/scenario1_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario1_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario1_client_repo/services" />
- <mkdir dir="target/test-resources/scenario1_service_repo" />
- <mkdir dir="target/test-resources/scenario1_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario1_service_repo/services" />
- <mkdir dir="target/test-resources/scenario1_service_repo/modules" />
- <!-- setup scenario 1 client repository-->
- <copy file="src/test/resources/security/s1.client.axis2.xml" tofile="target/test-resources/scenario1_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario1_client_repo/modules/rampart-${project.version}.mar" />
- <!-- setup scenario 1 service repository-->
- <copy file="src/test/resources/security/s1.service.axis2.xml" tofile="target/test-resources/scenario1_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario1_service_repo/modules/rampart-${project.version}.mar" />
-
- <mkdir dir="target/temp-interop/META-INF" />
-
- <!-- Create the .aar file -->
- <copy file="src/test/resources/security/s1.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario1_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
- <!-- Scenario 2 - Setup the client and service repos -->
- <mkdir dir="target/test-resources/scenario2_client_repo" />
- <mkdir dir="target/test-resources/scenario2_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario2_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario2_service_repo" />
- <mkdir dir="target/test-resources/scenario2_service_repo/ conf" />
- <mkdir dir="target/test-resources/scenario2_service_repo/services" />
- <mkdir dir="target/test-resources/scenario2_service_repo/modules" />
- <copy file="src/test/resources/security/s2.client.axis2.xml" tofile="target/test-resources/scenario2_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario2_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s2.service.axis2.xml" tofile="target/test-resources/scenario2_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario2_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s2.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario2_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Scenario 2a - set up repos -->
- <mkdir dir="target/test-resources/scenario2a_client_repo" />
- <mkdir dir="target/test-resources/scenario2a_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario2a_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario2a_service_repo" />
- <mkdir dir="target/test-resources/scenario2a_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario2a_service_repo/services" />
- <mkdir dir="target/test-resources/scenario2a_service_repo/modules" />
- <copy file="src/test/resources/security/s2a.client.axis2.xml" tofile="target/test-resources/scenario2a_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario2a_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s2a.service.axis2.xml" tofile="target/test-resources/scenario2a_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario2a_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s2a.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario2a_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
- <!-- Scenario 3 -->
- <mkdir dir="target/test-resources/scenario3_client_repo" />
- <mkdir dir="target/test-resources/scenario3_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario3_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario3_service_repo" />
- <mkdir dir="target/test-resources/scenario3_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario3_service_repo/services" />
- <mkdir dir="target/test-resources/scenario3_service_repo/modules" />
- <copy file="src/test/resources/security/s3.client.axis2.xml" tofile="target/test-resources/scenario3_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario3_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s3.service.axis2.xml" tofile="target/test-resources/scenario3_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario3_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s3.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario3_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Scenario 4 -->
- <mkdir dir="target/test-resources/scenario4_client_repo" />
- <mkdir dir="target/test-resources/scenario4_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario4_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario4_service_repo" />
- <mkdir dir="target/test-resources/scenario4_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario4_service_repo/services" />
- <mkdir dir="target/test-resources/scenario4_service_repo/modules" />
- <copy file="src/test/resources/security/s4.client.axis2.xml" tofile="target/test-resources/scenario4_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario4_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s4.service.axis2.xml" tofile="target/test-resources/scenario4_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario4_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s4.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario4_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Scenario 5 -->
- <mkdir dir="target/test-resources/scenario5_client_repo" />
- <mkdir dir="target/test-resources/scenario5_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario5_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario5_service_repo" />
- <mkdir dir="target/test-resources/scenario5_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario5_service_repo/services" />
- <mkdir dir="target/test-resources/scenario5_service_repo/modules" />
- <copy file="src/test/resources/security/s5.client.axis2.xml" tofile="target/test-resources/scenario5_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario5_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s5.service.axis2.xml" tofile="target/test-resources/scenario5_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario5_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s5.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario5_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Scenario 6 -->
- <mkdir dir="target/test-resources/scenario6_client_repo" />
- <mkdir dir="target/test-resources/scenario6_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario6_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario6_service_repo" />
- <mkdir dir="target/test-resources/scenario6_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario6_service_repo/services" />
- <mkdir dir="target/test-resources/scenario6_service_repo/modules" />
- <copy file="src/test/resources/security/s6.client.axis2.xml" tofile="target/test-resources/scenario6_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario6_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s6.service.axis2.xml" tofile="target/test-resources/scenario6_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario6_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s6.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario6_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Scenario 7 -->
- <mkdir dir="target/test-resources/scenario7_client_repo" />
- <mkdir dir="target/test-resources/scenario7_client_repo/conf" />
- <mkdir dir="target/test-resources/scenario7_client_repo/modules" />
- <mkdir dir="target/test-resources/scenario7_service_repo" />
- <mkdir dir="target/test-resources/scenario7_service_repo/conf" />
- <mkdir dir="target/test-resources/scenario7_service_repo/services" />
- <mkdir dir="target/test-resources/scenario7_service_repo/modules" />
- <copy file="src/test/resources/security/s7.client.axis2.xml" tofile="target/test-resources/scenario7_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario7_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s7.service.axis2.xml" tofile="target/test-resources/scenario7_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenario7_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/s7.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenario7_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Scenario ST1 -->
- <mkdir dir="target/test-resources/scenarioST1_client_repo" />
- <mkdir dir="target/test-resources/scenarioST1_client_repo/conf" />
- <mkdir dir="target/test-resources/scenarioST1_client_repo/modules" />
- <mkdir dir="target/test-resources/scenarioST1_service_repo" />
- <mkdir dir="target/test-resources/scenarioST1_service_repo/conf" />
- <mkdir dir="target/test-resources/scenarioST1_service_repo/services" />
- <mkdir dir="target/test-resources/scenarioST1_service_repo/modules" />
- <copy file="src/test/resources/security/sST1.client.axis2.xml" tofile="target/test-resources/scenarioST1_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenarioST1_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/sST1.service.axis2.xml" tofile="target/test-resources/scenarioST1_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/scenarioST1_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/sST1.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/scenarioST1_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- MTOM Optimized Security Test -->
- <mkdir dir="target/test-resources/mtom_sec_client_repo" />
- <mkdir dir="target/test-resources/mtom_sec_client_repo/conf" />
- <mkdir dir="target/test-resources/mtom_sec_client_repo/modules" />
- <mkdir dir="target/test-resources/mtom_sec_service_repo" />
- <mkdir dir="target/test-resources/mtom_sec_service_repo/conf" />
- <mkdir dir="target/test-resources/mtom_sec_service_repo/services" />
- <mkdir dir="target/test-resources/mtom_sec_service_repo/modules" />
- <copy file="src/test/resources/security/secMtom.client.axis2.xml" tofile="target/test-resources/mtom_sec_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/mtom_sec_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/secMtom.service.axis2.xml" tofile="target/test-resources/mtom_sec_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/mtom_sec_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="src/test/resources/security/secMtom.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <jar jarfile="target/test-resources/mtom_sec_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
-
- <!-- Test with addressing and MTOM -->
- <mkdir dir="target/test-resources/complete_client_repo" />
- <mkdir dir="target/test-resources/complete_client_repo/conf" />
- <mkdir dir="target/test-resources/complete_client_repo/modules" />
- <mkdir dir="target/test-resources/complete_service_repo" />
- <mkdir dir="target/test-resources/complete_service_repo/conf" />
- <mkdir dir="target/test-resources/complete_service_repo/services" />
- <mkdir dir="target/test-resources/complete_service_repo/modules" />
- <!-- Test with addressing and MTOM client repository-->
- <copy file="src/test/resources/security/complete.client.axis2.xml" tofile="target/test-resources/complete_client_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/complete_client_repo/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/complete_client_repo/modules/addressing-${axis2.version}.mar" />
- <!-- Test with addressing and MTOMservice repository-->
- <copy file="src/test/resources/security/complete.service.axis2.xml" tofile="target/test-resources/complete_service_repo/conf/axis2.xml" />
- <copy file="target/artifacts/rampart-${project.version}.mar" tofile="target/test-resources/complete_service_repo/modules/rampart-${project.version}.mar" />
- <copy file="target/artifacts/addressing-${axis2.version}.mar" tofile="target/test-resources/complete_service_repo/modules/addressing-${axis2.version}.mar" />
- <copy file="src/test/resources/security/complete.service.xml" tofile="target/temp-interop/META-INF/services.xml" overwrite="true" />
- <!-- Create the .aar file -->
- <jar jarfile="target/test-resources/complete_service_repo/services/PingPort.aar" basedir="target/temp-interop" />
</tasks>
</configuration>
<goals>
@@ -581,7 +399,13 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Add the Xerces/Xalan versions expected by OpenSAML to the boot classpath so that the build succeeds on older 1.5 JDKs -->
- <argLine>-Xbootclasspath/p:${project.build.directory}/endorsed/xml-apis.jar${path.separator}${project.build.directory}/endorsed/xercesImpl.jar${path.separator}${project.build.directory}/endorsed/resolver.jar${path.separator}${project.build.directory}/endorsed/serializer.jar${path.separator}${project.build.directory}/endorsed/xalan.jar</argLine>
+ <argLine>${jacoco.surefireArgLine} -Xbootclasspath/p:${project.build.directory}/endorsed/xml-apis.jar${path.separator}${project.build.directory}/endorsed/xercesImpl.jar${path.separator}${project.build.directory}/endorsed/resolver.jar${path.separator}${project.build.directory}/endorsed/serializer.jar${path.separator}${project.build.directory}/endorsed/xalan.jar</argLine>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
</configuration>
</plugin>
</plugins>
@@ -592,16 +416,37 @@
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-policy</artifactId>
<version>${project.version}</version>
+ <!-- Use Jetty's servlet api (2.5) -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-trust</artifactId>
<version>${project.version}</version>
+ <!-- Use Jetty's servlet api (2.5) -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-core</artifactId>
<version>${project.version}</version>
+ <!-- Use Jetty's servlet api (2.5) -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
@@ -629,10 +474,100 @@
<version>${axis2.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.rampart</groupId>
+ <artifactId>rampart</artifactId>
+ <version>${project.version}</version>
+ <type>mar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rampart</groupId>
+ <artifactId>rahas</artifactId>
+ <version>${project.version}</version>
+ <type>mar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>addressing</artifactId>
+ <type>mar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core-annotations</artifactId>
+ <version>2.0.0-M21</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-protocol-shared</artifactId>
+ <version>2.0.0-M21</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-protocol-kerberos</artifactId>
+ <version>2.0.0-M21</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-interceptor-kerberos</artifactId>
+ <version>2.0.0-M21</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.api</groupId>
+ <artifactId>api-ldap-codec-standalone</artifactId>
+ <version>1.0.0-M33</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.api</groupId>
+ <artifactId>api-ldap-extras-codec-api</artifactId>
+ <version>1.0.0-M33</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-truth</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -642,20 +577,10 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-testutils</artifactId>
+ <version>${axis2.version}</version>
+ </dependency>
</dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
- <configuration>
- <templateDirectory>${basedir}</templateDirectory>
- <menu ref="parent" />
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
</project>
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/PWCallback.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/PWCallback.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/PWCallback.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/PWCallback.java Mon Jan 30 17:50:58 2017
@@ -33,35 +33,6 @@ import java.io.IOException;
public class PWCallback implements CallbackHandler {
-
- /** Field key */
-
- private static final byte[] key = {
-
- (byte) 0x31, (byte) 0xfd, (byte) 0xcb, (byte) 0xda, (byte) 0xfb,
-
- (byte) 0xcd, (byte) 0x6b, (byte) 0xa8, (byte) 0xe6, (byte) 0x19,
-
- (byte) 0xa7, (byte) 0xbf, (byte) 0x51, (byte) 0xf7, (byte) 0xc7,
-
- (byte) 0x3e, (byte) 0x80, (byte) 0xae, (byte) 0x98, (byte) 0x51,
-
- (byte) 0xc8, (byte) 0x51, (byte) 0x34, (byte) 0x04,
-
- };
-
-
-
- /*
-
- * (non-Javadoc)
-
- * @see javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[])
-
- */
-
-
-
/**
* Method handle
@@ -150,11 +121,7 @@ public class PWCallback implements Callb
*/
- if (pc.getUsage() == WSPasswordCallback.KEY_NAME) {
-
- pc.setKey(key);
-
- } else if(pc.getIdentifier().equals("alice")) {
+ if(pc.getIdentifier().equals("alice")) {
pc.setPassword("password");
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java Mon Jan 30 17:50:58 2017
@@ -16,106 +16,59 @@
package org.apache.rahas;
+import static org.apache.axis2.integration.TestConstants.TESTING_PATH;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.JettyServer;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyEngine;
-import org.apache.rampart.handler.WSSHandlerConstants;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
+import org.apache.rampart.RampartMessageData;
+import org.junit.Rule;
+import org.junit.Test;
-import javax.xml.namespace.QName;
+public abstract class TestClient {
-import junit.framework.TestCase;
+ @Rule
+ public final JettyServer server = new JettyServer(TESTING_PATH + getServiceRepo(), false);
-public abstract class TestClient extends TestCase {
+ @Rule
+ public final ClientHelper clientHelper = new ClientHelper(server, TESTING_PATH + "rahas_client_repo");
- protected int port = UtilServer.TESTING_PORT;
+ /**
+ */
+ @Test
+ public void testRequest() throws Exception {
+ ServiceClient serviceClient = clientHelper.createServiceClient("SecureService");
+ Options options = serviceClient.getOptions();
- public TestClient(String name) {
- super(name);
- }
+ options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+ options.setAction(this.getRequestAction());
+// options.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, this.getWSANamespace());
- protected void setUp() throws Exception {
- UtilServer.start(Constants.TESTING_PATH + getServiceRepo(), null);
- }
+ options.setTimeOutInMilliSeconds(200 * 1000);
- protected void tearDown() throws Exception {
- UtilServer.stop();
- }
+ ServiceContext context = serviceClient.getServiceContext();
+ context.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy());
+
+ serviceClient.engageModule("addressing");
+ serviceClient.engageModule("rampart");
- /**
- */
- public void testRequest() {
- try {
+ //Blocking invocation
- // Get the repository location from the args
- String repo = Constants.TESTING_PATH + "rahas_client_repo";
+ OMElement result = serviceClient.sendReceive(getRequest());
- ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repo,
- null);
- ServiceClient serviceClient = new ServiceClient(configContext, null);
- Options options = new Options();
-
- System.setProperty("javax.net.ssl.keyStorePassword", "password");
- System.setProperty("javax.net.ssl.keyStoreType", "JKS");
- System.setProperty("javax.net.ssl.trustStore", "/home/ruchith/Desktop/interop/certs/interop2.jks");
- System.setProperty("javax.net.ssl.trustStorePassword", "password");
- System.setProperty("javax.net.ssl.trustStoreType","JKS");
-
- options.setTo(new EndpointReference("http://127.0.0.1:" + port + "/axis2/services/SecureService"));
-// options.setTo(new EndpointReference("http://127.0.0.1:" + 9090 + "/axis2/services/UTSAMLHoK"));
-// options.setTo(new EndpointReference("https://www-lk.wso2.com:8443/axis2/services/UTSAMLHoK"));
-// options.setTo(new EndpointReference("https://192.18.49.133:2343/jaxws-s1-sts/sts"));
-// options.setTo(new EndpointReference("https://207.200.37.116/SxSts/Scenario_1_IssuedTokenOverTransport_UsernameOverTransport"));
-// options.setTo(new EndpointReference("http://localhost:9090/SxSts/Scenario_4_IssuedToken_MutualCertificate10"));
-
-// options.setTo(new EndpointReference("http://127.0.0.1:" + 9090 + "/axis2/services/MutualCertsSAMLHoK"));
-// options.setTo(new EndpointReference("http://www-lk.wso2.com:8888/axis2/services/MutualCertsSAMLHoK"));
-// options.setTo(new EndpointReference("https://131.107.72.15/trust/Addressing2004/UserName"));
-// options.setTo(new EndpointReference("https://131.107.72.15/trust/UserName"));
-// options.setTo(new EndpointReference("http://127.0.0.1:" + 9090 + "/trust/X509WSS10"));
-// options.setTo(new EndpointReference("https://131.107.72.15/trust/UserName"));
-// options.setTo(new EndpointReference("http://127.0.0.1:" + 9090 + "/jaxws-s4-sts/sts"));
-// options.setTo(new EndpointReference("http://127.0.0.1:9090/jaxws-s4/simple"));
-// options.setTo(new EndpointReference("http://127.0.0.1:" + 9090 + "/axis2/services/UTSAMLBearer"));
-
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- options.setAction(this.getRequestAction());
-// options.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, this.getWSANamespace());
-
- options.setTimeOutInMilliSeconds(200 * 1000);
- OutflowConfiguration clientOutflowConfiguration = getClientOutflowConfiguration();
- if (clientOutflowConfiguration != null) {
- configContext.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, clientOutflowConfiguration.getProperty());
- }
- InflowConfiguration clientInflowConfiguration = getClientInflowConfiguration();
- if (clientInflowConfiguration != null) {
- configContext.setProperty(WSSHandlerConstants.INFLOW_SECURITY, clientInflowConfiguration.getProperty());
- }
-
- serviceClient.engageModule(new QName("addressing"));
- serviceClient.engageModule(new QName("rampart"));
-
- serviceClient.setOptions(options);
-
- //Blocking invocation
-
- OMElement result = serviceClient.sendReceive(getRequest());
-
- this.validateRsponse(result);
- } catch (Exception e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
+ this.validateRsponse(result);
}
protected String getWSANamespace() {
@@ -124,9 +77,7 @@ public abstract class TestClient extends
public abstract OMElement getRequest();
- public abstract OutflowConfiguration getClientOutflowConfiguration();
-
- public abstract InflowConfiguration getClientInflowConfiguration();
+ public abstract String getClientPolicyPath();
public abstract String getServiceRepo();
@@ -178,9 +129,16 @@ public abstract class TestClient extends
public abstract OMElement getRSTTemplate() throws TrustException;
protected Policy getPolicy(String filePath) throws Exception {
- StAXOMBuilder builder = new StAXOMBuilder(filePath);
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new FileInputStream(filePath));
OMElement elem = builder.getDocumentElement();
return PolicyEngine.getPolicy(elem);
}
+
+ private Policy loadPolicy() throws Exception {
+ String path = getClientPolicyPath();
+ InputStream poilicyStream = TestClient.class.getResourceAsStream(path);
+ return PolicyEngine.getPolicy(poilicyStream);
+ }
+
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenCertForHoKTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenCertForHoKTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenCertForHoKTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenCertForHoKTest.java Mon Jan 30 17:50:58 2017
@@ -1,14 +1,4 @@
-package org.apache.rahas;
-
-import org.apache.rampart.handler.config.OutflowConfiguration;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.neethi.Policy;
-import org.apache.ws.secpolicy.SP11Constants;
-
-import javax.xml.namespace.QName;/*
+/*
* Copyright 2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,32 +14,19 @@ import javax.xml.namespace.QName;/*
* limitations under the License.
*/
-public class RahasSAML2TokenCertForHoKTest extends TestClient{
- public RahasSAML2TokenCertForHoKTest(String name) {
- super(name);
- }
-
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("Signature Encrypt Timestamp");
- ofc.setUser("alice");
- ofc.setEncryptionUser("ip");
- ofc.setSignaturePropFile("rahas/rahas-sec.properties");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
+package org.apache.rahas;
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.neethi.Policy;
+import org.apache.ws.secpolicy.SP11Constants;
- ifc.setActionItems("Signature Encrypt Timestamp");
- ifc.setPasswordCallbackClass(PWCallback.class.getName());
- ifc.setSignaturePropFile("rahas/rahas-sec.properties");
+import static org.junit.Assert.assertNotNull;
- return ifc;
- }
+import javax.xml.namespace.QName;
+public class RahasSAML2TokenCertForHoKTest extends TestClient{
public String getServiceRepo() {
return "rahas_service_repo_1";
}
@@ -127,4 +104,9 @@ public class RahasSAML2TokenCertForHoKTe
return RahasConstants.VERSION_05_02;
}
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/1.xml";
+ }
+
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenTest.java Mon Jan 30 17:50:58 2017
@@ -19,41 +19,14 @@ package org.apache.rahas;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.rampart.handler.config.OutflowConfiguration;
-import org.apache.rampart.handler.config.InflowConfiguration;
import org.apache.neethi.Policy;
import org.apache.ws.secpolicy.SP11Constants;
-import javax.xml.namespace.QName;
-public class RahasSAML2TokenTest extends TestClient{
- /**
- * @param name
- */
- public RahasSAML2TokenTest(String name) {
- super(name);
- }
-
-
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("Signature Encrypt Timestamp");
- ofc.setUser("alice");
- ofc.setSignaturePropFile("rahas/rahas-sec.properties");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
+import static org.junit.Assert.assertNotNull;
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Signature Encrypt Timestamp");
- ifc.setPasswordCallbackClass(PWCallback.class.getName());
- ifc.setSignaturePropFile("rahas/rahas-sec.properties");
-
- return ifc;
- }
+import javax.xml.namespace.QName;
+public class RahasSAML2TokenTest extends TestClient{
public String getServiceRepo() {
return "rahas_service_repo_1";
}
@@ -125,4 +98,10 @@ public class RahasSAML2TokenTest extends
public int getTrstVersion() {
return RahasConstants.VERSION_05_02;
}
+
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/1.xml";
+ }
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenUTForBearerTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenUTForBearerTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenUTForBearerTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAML2TokenUTForBearerTest.java Mon Jan 30 17:50:58 2017
@@ -20,8 +20,6 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP11Constants;
import org.opensaml.Configuration;
import org.opensaml.saml2.core.Assertion;
@@ -35,6 +33,10 @@ import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.io.ByteArrayInputStream;
import java.util.List;
@@ -43,11 +45,6 @@ import java.util.List;
* @author Ruchith Fernando (ruchith.fernando@gmail.com)
*/
public class RahasSAML2TokenUTForBearerTest extends TestClient {
-
- public RahasSAML2TokenUTForBearerTest(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem = TrustUtil.createRequestSecurityTokenElement(RahasConstants.VERSION_05_02);
@@ -67,23 +64,6 @@ public class RahasSAML2TokenUTForBearerT
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("UsernameToken Timestamp");
- ofc.setUser("joe");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Timestamp");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_3";
}
@@ -171,4 +151,9 @@ public class RahasSAML2TokenUTForBearerT
}
return assertion;
}
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/3.xml";
+ }
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenAttributeTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenAttributeTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenAttributeTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenAttributeTest.java Mon Jan 30 17:50:58 2017
@@ -1,21 +1,16 @@
package org.apache.rahas;
+import static org.junit.Assert.assertNotNull;
+
import javax.xml.namespace.QName;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP11Constants;
public class RahasSAMLTokenAttributeTest extends TestClient{
-
- public RahasSAMLTokenAttributeTest(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem = TrustUtil.createRequestSecurityTokenElement(RahasConstants.VERSION_05_02);
@@ -35,23 +30,6 @@ public class RahasSAMLTokenAttributeTest
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("UsernameToken Timestamp");
- ofc.setUser("joe");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Timestamp");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_5";
}
@@ -99,4 +77,9 @@ public class RahasSAMLTokenAttributeTest
public int getTrstVersion() {
return RahasConstants.VERSION_05_02;
}
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/3.xml";
+ }
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKTest.java Mon Jan 30 17:50:58 2017
@@ -20,40 +20,13 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP11Constants;
-import javax.xml.namespace.QName;
+import static org.junit.Assert.assertNotNull;
+import javax.xml.namespace.QName;
public class RahasSAMLTokenCertForHoKTest extends TestClient {
-
- public RahasSAMLTokenCertForHoKTest(String name) {
- super(name);
- }
-
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("Signature Encrypt Timestamp");
- ofc.setUser("alice");
- ofc.setEncryptionUser("ip");
- ofc.setSignaturePropFile("rahas/rahas-sec.properties");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Signature Encrypt Timestamp");
- ifc.setPasswordCallbackClass(PWCallback.class.getName());
- ifc.setSignaturePropFile("rahas/rahas-sec.properties");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_1";
}
@@ -132,4 +105,9 @@ public class RahasSAMLTokenCertForHoKTes
return RahasConstants.VERSION_05_02;
}
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/1.xml";
+ }
+
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKV1205Test.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKV1205Test.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKV1205Test.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenCertForHoKV1205Test.java Mon Jan 30 17:50:58 2017
@@ -20,21 +20,13 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.WSSHandlerConstants;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP12Constants;
-import org.apache.xml.security.encryption.XMLCipher;
+
+import static org.junit.Assert.assertNotNull;
import javax.xml.namespace.QName;
public class RahasSAMLTokenCertForHoKV1205Test extends TestClient {
-
-
- public RahasSAMLTokenCertForHoKV1205Test(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem =
@@ -62,41 +54,6 @@ public class RahasSAMLTokenCertForHoKV12
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
-// ofc.setActionItems("Timestamp Signature Encrypt");
- ofc.setActionItems("Signature Encrypt Timestamp");
- ofc.setUser("alice");
- ofc.setEncryptionUser("ip");
- ofc.setSignaturePropFile("rahas/rahas-sec.properties");
- ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
- ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
- ofc.setEncryptionKeyTransportAlgorithm(XMLCipher.RSA_OAEP);
-// ofc.setEncryptionSymAlgorithm(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256);
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- ofc.setEnableSignatureConfirmation(false);
-// ofc.setSignatureParts("{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;" +
-// "{Element}{" + RahasConstants.WSA_NS + "}To;" +
-// "{Element}{" + RahasConstants.WSA_NS + "}ReplyTo;" +
-// "{Element}{" + RahasConstants.WSA_NS + "}MessageID;" +
-// "{Element}{" + RahasConstants.WSA_NS + "}Action;" +
-// "{Element}{" + WSConstants.WSU_NS + "}Timestamp");
-
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Signature Encrypt Timestamp");
- ifc.setPasswordCallbackClass(PWCallback.class.getName());
- ifc.setSignaturePropFile("rahas/rahas-sec.properties");
- ifc.setEnableSignatureConfirmation(false);
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_1";
}
@@ -148,4 +105,9 @@ public class RahasSAMLTokenCertForHoKV12
return RahasConstants.VERSION_05_12;
}
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/1.xml";
+ }
+
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenTest.java Mon Jan 30 17:50:58 2017
@@ -20,43 +20,13 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP11Constants;
+import static org.junit.Assert.assertNotNull;
+
import javax.xml.namespace.QName;
public class RahasSAMLTokenTest extends TestClient {
-
-
- /**
- * @param name
- */
- public RahasSAMLTokenTest(String name) {
- super(name);
- }
-
-
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("Signature Encrypt Timestamp");
- ofc.setUser("alice");
- ofc.setSignaturePropFile("rahas/rahas-sec.properties");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Signature Encrypt Timestamp");
- ifc.setPasswordCallbackClass(PWCallback.class.getName());
- ifc.setSignaturePropFile("rahas/rahas-sec.properties");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_1";
}
@@ -127,4 +97,10 @@ public class RahasSAMLTokenTest extends
public int getTrstVersion() {
return RahasConstants.VERSION_05_02;
}
+
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/1.xml";
+ }
}
Modified: axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForBearerTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForBearerTest.java?rev=1780953&r1=1780952&r2=1780953&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForBearerTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-289/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForBearerTest.java Mon Jan 30 17:50:58 2017
@@ -20,8 +20,6 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP11Constants;
import org.opensaml.Configuration;
import org.opensaml.saml1.core.Assertion;
@@ -36,6 +34,10 @@ import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.io.ByteArrayInputStream;
import java.util.List;
@@ -44,11 +46,6 @@ import java.util.List;
* @author Ruchith Fernando (ruchith.fernando@gmail.com)
*/
public class RahasSAMLTokenUTForBearerTest extends TestClient {
-
- public RahasSAMLTokenUTForBearerTest(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem = TrustUtil.createRequestSecurityTokenElement(RahasConstants.VERSION_05_02);
@@ -68,23 +65,6 @@ public class RahasSAMLTokenUTForBearerTe
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("UsernameToken Timestamp");
- ofc.setUser("joe");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Timestamp");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_3";
}
@@ -172,4 +152,9 @@ public class RahasSAMLTokenUTForBearerTe
}
return assertion;
}
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/3.xml";
+ }
}