wise SVN: r403 - in core/trunk: core and 1 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-10 07:01:29 -0400 (Fri, 10 Sep 2010)
New Revision: 403
Modified:
core/trunk/core/pom.xml
core/trunk/integration-testsuite/pom.xml
core/trunk/pom.xml
Log:
[WISE-169] Fixing dependencies
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
+++ core/trunk/core/pom.xml 2010-09-10 11:01:29 UTC (rev 403)
@@ -216,4 +216,40 @@
</build>
+ <profiles>
+ <!--
+ Depending on the enabled profile, provide additional runtime client dependencies
+ -->
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>!cxf.stack</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-client</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>cxf</id>
+ <activation>
+ <property>
+ <name>cxf.stack</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws.cxf</groupId>
+ <artifactId>jbossws-cxf-client</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
Modified: core/trunk/integration-testsuite/pom.xml
===================================================================
--- core/trunk/integration-testsuite/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
+++ core/trunk/integration-testsuite/pom.xml 2010-09-10 11:01:29 UTC (rev 403)
@@ -118,6 +118,9 @@
</build>
<profiles>
+ <!--
+ Enable submodules depending on the ws stack and add test dependency on the proper client stack artifact
+ -->
<profile>
<id>native</id>
<activation>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
+++ core/trunk/pom.xml 2010-09-10 11:01:29 UTC (rev 403)
@@ -507,12 +507,16 @@
</reporting>
<profiles>
+ <!--
+ Enable distribution module
+ -->
<profile>
<id>distro</id>
<modules>
<module>distribution</module>
</modules>
</profile>
+
<!--
Name: hudson Descr: Ignore test failures on hudson
-->
@@ -530,7 +534,10 @@
</build>
</profile>
- <profile>
+ <!--
+ Enable core-native module
+ -->
+ <profile>
<id>native</id>
<activation>
<property>
@@ -540,14 +547,11 @@
<modules>
<module>core-native</module>
</modules>
- <dependencies>
- <dependency>
- <groupId>org.jboss.ws.native</groupId>
- <artifactId>jbossws-native-client</artifactId>
- </dependency>
- </dependencies>
</profile>
+ <!--
+ Enable core-cxf module
+ -->
<profile>
<id>cxf</id>
<activation>
@@ -558,14 +562,11 @@
<modules>
<module>core-cxf</module>
</modules>
- <dependencies>
- <dependency>
- <groupId>org.jboss.ws.cxf</groupId>
- <artifactId>jbossws-cxf-client</artifactId>
- </dependency>
- </dependencies>
</profile>
+ <!--
+ Enable integration-testsuite module
+ -->
<profile>
<id>integration-testsuite</id>
<activation>
14 years, 4 months
wise SVN: r402 - in core/trunk: integration-testsuite and 4 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-10 06:00:23 -0400 (Fri, 10 Sep 2010)
New Revision: 402
Added:
core/trunk/integration-testsuite/
core/trunk/integration-testsuite/common/
core/trunk/integration-testsuite/native/
core/trunk/integration-testsuite/native/pom.xml
core/trunk/integration-testsuite/pom.xml
Removed:
core/trunk/integration-native/
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsaandwsse/
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsaddressing/
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/wsse/
core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/wsa/
core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/wsaandwsse/
core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/wsse/
core/trunk/integration-testsuite/native/pom.xml
core/trunk/integration/
Modified:
core/trunk/integration-testsuite/common/pom.xml
core/trunk/pom.xml
Log:
[WISE-169] Moving integration modules under a common integration-testsuite one
Property changes on: core/trunk/integration-testsuite
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.project
Copied: core/trunk/integration-testsuite/common (from rev 398, core/trunk/integration)
Modified: core/trunk/integration-testsuite/common/pom.xml
===================================================================
--- core/trunk/integration/pom.xml 2010-09-09 17:48:04 UTC (rev 398)
+++ core/trunk/integration-testsuite/common/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
@@ -16,52 +16,18 @@
<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">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.wise</groupId>
- <artifactId>wise-integration</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <name>Wise Integration Test</name>
- <url>http://www.jboss.org/wise</url>
+ <name>Wise Integration Common Test</name>
+ <artifactId>wise-integration-common</artifactId>
+
<parent>
<groupId>org.jboss.wise</groupId>
- <artifactId>wise</artifactId>
+ <artifactId>wise-integration-testsuite</artifactId>
<version>1.2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.wise</groupId>
- <artifactId>wise-core</artifactId>
- <version>${version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbossall-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies/>
<build>
<plugins>
@@ -88,7 +54,6 @@
</execution>
</executions>
</plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
@@ -180,148 +145,8 @@
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <executions>
- <execution>
- <id>unit-tests</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- <excludes>
- <exclude>**/integration/**/*Test.java</exclude>
- <exclude>**/*StressTest.java</exclude>
- <exclude>**/*$*.java</exclude>
- </excludes>
- </configuration>
- </execution>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- <excludes>
- <exclude>**/*StressTest.java</exclude>
- <exclude>**/*$*.java</exclude>
- </excludes>
- <includes>
- <include>**/*Integration*Test.java</include>
- </includes>
- <systemProperties>
- <property>
- <name>log4j.configuration</name>
- <value>integration-test-log4j.xml</value>
- </property>
- </systemProperties>
- </configuration>
-
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>skip.tests</id>
- <activation>
- <property>
- <name>!jboss.bind.address</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>use.endorsed.dir</id>
- <activation>
- <property>
- <name>endorsed.dir</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Djava.endorsed.dirs=${endorsed.dir}</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>stress.tests</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>wise.stress.threads</name>
- <value>300</value>
- </property>
- <property>
- <name>wise.stress.threadPoolSize</name>
- <value>50</value>
- </property>
- <property>
- <name>wise.stress.expensive.threads</name>
- <value>30</value>
- </property>
- <property>
- <name>wise.stress.expensive.threadPoolSize</name>
- <value>5</value>
- </property>
- </systemProperties>
- <excludes>
- <exclude>**/*Integration*Test.java</exclude>
- <exclude>**/*$*.java</exclude>
- </excludes>
- <includes>
- <include>**/*StressTest.java</include>
- </includes>
-
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <profiles/>
</project>
Copied: core/trunk/integration-testsuite/native (from rev 398, core/trunk/integration-native)
Deleted: core/trunk/integration-testsuite/native/pom.xml
===================================================================
--- core/trunk/integration-native/pom.xml 2010-09-09 17:48:04 UTC (rev 398)
+++ core/trunk/integration-testsuite/native/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
@@ -1,270 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to you under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for
- the specific language governing permissions and limitations under the
- License.
--->
-<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">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.wise</groupId>
- <artifactId>wise-integration-native</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <name>Wise Integration - Native</name>
- <url>http://www.jboss.org/wise</url>
-
- <packaging>jar</packaging>
-
- <parent>
- <groupId>org.jboss.wise</groupId>
- <artifactId>wise</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.wise</groupId>
- <artifactId>wise-core-native</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbossall-client</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <executions>
- <execution>
- <id>war-wsse</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webXml>${basedir}/src/test/resources/WEB-INF/wsse/web.xml</webXml>
- <warName>wsse</warName>
- <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
- <webappDirectory>${project.build.directory}/wsse</webappDirectory>
- <warSourceExcludes>**/lib/**</warSourceExcludes>
- <webResources>
- <webResource>
- <targetPath>WEB-INF/classes</targetPath>
- <directory>${basedir}/target/test-classes/</directory>
- <includes>
- <include>**/wsse/*.class</include>
- </includes>
- <excludes>
- <exclude>**/*Test.class</exclude>
- </excludes>
- </webResource>
- <webResource>
- <targetPath>WEB-INF</targetPath>
- <directory>${basedir}/src/test/resources/WEB-INF/wsse/</directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- </webResource>
- </webResources>
- </configuration>
- </execution>
- <execution>
- <id>war-wsaddress</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webXml>${basedir}/src/test/resources/WEB-INF/wsa/web.xml</webXml>
- <warName>wsa</warName>
- <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
- <webappDirectory>${project.build.directory}/wsa</webappDirectory>
- <warSourceExcludes>**/lib/**</warSourceExcludes>
- <webResources>
- <webResource>
- <targetPath>WEB-INF/classes</targetPath>
- <directory>${basedir}/target/test-classes/
- </directory>
- <includes>
- <include>**/wsaddressing/*.class</include>
- </includes>
- <excludes>
- <exclude>**/*Test.class</exclude>
- </excludes>
- </webResource>
- </webResources>
- </configuration>
- </execution>
- <execution>
- <id>war-wsaandwsse</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webXml>${basedir}/src/test/resources/WEB-INF/wsaandwsse/web.xml</webXml>
- <warName>wsaandwsse</warName>
- <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
- <webappDirectory>${project.build.directory}/wsaandwsse</webappDirectory>
- <warSourceExcludes>**/lib/**</warSourceExcludes>
- <webResources>
- <webResource>
- <targetPath>WEB-INF/classes</targetPath>
- <directory>${basedir}/target/test-classes/</directory>
- <includes>
- <include>**/wsaandwsse/*.class</include>
- <include>**/wsaandwsse/handlers.xml</include>
- </includes>
- <excludes>
- <exclude>**/*Test.class</exclude>
- </excludes>
- </webResource>
- <webResource>
- <targetPath>WEB-INF</targetPath>
- <directory>${basedir}/src/test/resources/WEB-INF/wsaandwsse/</directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- </webResource>
- </webResources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <executions>
- <execution>
- <id>unit-tests</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- <excludes>
- <exclude>**/integration/**/*Test.java</exclude>
- <exclude>**/*StressTest.java</exclude>
- <exclude>**/*$*.java</exclude>
- </excludes>
- </configuration>
- </execution>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- <excludes>
- <exclude>**/*StressTest.java</exclude>
- <exclude>**/*$*.java</exclude>
- </excludes>
- <includes>
- <include>**/*Integration*Test.java</include>
- </includes>
- <systemProperties>
- <property>
- <name>log4j.configuration</name>
- <value>integration-test-log4j.xml</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <header>JBoss Wise API</header>
- <footer>JBoss Wise API</footer>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
- <profiles>
- <profile>
- <id>skip.tests</id>
- <activation>
- <property>
- <name>!jboss.bind.address</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
Copied: core/trunk/integration-testsuite/native/pom.xml (from rev 401, core/trunk/integration-native/pom.xml)
===================================================================
--- core/trunk/integration-testsuite/native/pom.xml (rev 0)
+++ core/trunk/integration-testsuite/native/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
@@ -0,0 +1,152 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>Wise Integration Native Test</name>
+ <artifactId>wise-integration-native</artifactId>
+
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-integration-testsuite</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-core-native</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>war-wsse</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/wsse/web.xml</webXml>
+ <warName>wsse</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/wsse</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/</directory>
+ <includes>
+ <include>**/wsse/*.class</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ <webResource>
+ <targetPath>WEB-INF</targetPath>
+ <directory>${basedir}/src/test/resources/WEB-INF/wsse/</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>war-wsaddress</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/wsa/web.xml</webXml>
+ <warName>wsa</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/wsa</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/
+ </directory>
+ <includes>
+ <include>**/wsaddressing/*.class</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>war-wsaandwsse</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/wsaandwsse/web.xml</webXml>
+ <warName>wsaandwsse</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/wsaandwsse</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/</directory>
+ <includes>
+ <include>**/wsaandwsse/*.class</include>
+ <include>**/wsaandwsse/handlers.xml</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ <webResource>
+ <targetPath>WEB-INF</targetPath>
+ <directory>${basedir}/src/test/resources/WEB-INF/wsaandwsse/</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles/>
+
+</project>
Added: core/trunk/integration-testsuite/pom.xml
===================================================================
--- core/trunk/integration-testsuite/pom.xml (rev 0)
+++ core/trunk/integration-testsuite/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
@@ -0,0 +1,197 @@
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+ -->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>Wise Integration Test</name>
+ <artifactId>wise-integration-testsuite</artifactId>
+ <packaging>pom</packaging>
+
+ <parent>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modules>
+ <module>common</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-core</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbossall-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>unit-tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <excludes>
+ <exclude>**/*Test.java</exclude>
+ <exclude>**/*StressTest.java</exclude>
+ <exclude>**/*$*.java</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <excludes>
+ <exclude>**/*StressTest.java</exclude>
+ <exclude>**/*$*.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*Integration*Test.java</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>log4j.configuration</name>
+ <value>integration-test-log4j.xml</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>!cxf.stack</name>
+ </property>
+ </activation>
+ <modules>
+ <module>native</module>
+ </modules>
+ </profile>
+ <profile>
+ <id>use.endorsed.dir</id>
+ <activation>
+ <property>
+ <name>endorsed.dir</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>-Djava.endorsed.dirs=${endorsed.dir}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>stress.tests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>wise.stress.threads</name>
+ <value>300</value>
+ </property>
+ <property>
+ <name>wise.stress.threadPoolSize</name>
+ <value>50</value>
+ </property>
+ <property>
+ <name>wise.stress.expensive.threads</name>
+ <value>30</value>
+ </property>
+ <property>
+ <name>wise.stress.expensive.threadPoolSize</name>
+ <value>5</value>
+ </property>
+ </systemProperties>
+ <excludes>
+ <exclude>**/*Integration*Test.java</exclude>
+ <exclude>**/*$*.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*StressTest.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-09-10 07:58:58 UTC (rev 401)
+++ core/trunk/pom.xml 2010-09-10 10:00:23 UTC (rev 402)
@@ -84,7 +84,6 @@
<modules>
<module>core</module>
- <module>integration</module>
</modules>
<dependencyManagement>
@@ -540,7 +539,6 @@
</activation>
<modules>
<module>core-native</module>
- <module>integration-native</module>
</modules>
<dependencies>
<dependency>
@@ -567,6 +565,19 @@
</dependency>
</dependencies>
</profile>
+
+ <profile>
+ <id>integration-testsuite</id>
+ <activation>
+ <property>
+ <name>jboss.bind.address</name>
+ </property>
+ </activation>
+ <modules>
+ <module>integration-testsuite</module>
+ </modules>
+ </profile>
+
</profiles>
14 years, 4 months
wise SVN: r401 - core/trunk/integration-native.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-10 03:58:58 -0400 (Fri, 10 Sep 2010)
New Revision: 401
Modified:
core/trunk/integration-native/pom.xml
Log:
[WISE-169] Removing useless plugins for integration-native module
Modified: core/trunk/integration-native/pom.xml
===================================================================
--- core/trunk/integration-native/pom.xml 2010-09-10 07:41:23 UTC (rev 400)
+++ core/trunk/integration-native/pom.xml 2010-09-10 07:58:58 UTC (rev 401)
@@ -156,7 +156,6 @@
</execution>
</executions>
</plugin>
-
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@@ -203,38 +202,7 @@
</execution>
</executions>
</plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <header>JBoss Wise API</header>
- <footer>JBoss Wise API</footer>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
-
</build>
<profiles>
14 years, 4 months
wise SVN: r400 - core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-10 03:41:23 -0400 (Fri, 10 Sep 2010)
New Revision: 400
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WiseEntityResolver.java
Log:
[WISE-169] Fix WiseEntityResolver for avoiding dependency on the jbossws resolver, fixing failures with CXF stack
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WiseEntityResolver.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WiseEntityResolver.java 2010-09-10 07:04:16 UTC (rev 399)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WiseEntityResolver.java 2010-09-10 07:41:23 UTC (rev 400)
@@ -27,14 +27,15 @@
import java.net.URL;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.util.xml.JBossEntityResolver;
import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
*
* @author alessio.soldano(a)jboss.com
*/
-public class WiseEntityResolver extends JBossWSEntityResolver {
+public class WiseEntityResolver extends JBossEntityResolver {
// provide logging
private static final Logger log = Logger.getLogger(WiseEntityResolver.class);
@@ -44,7 +45,25 @@
super();
this.connection = connection;
}
+
+ @Override
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
+ {
+ if(log.isTraceEnabled()) log.trace("resolveEntity: [pub=" + publicId + ",sysid=" + systemId + "]");
+ InputSource inputSource = super.resolveEntity(publicId, systemId);
+ if (inputSource == null)
+ inputSource = resolveSystemIDAsURL(systemId, log.isTraceEnabled());
+
+ if (inputSource == null)
+ {
+ if (log.isDebugEnabled())
+ log.debug("Cannot resolve entity: [pub=" + publicId + ",sysid=" + systemId + "]");
+ }
+
+ return inputSource;
+ }
+
/**
* Use a ResourceURL to access the resource. This method should be protected
* in the super class.
@@ -53,7 +72,6 @@
* @param trace
* @return an InputSource
*/
- @Override
protected InputSource resolveSystemIDAsURL(String id, boolean trace) {
if (id == null)
return null;
14 years, 4 months
wise SVN: r399 - in core/trunk/integration/src/test: resources/WEB-INF and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-10 03:04:16 -0400 (Fri, 10 Sep 2010)
New Revision: 399
Removed:
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/
core/trunk/integration/src/test/resources/WEB-INF/wsa/
core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/
core/trunk/integration/src/test/resources/WEB-INF/wsse/
Log:
Removing empty dirs
14 years, 4 months
wise SVN: r398 - in core/trunk: integration and 24 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-09 13:48:04 -0400 (Thu, 09 Sep 2010)
New Revision: 398
Added:
core/trunk/integration-native/
core/trunk/integration-native/pom.xml
core/trunk/integration-native/src/
core/trunk/integration-native/src/main/
core/trunk/integration-native/src/main/java/
core/trunk/integration-native/src/main/resources/
core/trunk/integration-native/src/test/
core/trunk/integration-native/src/test/java/
core/trunk/integration-native/src/test/java/org/
core/trunk/integration-native/src/test/java/org/jboss/
core/trunk/integration-native/src/test/java/org/jboss/wise/
core/trunk/integration-native/src/test/java/org/jboss/wise/test/
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java
core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java
core/trunk/integration-native/src/test/resources/
core/trunk/integration-native/src/test/resources/WEB-INF/
core/trunk/integration-native/src/test/resources/WEB-INF/wsa/
core/trunk/integration-native/src/test/resources/WEB-INF/wsa/web.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/
core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/web.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore
core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore
core/trunk/integration-native/src/test/resources/WEB-INF/wsse/
core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsse/web.xml
core/trunk/integration-native/src/test/resources/WEB-INF/wsse/wsse.keystore
core/trunk/integration-native/src/test/resources/WEB-INF/wsse/wsse.truststore
core/trunk/integration-native/src/test/resources/integration-test-log4j.xml
core/trunk/integration-native/src/test/resources/jndi.properties
Removed:
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java
core/trunk/integration/src/test/resources/WEB-INF/wsa/web.xml
core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml
core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml
core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/web.xml
core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore
core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore
core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml
core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml
core/trunk/integration/src/test/resources/WEB-INF/wsse/web.xml
core/trunk/integration/src/test/resources/WEB-INF/wsse/wsse.keystore
core/trunk/integration/src/test/resources/WEB-INF/wsse/wsse.truststore
Modified:
core/trunk/integration/pom.xml
core/trunk/pom.xml
Log:
[WISE-169] Moving jbossws-native specific integration tests to integration-native module
Modified: core/trunk/integration/pom.xml
===================================================================
--- core/trunk/integration/pom.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/pom.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,4 +1,3 @@
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -52,22 +51,18 @@
<version>${version}</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>jboss</groupId>
<artifactId>jbossall-client</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<scope>test</scope>
</dependency>
-
</dependencies>
-
<build>
<plugins>
<plugin>
@@ -124,42 +119,7 @@
</webResources>
</configuration>
</execution>
-
<execution>
- <id>war-wsse</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webXml>${basedir}/src/test/resources/WEB-INF/wsse/web.xml</webXml>
- <warName>wsse</warName>
- <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
- <webappDirectory>${project.build.directory}/wsse</webappDirectory>
- <warSourceExcludes>**/lib/**</warSourceExcludes>
- <webResources>
- <webResource>
- <targetPath>WEB-INF/classes</targetPath>
- <directory>${basedir}/target/test-classes/</directory>
- <includes>
- <include>**/wsse/*.class</include>
- </includes>
- <excludes>
- <exclude>**/*Test.class</exclude>
- </excludes>
- </webResource>
- <webResource>
- <targetPath>WEB-INF</targetPath>
- <directory>${basedir}/src/test/resources/WEB-INF/wsse/</directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- </webResource>
- </webResources>
- </configuration>
- </execution>
-
- <execution>
<id>war-wsdlResolver</id>
<phase>pre-integration-test</phase>
<goals>
@@ -192,71 +152,7 @@
</webResources>
</configuration>
</execution>
-
<execution>
- <id>war-wsaddress</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webXml>${basedir}/src/test/resources/WEB-INF/wsa/web.xml</webXml>
- <warName>wsa</warName>
- <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
- <webappDirectory>${project.build.directory}/wsa</webappDirectory>
- <warSourceExcludes>**/lib/**</warSourceExcludes>
- <webResources>
- <webResource>
- <targetPath>WEB-INF/classes</targetPath>
- <directory>${basedir}/target/test-classes/
- </directory>
- <includes>
- <include>**/wsaddressing/*.class</include>
- </includes>
- <excludes>
- <exclude>**/*Test.class</exclude>
- </excludes>
- </webResource>
- </webResources>
- </configuration>
- </execution>
-
- <execution>
- <id>war-wsaandwsse</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webXml>${basedir}/src/test/resources/WEB-INF/wsaandwsse/web.xml</webXml>
- <warName>wsaandwsse</warName>
- <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
- <webappDirectory>${project.build.directory}/wsaandwsse</webappDirectory>
- <warSourceExcludes>**/lib/**</warSourceExcludes>
- <webResources>
- <webResource>
- <targetPath>WEB-INF/classes</targetPath>
- <directory>${basedir}/target/test-classes/</directory>
- <includes>
- <include>**/wsaandwsse/*.class</include>
- <include>**/wsaandwsse/handlers.xml</include>
- </includes>
- <excludes>
- <exclude>**/*Test.class</exclude>
- </excludes>
- </webResource>
- <webResource>
- <targetPath>WEB-INF</targetPath>
- <directory>${basedir}/src/test/resources/WEB-INF/wsaandwsse/</directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- </webResource>
- </webResources>
-
- </configuration>
- </execution>
- <execution>
<id>war-smooks</id>
<phase>pre-integration-test</phase>
<goals>
@@ -284,7 +180,6 @@
</execution>
</executions>
</plugin>
-
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@@ -333,29 +228,9 @@
</executions>
</plugin>
</plugins>
-
</build>
+
<profiles>
-
- <profile>
- <id>native</id>
- <activation>
- <property>
- <name>!cxf.stack</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.wise</groupId>
- <artifactId>wise-core-native</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
-
-
-
<profile>
<id>skip.tests</id>
<activation>
@@ -383,7 +258,6 @@
</plugins>
</build>
</profile>
-
<profile>
<id>use.endorsed.dir</id>
<activation>
@@ -402,7 +276,6 @@
</plugins>
</build>
</profile>
-
<profile>
<id>stress.tests</id>
<build>
@@ -447,7 +320,6 @@
</execution>
</executions>
</plugin>
-
</plugins>
</build>
</profile>
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsaandwsse;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.jboss.wise.core.client.InvocationResult;
-import org.jboss.wise.core.client.WSDynamicClient;
-import org.jboss.wise.core.client.WSMethod;
-import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
-import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
-import org.jboss.wise.core.handlers.LoggingHandler;
-import org.jboss.wise.core.test.WiseTest;
-import org.jboss.wise.core.wsextensions.impl.WSAddressingEnabler;
-import org.jboss.wise.core.wsextensions.impl.WSSecurityEnabler;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class WSAANDWSSEIntegrationTest extends WiseTest {
- private URL warUrl = null;
-
- @Before
- public void setUp() throws Exception {
- warUrl = this.getClass().getClassLoader().getResource("wsaandwsse.war");
- deployWS(warUrl);
-
- }
-
- @Test
- public void shouldRunWithoutMK() throws Exception {
- URL wsdlURL = new URL(getServerHostAndPort() + "/wsaandwsse/WSAandWSSE?wsdl");
-
- WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
- WSDynamicClient client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true)
- .securityConfigUrl("WEB-INF/wsaandwsse/jboss-wsse-client.xml").securityConfigName("Standard WSSecurity Client")
- .wsdlURL(wsdlURL.toString()).build();
-
- WSMethod method = client.getWSMethod("WSAandWSSEService", "WSAandWSSEImplPort", "echoUserType");
-
- method.getEndpoint().addWSExtension(new WSSecurityEnabler(client));
- method.getEndpoint().addWSExtension(new WSAddressingEnabler(client));
- method.getEndpoint().addHandler(new LoggingHandler());
- HashMap<String, Object> requestMap = new HashMap<String, Object>();
- requestMap.put("user", "SpiderMan");
- InvocationResult result = method.invoke(requestMap, null);
- System.out.println(result.getMapRequestAndResult(null, null));
- Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
- client.close();
- Assert.assertEquals("Hello WSAddressingAndWSSecurity SpiderMan", results.get("result"));
- }
-
- @After
- public void tearDown() throws Exception {
- undeployWS(warUrl);
- }
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsaandwsse;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.3-b02-
- * Generated source version: 2.0
- *
- */
-@WebService(name = "WSAandWSSE", targetNamespace = "http://org.jboss/wise/wssecurity")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface WSAandWSSE {
-
-
- /**
- *
- * @param user
- * @return
- * returns java.lang.String
- */
- @WebMethod
- @WebResult(partName = "return")
- public String echoUserType(
- @WebParam(name = "user", partName = "user")
- String user);
-
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsaandwsse;
-
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-import org.jboss.ws.annotation.EndpointConfig;
-
-@WebService(endpointInterface = "org.jboss.wise.test.integration.wsaandwsse.WSAandWSSE", targetNamespace = "http://org.jboss/wise/wssecurity", serviceName = "WSAandWSSEService")
-@EndpointConfig(configName = "Standard WSSecurity Endpoint")
-@HandlerChain(file = "handlers.xml")
-public class WSAandWSSEImpl implements WSAandWSSE {
- public String echoUserType(String user) {
- return "Hello WSAddressingAndWSSecurity " + user;
- }
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
-
- <handler-chain>
- <protocol-bindings>##SOAP11_HTTP</protocol-bindings>
- <handler>
- <handler-name>WSAddressing Handler</handler-name>
- <handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</handler-class>
- </handler>
- </handler-chain>
-
-</handler-chains>
\ No newline at end of file
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsaddressing;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- * @since 23-Dic-2008
- *
- */
-@WebService( name = "Hello", targetNamespace = "http://org.jboss/wise/wsaddressing" )
-@SOAPBinding( style = SOAPBinding.Style.RPC )
-public interface Hello {
-
- @WebMethod
- @WebResult( partName = "return" )
- public String echoUserType( @WebParam( name = "user", partName = "user" )
- String user );
-
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsaddressing;
-
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-import org.jboss.ws.annotation.EndpointConfig;
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- * @since 23-Dic-2008
- *
- */
-
-@WebService( endpointInterface = "org.jboss.wise.test.integration.wsaddressing.Hello", targetNamespace = "http://org.jboss/wise/wsa", serviceName = "HelloService" )
-@EndpointConfig( configName = "Standard WSAddressing Endpoint" )
-@Stateless
-public class HelloImpl implements Hello {
-
- public String echoUserType( String user ) {
- return "Hello WSAddressing";
- }
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsaddressing;
-
-import java.net.URL;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.jboss.wise.core.client.InvocationResult;
-import org.jboss.wise.core.client.WSDynamicClient;
-import org.jboss.wise.core.client.WSEndpoint;
-import org.jboss.wise.core.client.WSMethod;
-import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
-import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
-import org.jboss.wise.core.handlers.LoggingHandler;
-import org.jboss.wise.core.test.WiseTest;
-import org.jboss.wise.core.wsextensions.impl.WSAddressingEnabler;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests WS-Addressing extension in Wise
- *
- * @author alessio.soldano(a)jboss.com
- * @since 23-Dic-2008
- */
-public class WSAddressingIntegrationTest extends WiseTest {
- private URL warUrl = null;
-
- @Before
- public void setUp() throws Exception {
- warUrl = this.getClass().getClassLoader().getResource("wsa.war");
- deployWS(warUrl);
- }
-
- @Test
- @SuppressWarnings("unchecked")
- public void shouldRunWithoutMK() throws Exception {
- URL wsdlURL = new URL(getServerHostAndPort() + "/wsa/Hello?wsdl");
-
- WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
- WSDynamicClient client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true).wsdlURL(wsdlURL
- .toString()).build();
- WSMethod method = client.getWSMethod("HelloService", "HelloImplPort", "echoUserType");
- WSEndpoint wsEndpoint = method.getEndpoint();
-
- wsEndpoint.addWSExtension(new WSAddressingEnabler(client));
- wsEndpoint.addHandler(new LoggingHandler());
-
- Map<String, Object> args = new java.util.HashMap<String, Object>();
- args.put("user", "test");
- InvocationResult result = method.invoke(args, null);
- Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
- client.close();
- Assert.assertEquals("Hello WSAddressing", results.get("result"));
- }
-
- @After
- public void tearDown() throws Exception {
- undeployWS(warUrl);
- }
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsse;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.3-b02-
- * Generated source version: 2.0
- *
- */
-@WebService(name = "Hello", targetNamespace = "http://org.jboss/wise/wssecurity")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface Hello {
-
-
- /**
- *
- * @param user
- * @return
- * returns java.lang.String
- */
- @WebMethod
- @WebResult(partName = "return")
- public String echoUserType(
- @WebParam(name = "user", partName = "user")
- String user);
-
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsse;
-
-import javax.jws.WebService;
-import org.jboss.ws.annotation.EndpointConfig;
-@WebService( endpointInterface = "org.jboss.wise.test.integration.wsse.Hello", targetNamespace = "http://org.jboss/wise/wssecurity", serviceName = "HelloService" )
-@EndpointConfig(configName = "Standard WSSecurity Endpoint")
-public class HelloImpl implements Hello {
- public String echoUserType(String user) {
- return "Hello WSSecurity";
- }
-}
Deleted: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.test.integration.wsse;
-
-import java.net.URL;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.jboss.wise.core.client.InvocationResult;
-import org.jboss.wise.core.client.WSDynamicClient;
-import org.jboss.wise.core.client.WSEndpoint;
-import org.jboss.wise.core.client.WSMethod;
-import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
-import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
-import org.jboss.wise.core.handlers.LoggingHandler;
-import org.jboss.wise.core.test.WiseTest;
-import org.jboss.wise.core.wsextensions.impl.WSSecurityEnabler;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class WSSEIntegrationTest extends WiseTest {
- private URL warUrl = null;
-
- @Before
- public void setUp() throws Exception {
- warUrl = this.getClass().getClassLoader().getResource("wsse.war");
- deployWS(warUrl);
-
- }
-
- @Test
- public void shouldRunWithoutMK() throws Exception {
- URL wsdlURL = new URL(getServerHostAndPort() + "/wsse/HelloWorld?wsdl");
-
- WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
- WSDynamicClient client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true)
- .securityConfigUrl("WEB-INF/wsaandwsse/jboss-wsse-client.xml").securityConfigName("Standard WSSecurity Client")
- .wsdlURL(wsdlURL.toString()).build();
-
- WSMethod method = client.getWSMethod("HelloService", "HelloImplPort", "echoUserType");
- WSEndpoint wsEndpoint = method.getEndpoint();
-
- wsEndpoint.addHandler(new LoggingHandler());
-
- wsEndpoint.addWSExtension(new WSSecurityEnabler(client));
-
- Map<String, Object> args = new java.util.HashMap<String, Object>();
- args.put("user", "test");
- InvocationResult result = method.invoke(args, null);
- Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
- client.close();
- Assert.assertEquals("Hello WSSecurity", results.get("result"));
- }
-
- @After
- public void tearDown() throws Exception {
- undeployWS(warUrl);
- }
-}
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsa/web.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsa/web.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsa/web.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <servlet>
- <servlet-name>Hello</servlet-name>
- <servlet-class>org.jboss.wise.test.integration.wsaddressing.HelloImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>Hello</servlet-name>
- <url-pattern>/Hello</url-pattern>
- </servlet-mapping>
-
-</web-app>
-
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
- <key-store-file>WEB-INF/wsaandwsse/wsse.keystore</key-store-file>
- <key-store-type>jks</key-store-type>
- <key-store-password>jbossws</key-store-password>
- <trust-store-file>WEB-INF/wsaandwsse/wsse.truststore</trust-store-file>
- <trust-store-type>jks</trust-store-type>
- <trust-store-password>jbossws</trust-store-password>
- <config>
-
- <encrypt type="x509v3" alias="wsse"/>
- <requires>
- <encryption/>
- </requires>
- </config>
-</jboss-ws-security>
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
- <key-store-file>WEB-INF/wsse.keystore</key-store-file>
- <key-store-password>jbossws</key-store-password>
- <trust-store-file>WEB-INF/wsse.truststore</trust-store-file>
- <trust-store-password>jbossws</trust-store-password>
- <config>
- <encrypt type="x509v3" alias="wsse"/>
- <requires>
- <encryption/>
- </requires>
- </config>
-</jboss-ws-security>
\ No newline at end of file
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/web.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/web.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/web.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <servlet>
- <servlet-name>WSAandWSSE</servlet-name>
- <servlet-class>org.jboss.wise.test.integration.wsaandwsse.WSAandWSSEImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>WSAandWSSE</servlet-name>
- <url-pattern>/WSAandWSSE</url-pattern>
- </servlet-mapping>
-
-</web-app>
-
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,69 +0,0 @@
-����
-+*
-������P��s!����4`���ߵ�BU�Mˢv9�g�G�)�+76t�[{E�m�b*�ۜ�Eݰ�Dk�u��A��NC�\afJ���28�=�^,A���p�l��=g�"k����??�����Dl�NO�b3�i�W����ZѼD��O���=z{��K_ˍ���~Ӱ>�Z��������w�݄���8LR�gC��L�|
-�5�,�&�eR���M�7��M�K܃L�*����^�_���筝�ʌ�R)R5v^���p��D9��y$��
-�
-�'k�W9E�A_ZG�T��B}K77]J;C�5ad�[��� ��h$iU4��i|5ȴ�w�=�x���<(M*k�#��((���e&��$�
-�[��Z)'������\�RH��C���Q/��֖�����Z�����bb����T*p}m�%�ΆwB���q�>���z���e�
-�G�-N��B`��XkjV��OZy*����,�UD5i���Z��8��Hc3�
-�}�����;t�ʊvl�
-�|s����:V6F7 l��:�^�LG;ڂyM��ƒ�\+�J� ��<�B��V�D��Aϥ��.Ԉ\�0�r-�-��
-�J�kڀK)��~�M{�\��q�s�&9`Jx����u�<����}�o[��>�QK���/��~s'h�#ݼG�@\9h
-{{�0v��ʑ:����Ps��~��GQ'�8�`��f�k����.��J�`8DE��;[8��F!�x~옼��1��3���e��ލ�&�g��/�
-�|����n��A�0�\i��:!��h��m=��(ݤy���v�{p���� bO|u1�Xr���=��k�<�A��2�
-Washington10USnoqualmie Pass10U
-
-JBoss Inc.10 UQA10U jboss.com10 *�H��
- admin(a)jboss.com0
-050915000941Z
-150913000941Z0��10 UUS10U
-Washington10U
-
-JBoss Inc.10UDevelopment10UJason Greene1%0# *�H��
- jason.greene@jboss.com0�"0
- *�H��
-
-�
->�"�t���&*u*��3��>�|/�1�W�x$�Bk�Nt6�2u���
-��Dg
-wjQ�<�E���e6M��v`�������}Dk�k�gk���.���$�Ἀ�T��p��w�
-Washington10USnoqualmie Pass10U
-
-JBoss Inc.10 UQA10U jboss.com10 *�H��
- admin@jboss.com�
-G�y���2y��8�bP�b��M�
-Some-State10
-U
-SUN10
-UJWS10URootCA 20050
-050412053207Z
-060412053207Z0O10 UAU10U
-Some-State10
-U
-SUN10
-UJWS10
-UClient0��0
- *�H��
-
-�W�Ĺn9b|RC��J��^\B�H��˖Й06Q�cBjdr_l����2C-ͱ
-�����t�P~d2Ǣh���[X�ٮw��U�+�`�Y2>S�b0bݫ�P�o
-Some-State10
-U
-SUN10
-UJWS10URootCA 2005�
-��e��vW��uEl��r�����}�,@�tX���?e��IOe����!�K
\ No newline at end of file
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,34 +0,0 @@
-����
-�0
- *�H��
-
-S
-Washington10USnoqualmie Pass10U
-
-JBoss Inc.10 UQA10U jboss.com10 *�H��
- admin(a)jboss.com0
-050802205208Z
-321218205208Z0��10 UUS10U
-Washington10USnoqualmie Pass10U
-
-JBoss Inc.10 UQA10U jboss.com10 *�H��
- admin@jboss.com0��0
- *�H��
-
-Washington10USnoqualmie Pass10U
-
-JBoss Inc.10 UQA10U jboss.com10 *�H��
- admin@jboss.com�
\ No newline at end of file
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
- <key-store-file>WEB-INF/wsse/wsse.keystore</key-store-file>
- <key-store-type>jks</key-store-type>
- <key-store-password>jbossws</key-store-password>
- <trust-store-file>WEB-INF/wsse/wsse.truststore</trust-store-file>
- <trust-store-type>jks</trust-store-type>
- <trust-store-password>jbossws</trust-store-password>
- <config>
-
- <encrypt type="x509v3" alias="wsse"/>
- <requires>
- <encryption/>
- </requires>
- </config>
-</jboss-ws-security>
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
- <key-store-file>WEB-INF/wsse.keystore</key-store-file>
- <key-store-password>jbossws</key-store-password>
- <trust-store-file>WEB-INF/wsse.truststore</trust-store-file>
- <trust-store-password>jbossws</trust-store-password>
- <config>
- <encrypt type="x509v3" alias="wsse"/>
- <requires>
- <encryption/>
- </requires>
- </config>
-</jboss-ws-security>
\ No newline at end of file
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsse/web.xml
===================================================================
--- core/trunk/integration/src/test/resources/WEB-INF/wsse/web.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/integration/src/test/resources/WEB-INF/wsse/web.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <servlet>
- <servlet-name>HelloWorld</servlet-name>
- <servlet-class>org.jboss.wise.test.integration.wsse.HelloImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>HelloWorld</servlet-name>
- <url-pattern>/HelloWorld</url-pattern>
- </servlet-mapping>
-
-</web-app>
-
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsse/wsse.keystore
===================================================================
(Binary files differ)
Deleted: core/trunk/integration/src/test/resources/WEB-INF/wsse/wsse.truststore
===================================================================
(Binary files differ)
Property changes on: core/trunk/integration-native
___________________________________________________________________
Name: svn:ignore
+ target
.project
.classpath
.settings
Added: core/trunk/integration-native/pom.xml
===================================================================
--- core/trunk/integration-native/pom.xml (rev 0)
+++ core/trunk/integration-native/pom.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,270 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-integration-native</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <name>Wise Integration - Native</name>
+ <url>http://www.jboss.org/wise</url>
+
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-core-native</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbossall-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>war-wsse</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/wsse/web.xml</webXml>
+ <warName>wsse</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/wsse</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/</directory>
+ <includes>
+ <include>**/wsse/*.class</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ <webResource>
+ <targetPath>WEB-INF</targetPath>
+ <directory>${basedir}/src/test/resources/WEB-INF/wsse/</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>war-wsaddress</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/wsa/web.xml</webXml>
+ <warName>wsa</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/wsa</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/
+ </directory>
+ <includes>
+ <include>**/wsaddressing/*.class</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>war-wsaandwsse</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/wsaandwsse/web.xml</webXml>
+ <warName>wsaandwsse</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/wsaandwsse</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/</directory>
+ <includes>
+ <include>**/wsaandwsse/*.class</include>
+ <include>**/wsaandwsse/handlers.xml</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ <webResource>
+ <targetPath>WEB-INF</targetPath>
+ <directory>${basedir}/src/test/resources/WEB-INF/wsaandwsse/</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>unit-tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <excludes>
+ <exclude>**/integration/**/*Test.java</exclude>
+ <exclude>**/*StressTest.java</exclude>
+ <exclude>**/*$*.java</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <excludes>
+ <exclude>**/*StressTest.java</exclude>
+ <exclude>**/*$*.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*Integration*Test.java</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>log4j.configuration</name>
+ <value>integration-test-log4j.xml</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <header>JBoss Wise API</header>
+ <footer>JBoss Wise API</footer>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <profiles>
+ <profile>
+ <id>skip.tests</id>
+ <activation>
+ <property>
+ <name>!jboss.bind.address</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsaandwsse;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.handlers.LoggingHandler;
+import org.jboss.wise.core.test.WiseTest;
+import org.jboss.wise.core.wsextensions.impl.WSAddressingEnabler;
+import org.jboss.wise.core.wsextensions.impl.WSSecurityEnabler;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class WSAANDWSSEIntegrationTest extends WiseTest {
+ private URL warUrl = null;
+
+ @Before
+ public void setUp() throws Exception {
+ warUrl = this.getClass().getClassLoader().getResource("wsaandwsse.war");
+ deployWS(warUrl);
+
+ }
+
+ @Test
+ public void shouldRunWithoutMK() throws Exception {
+ URL wsdlURL = new URL(getServerHostAndPort() + "/wsaandwsse/WSAandWSSE?wsdl");
+
+ WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+ WSDynamicClient client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true)
+ .securityConfigUrl("WEB-INF/wsaandwsse/jboss-wsse-client.xml").securityConfigName("Standard WSSecurity Client")
+ .wsdlURL(wsdlURL.toString()).build();
+
+ WSMethod method = client.getWSMethod("WSAandWSSEService", "WSAandWSSEImplPort", "echoUserType");
+
+ method.getEndpoint().addWSExtension(new WSSecurityEnabler(client));
+ method.getEndpoint().addWSExtension(new WSAddressingEnabler(client));
+ method.getEndpoint().addHandler(new LoggingHandler());
+ HashMap<String, Object> requestMap = new HashMap<String, Object>();
+ requestMap.put("user", "SpiderMan");
+ InvocationResult result = method.invoke(requestMap, null);
+ System.out.println(result.getMapRequestAndResult(null, null));
+ Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
+ client.close();
+ Assert.assertEquals("Hello WSAddressingAndWSSecurity SpiderMan", results.get("result"));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ undeployWS(warUrl);
+ }
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSE.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsaandwsse;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.3-b02-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "WSAandWSSE", targetNamespace = "http://org.jboss/wise/wssecurity")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface WSAandWSSE {
+
+
+ /**
+ *
+ * @param user
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ public String echoUserType(
+ @WebParam(name = "user", partName = "user")
+ String user);
+
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsaandwsse;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+import org.jboss.ws.annotation.EndpointConfig;
+
+@WebService(endpointInterface = "org.jboss.wise.test.integration.wsaandwsse.WSAandWSSE", targetNamespace = "http://org.jboss/wise/wssecurity", serviceName = "WSAandWSSEService")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+@HandlerChain(file = "handlers.xml")
+public class WSAandWSSEImpl implements WSAandWSSE {
+ public String echoUserType(String user) {
+ return "Hello WSAddressingAndWSSecurity " + user;
+ }
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaandwsse/handlers.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <protocol-bindings>##SOAP11_HTTP</protocol-bindings>
+ <handler>
+ <handler-name>WSAddressing Handler</handler-name>
+ <handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/Hello.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsaddressing;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dic-2008
+ *
+ */
+@WebService( name = "Hello", targetNamespace = "http://org.jboss/wise/wsaddressing" )
+@SOAPBinding( style = SOAPBinding.Style.RPC )
+public interface Hello {
+
+ @WebMethod
+ @WebResult( partName = "return" )
+ public String echoUserType( @WebParam( name = "user", partName = "user" )
+ String user );
+
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/HelloImpl.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsaddressing;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import org.jboss.ws.annotation.EndpointConfig;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dic-2008
+ *
+ */
+
+@WebService( endpointInterface = "org.jboss.wise.test.integration.wsaddressing.Hello", targetNamespace = "http://org.jboss/wise/wsa", serviceName = "HelloService" )
+@EndpointConfig( configName = "Standard WSAddressing Endpoint" )
+@Stateless
+public class HelloImpl implements Hello {
+
+ public String echoUserType( String user ) {
+ return "Hello WSAddressing";
+ }
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsaddressing/WSAddressingIntegrationTest.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsaddressing;
+
+import java.net.URL;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSEndpoint;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.handlers.LoggingHandler;
+import org.jboss.wise.core.test.WiseTest;
+import org.jboss.wise.core.wsextensions.impl.WSAddressingEnabler;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests WS-Addressing extension in Wise
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dic-2008
+ */
+public class WSAddressingIntegrationTest extends WiseTest {
+ private URL warUrl = null;
+
+ @Before
+ public void setUp() throws Exception {
+ warUrl = this.getClass().getClassLoader().getResource("wsa.war");
+ deployWS(warUrl);
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public void shouldRunWithoutMK() throws Exception {
+ URL wsdlURL = new URL(getServerHostAndPort() + "/wsa/Hello?wsdl");
+
+ WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+ WSDynamicClient client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true).wsdlURL(wsdlURL
+ .toString()).build();
+ WSMethod method = client.getWSMethod("HelloService", "HelloImplPort", "echoUserType");
+ WSEndpoint wsEndpoint = method.getEndpoint();
+
+ wsEndpoint.addWSExtension(new WSAddressingEnabler(client));
+ wsEndpoint.addHandler(new LoggingHandler());
+
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ args.put("user", "test");
+ InvocationResult result = method.invoke(args, null);
+ Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
+ client.close();
+ Assert.assertEquals("Hello WSAddressing", results.get("result"));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ undeployWS(warUrl);
+ }
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/Hello.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsse;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.3-b02-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "Hello", targetNamespace = "http://org.jboss/wise/wssecurity")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Hello {
+
+
+ /**
+ *
+ * @param user
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ public String echoUserType(
+ @WebParam(name = "user", partName = "user")
+ String user);
+
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/HelloImpl.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsse;
+
+import javax.jws.WebService;
+import org.jboss.ws.annotation.EndpointConfig;
+@WebService( endpointInterface = "org.jboss.wise.test.integration.wsse.Hello", targetNamespace = "http://org.jboss/wise/wssecurity", serviceName = "HelloService" )
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+public class HelloImpl implements Hello {
+ public String echoUserType(String user) {
+ return "Hello WSSecurity";
+ }
+}
Added: core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java
===================================================================
--- core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java (rev 0)
+++ core/trunk/integration-native/src/test/java/org/jboss/wise/test/integration/wsse/WSSEIntegrationTest.java 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.test.integration.wsse;
+
+import java.net.URL;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSEndpoint;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.handlers.LoggingHandler;
+import org.jboss.wise.core.test.WiseTest;
+import org.jboss.wise.core.wsextensions.impl.WSSecurityEnabler;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class WSSEIntegrationTest extends WiseTest {
+ private URL warUrl = null;
+
+ @Before
+ public void setUp() throws Exception {
+ warUrl = this.getClass().getClassLoader().getResource("wsse.war");
+ deployWS(warUrl);
+
+ }
+
+ @Test
+ public void shouldRunWithoutMK() throws Exception {
+ URL wsdlURL = new URL(getServerHostAndPort() + "/wsse/HelloWorld?wsdl");
+
+ WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+ WSDynamicClient client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true)
+ .securityConfigUrl("WEB-INF/wsaandwsse/jboss-wsse-client.xml").securityConfigName("Standard WSSecurity Client")
+ .wsdlURL(wsdlURL.toString()).build();
+
+ WSMethod method = client.getWSMethod("HelloService", "HelloImplPort", "echoUserType");
+ WSEndpoint wsEndpoint = method.getEndpoint();
+
+ wsEndpoint.addHandler(new LoggingHandler());
+
+ wsEndpoint.addWSExtension(new WSSecurityEnabler(client));
+
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ args.put("user", "test");
+ InvocationResult result = method.invoke(args, null);
+ Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
+ client.close();
+ Assert.assertEquals("Hello WSSecurity", results.get("result"));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ undeployWS(warUrl);
+ }
+}
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsa/web.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsa/web.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsa/web.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>Hello</servlet-name>
+ <servlet-class>org.jboss.wise.test.integration.wsaddressing.HelloImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Hello</servlet-name>
+ <url-pattern>/Hello</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-client.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>WEB-INF/wsaandwsse/wsse.keystore</key-store-file>
+ <key-store-type>jks</key-store-type>
+ <key-store-password>jbossws</key-store-password>
+ <trust-store-file>WEB-INF/wsaandwsse/wsse.truststore</trust-store-file>
+ <trust-store-type>jks</trust-store-type>
+ <trust-store-password>jbossws</trust-store-password>
+ <config>
+
+ <encrypt type="x509v3" alias="wsse"/>
+ <requires>
+ <encryption/>
+ </requires>
+ </config>
+</jboss-ws-security>
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/jboss-wsse-server.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>WEB-INF/wsse.keystore</key-store-file>
+ <key-store-password>jbossws</key-store-password>
+ <trust-store-file>WEB-INF/wsse.truststore</trust-store-file>
+ <trust-store-password>jbossws</trust-store-password>
+ <config>
+ <encrypt type="x509v3" alias="wsse"/>
+ <requires>
+ <encryption/>
+ </requires>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/web.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/web.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/web.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>WSAandWSSE</servlet-name>
+ <servlet-class>org.jboss.wise.test.integration.wsaandwsse.WSAandWSSEImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>WSAandWSSE</servlet-name>
+ <url-pattern>/WSAandWSSE</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore
===================================================================
(Binary files differ)
Property changes on: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/wsse.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore
===================================================================
(Binary files differ)
Property changes on: core/trunk/integration-native/src/test/resources/WEB-INF/wsaandwsse/wsse.truststore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-client.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>WEB-INF/wsse/wsse.keystore</key-store-file>
+ <key-store-type>jks</key-store-type>
+ <key-store-password>jbossws</key-store-password>
+ <trust-store-file>WEB-INF/wsse/wsse.truststore</trust-store-file>
+ <trust-store-type>jks</trust-store-type>
+ <trust-store-password>jbossws</trust-store-password>
+ <config>
+
+ <encrypt type="x509v3" alias="wsse"/>
+ <requires>
+ <encryption/>
+ </requires>
+ </config>
+</jboss-ws-security>
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsse/jboss-wsse-server.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>WEB-INF/wsse.keystore</key-store-file>
+ <key-store-password>jbossws</key-store-password>
+ <trust-store-file>WEB-INF/wsse.truststore</trust-store-file>
+ <trust-store-password>jbossws</trust-store-password>
+ <config>
+ <encrypt type="x509v3" alias="wsse"/>
+ <requires>
+ <encryption/>
+ </requires>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/web.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/WEB-INF/wsse/web.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/WEB-INF/wsse/web.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>HelloWorld</servlet-name>
+ <servlet-class>org.jboss.wise.test.integration.wsse.HelloImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloWorld</servlet-name>
+ <url-pattern>/HelloWorld</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/wsse.keystore
===================================================================
(Binary files differ)
Property changes on: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/wsse.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/wsse.truststore
===================================================================
(Binary files differ)
Property changes on: core/trunk/integration-native/src/test/resources/WEB-INF/wsse/wsse.truststore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/integration-native/src/test/resources/integration-test-log4j.xml
===================================================================
--- core/trunk/integration-native/src/test/resources/integration-test-log4j.xml (rev 0)
+++ core/trunk/integration-native/src/test/resources/integration-test-log4j.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+debug="false">
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="target/integration-test.log"/>
+ <param name="Append" value="false"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+ <category name="org.jboss.wise">
+ <priority value="DEBUG"/>
+ </category>
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: core/trunk/integration-native/src/test/resources/jndi.properties
===================================================================
--- core/trunk/integration-native/src/test/resources/jndi.properties (rev 0)
+++ core/trunk/integration-native/src/test/resources/jndi.properties 2010-09-09 17:48:04 UTC (rev 398)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-09-08 08:45:39 UTC (rev 397)
+++ core/trunk/pom.xml 2010-09-09 17:48:04 UTC (rev 398)
@@ -540,6 +540,7 @@
</activation>
<modules>
<module>core-native</module>
+ <module>integration-native</module>
</modules>
<dependencies>
<dependency>
14 years, 4 months
wise SVN: r397 - core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-08 04:45:39 -0400 (Wed, 08 Sep 2010)
New Revision: 397
Modified:
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java
core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java
Log:
Fixing broken test
Modified: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java 2010-09-05 23:26:29 UTC (rev 396)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAANDWSSEIntegrationTest.java 2010-09-08 08:45:39 UTC (rev 397)
@@ -65,12 +65,12 @@
method.getEndpoint().addWSExtension(new WSAddressingEnabler(client));
method.getEndpoint().addHandler(new LoggingHandler());
HashMap<String, Object> requestMap = new HashMap<String, Object>();
- requestMap.put("toWhom", "SpiderMan");
+ requestMap.put("user", "SpiderMan");
InvocationResult result = method.invoke(requestMap, null);
System.out.println(result.getMapRequestAndResult(null, null));
Map<String, Object> results = (Map<String, Object>) result.getMapRequestAndResult(null, null).get("results");
client.close();
- Assert.assertEquals("Hello WSAddressingAndWSSecurity", results.get("result"));
+ Assert.assertEquals("Hello WSAddressingAndWSSecurity SpiderMan", results.get("result"));
}
@After
Modified: core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java
===================================================================
--- core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java 2010-09-05 23:26:29 UTC (rev 396)
+++ core/trunk/integration/src/test/java/org/jboss/wise/test/integration/wsaandwsse/WSAandWSSEImpl.java 2010-09-08 08:45:39 UTC (rev 397)
@@ -30,6 +30,6 @@
@HandlerChain(file = "handlers.xml")
public class WSAandWSSEImpl implements WSAandWSSE {
public String echoUserType(String user) {
- return "Hello WSAddressingAndWSSecurity";
+ return "Hello WSAddressingAndWSSecurity " + user;
}
}
14 years, 4 months
wise SVN: r396 - in core/trunk/core/src: main/java/org/jboss/wise/core/consumer/impl and 5 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-05 19:26:29 -0400 (Sun, 05 Sep 2010)
New Revision: 396
Removed:
core/trunk/core/src/main/java/org/jboss/wise/core/client/jaxrs/impl/
core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/
core/trunk/core/src/main/java/org/jboss/wise/core/wsextensions/impl/jbosswsnative/
core/trunk/core/src/test/java/org/jboss/wise/client/jaxrs/
core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/
core/trunk/core/src/test/java/org/jboss/wise/core/wsextensions/impl/jbosswsnative/
core/trunk/core/src/test/resources/jaxrs/
Log:
Deleting empty folders
14 years, 4 months
wise SVN: r395 - in core/trunk: core and 17 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-05 19:21:17 -0400 (Sun, 05 Sep 2010)
New Revision: 395
Added:
core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/
core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/
core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/
core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java
core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java
core/trunk/core-native/src/main/resources/META-INF/services/org.jboss.wise.consumer.WSConsumer
core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/
core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/
core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/
core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java
core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java
core/trunk/core-native/src/test/resources/hello_world.wsdl
core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbossws/
core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbossws/DefaultWSImportImpl.java
core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/WSConsumerTest.java
Removed:
core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java
core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java
core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java
core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java
Modified:
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java
core/trunk/core/pom.xml
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
core/trunk/pom.xml
Log:
[WISE-169] Further moving jbossws stack specific stuff into core-native module (consumer side)
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core/pom.xml 2010-09-05 23:21:17 UTC (rev 395)
@@ -51,6 +51,11 @@
</dependency>
<dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-container</artifactId>
<exclusions>
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -32,9 +32,12 @@
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
+
import javax.xml.ws.WebServiceClient;
+
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
+
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.jboss.wise.core.client.SpiLoader;
@@ -88,7 +91,7 @@
*/
private static WSConsumer createConsumer(WSDynamicClientBuilder builder) {
WSConsumer consumer = (WSConsumer) SpiLoader
- .loadService("org.jboss.wise.consumer.WSConsumer", "org.jboss.wise.core.consumer.impl.jbosswsnative.WSImportImpl");
+ .loadService("org.jboss.wise.consumer.WSConsumer", "org.jboss.wise.core.consumer.impl.jbossws.DefaultWSImportImpl");
return consumer;
}
@@ -138,7 +141,8 @@
try {
Thread.currentThread().setContextClassLoader(this.getClassLoader());
- JavaUtils.loadJavaType("com.sun.xml.ws.spi.ProviderImpl", this.getClassLoader());
+ Class<?> clazz = JavaUtils.loadJavaType("javax.xml.ws.spi.Provider", this.getClassLoader());
+ clazz.getMethod("provider", new Class[]{}).invoke(null, new Object[]{});
} finally {
// restore the original classloader
Thread.currentThread().setContextClassLoader(oldLoader);
Added: core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbossws/DefaultWSImportImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbossws/DefaultWSImportImpl.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbossws/DefaultWSImportImpl.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jboss.wise.core.consumer.impl.jbossws;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.util.LinkedList;
+import java.util.List;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.apache.log4j.Logger;
+import org.jboss.wise.core.consumer.WSConsumer;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+/**
+ * @author alessio.soldano(a)jboss.com
+ * @author stefano.maestri(a)javalinux.it
+ *
+ */
+@ThreadSafe
+public class DefaultWSImportImpl extends WSConsumer {
+
+ private final String[] neededClasses = { "javax/jws/WebResult.class",
+ "javax/xml/ws/Action.class",
+ "javax/xml/bind/JAXBElement.class",
+ "com/sun/xml/bind/XmlAccessorFactory.class" };
+
+ public DefaultWSImportImpl() {
+
+ }
+
+ public DefaultWSImportImpl(boolean keepSource, boolean verbose) {
+ super();
+ this.setKeepSource(keepSource);
+ this.setVerbose(verbose);
+ }
+
+ @Override
+ public synchronized List<String> importObjectFromWsdl(String wsdlURL, File outputDir, File sourceDir, String targetPackage, List<File> bindingFiles, PrintStream messageStream, File catelog) throws MalformedURLException, WiseRuntimeException {
+ WSContractConsumer wsImporter = WSContractConsumer.newInstance(Thread.currentThread().getContextClassLoader());
+
+ if (targetPackage != null && targetPackage.trim().length() > 0) {
+ wsImporter.setTargetPackage(targetPackage);
+ }
+
+ wsImporter.setGenerateSource(this.isKeepSource());
+ wsImporter.setOutputDirectory(outputDir);
+ wsImporter.setSourceDirectory(sourceDir);
+ if (messageStream != null) {
+ wsImporter.setMessageStream(messageStream);
+ }
+
+ if (this.isVerbose()) {
+ wsImporter.setMessageStream(System.out);
+ }
+ wsImporter.setAdditionalCompilerClassPath(defineAdditionalCompilerClassPath());
+
+ if (bindingFiles != null && bindingFiles.size() > 0) {
+ wsImporter.setBindingFiles(bindingFiles);
+ }
+
+ if (catelog != null) {
+ wsImporter.setCatalog(catelog);
+ }
+ runWSConsume(wsImporter, wsdlURL);
+ return this.getClassNames(outputDir, targetPackage);
+ }
+
+ protected void runWSConsume(WSContractConsumer wsImporter, String wsdlURL) throws MalformedURLException {
+ wsImporter.consume(wsdlURL);
+ }
+
+ /*
+ * This is used load libraries required by tests and usually not available
+ * when running out of container.
+ *
+ * @return A list of paths
+ */
+ protected List<String> defineAdditionalCompilerClassPath() throws WiseRuntimeException {
+ List<String> cp = new LinkedList<String>();
+ for (String jar : neededClasses) {
+ try {
+ cp.add(Thread.currentThread().getContextClassLoader().getResource(jar).getPath().split("!")[0]);
+ } catch (NullPointerException npe) {
+ Logger.getLogger(this.getClass()).debug("Didnt't find jar needed by wsImport API:" + jar);
+ }
+
+ }
+ return cp;
+ }
+}
Deleted: core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.core.consumer.impl.jbosswsnative;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-import net.jcip.annotations.ThreadSafe;
-import org.apache.log4j.Logger;
-import org.jboss.wise.core.consumer.WSConsumer;
-import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.jboss.wsf.spi.tools.WSContractConsumer;
-
-/**
- * @author stefano.maestri(a)javalinux.it
- */
-@ThreadSafe
-public class WSImportImpl extends WSConsumer {
-
- private final ProviderChanger providerChanger;
-
- private final String[] neededClasses = { "javax/jws/WebResult.class",
- "javax/xml/ws/Action.class",
- "javax/xml/bind/JAXBElement.class",
- "com/sun/xml/bind/XmlAccessorFactory.class" };
-
- public WSImportImpl() {
- providerChanger = new ProviderChanger();
- }
-
- // for test purpose
- WSImportImpl(ProviderChanger changer) {
- providerChanger = changer;
- }
-
- public WSImportImpl(boolean keepSource, boolean verbose) {
- super();
- providerChanger = new ProviderChanger();
- this.setKeepSource(keepSource);
- this.setVerbose(verbose);
- }
-
- @Override
- public synchronized List<String> importObjectFromWsdl(String wsdlURL, File outputDir, File sourceDir, String targetPackage, List<File> bindingFiles, PrintStream messageStream, File catelog) throws MalformedURLException, WiseRuntimeException {
- try {
- WSContractConsumer wsImporter = WSContractConsumer.newInstance(Thread.currentThread().getContextClassLoader());
-
- if (targetPackage != null && targetPackage.trim().length() > 0) {
- wsImporter.setTargetPackage(targetPackage);
- }
-
- wsImporter.setGenerateSource(this.isKeepSource());
- wsImporter.setOutputDirectory(outputDir);
- wsImporter.setSourceDirectory(sourceDir);
- if (messageStream != null) {
- wsImporter.setMessageStream(messageStream);
- }
-
- if (this.isVerbose()) {
- wsImporter.setMessageStream(System.out);
- }
- wsImporter.setAdditionalCompilerClassPath(defineAdditionalCompilerClassPath());
-
- if (bindingFiles != null && bindingFiles.size() > 0) {
- wsImporter.setBindingFiles(bindingFiles);
- }
-
- if (catelog != null) {
- wsImporter.setCatalog(catelog);
- }
- // NEEDED for WISE-36 issue
-
- providerChanger.changeProvider();
- wsImporter.consume(wsdlURL);
- } finally {
- // NEEDED for WISE-36 issue
- providerChanger.restoreDefaultProvider();
-
- }
- return this.getClassNames(outputDir, targetPackage);
-
- }
-
- /*
- * This is used load libraries required by tests and usually not available
- * when running out of container.
- *
- * @return A list of paths
- */
- /* package */List<String> defineAdditionalCompilerClassPath() throws WiseRuntimeException {
- List<String> cp = new LinkedList<String>();
- for (String jar : neededClasses) {
- try {
- cp.add(Thread.currentThread().getContextClassLoader().getResource(jar).getPath().split("!")[0]);
- } catch (NullPointerException npe) {
- Logger.getLogger(this.getClass()).debug("Didnt't find jar needed by wsImport API:" + jar);
- }
-
- }
- return cp;
- }
-
- public class ProviderChanger {
-
- private final ClassLoader defaultCl = Thread.currentThread().getContextClassLoader();
-
- public void changeProvider() {
- URL[] urls = {};
- Thread.currentThread().setContextClassLoader(new WiseForceToolsProviderClassLoader(urls, defaultCl));
- }
-
- public void restoreDefaultProvider() {
- Thread.currentThread().setContextClassLoader(defaultCl);
- }
- }
-}
Deleted: core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.core.consumer.impl.jbosswsnative;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Enumeration;
-
-public class WiseForceToolsProviderClassLoader extends URLClassLoader {
-
- public WiseForceToolsProviderClassLoader(URL[] urls, ClassLoader parent) {
- super(urls, parent);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
- */
- @Override
- public InputStream getResourceAsStream(String name) {
- if (name != "META-INF/services/javax.xml.ws.spi.Provider") {
- return super.getResourceAsStream(name);
- }
- String returnString = "com.sun.xml.ws.spi.ProviderImpl";
-
- final StringReader reader = new StringReader(returnString);
- return new InputStream() {
-
- @Override
- public int read() throws IOException {
- return reader.read();
- }
- };
-
- }
-
-}
Added: core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/WSConsumerTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/WSConsumerTest.java (rev 0)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/WSConsumerTest.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jboss.wise.core.consumer.impl;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.matchers.JUnitMatchers.hasItem;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.wise.core.client.SpiLoader;
+import org.jboss.wise.core.consumer.WSConsumer;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.junit.Test;
+
+/**
+ * @author stefano.maestri(a)javalinux.it
+ * @author alessio.soldano(a)jboss.com
+ */
+public class WSConsumerTest {
+
+ @Test
+ public void parseHelloGreetingWSDLShouldWorkWithoutPackage() throws Exception {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(".");
+ File outputDir = new File(url.getFile());
+ URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
+ WSConsumer importer = newConsumer();
+ importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, null, System.out, null);
+ }
+
+ @Test()
+ public void parseHelloWSDLWithBindingFile() throws Exception {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(".");
+ File outputDir = new File(url.getFile());
+ URL bindingURL = Thread.currentThread().getContextClassLoader().getResource("./jaxws-binding.xml");
+ URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
+ File bindFile = new File(bindingURL.getFile());
+ List<File> bindings = new java.util.ArrayList<File>();
+ bindings.add(bindFile);
+ WSConsumer importer = newConsumer();
+ importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, bindings, System.out, null);
+ File generatedClass = new File(url.getFile(), "org/mytest");
+ assertTrue(generatedClass.exists());
+ }
+
+ @Test(expected = WiseRuntimeException.class)
+ public void parseHelloGreetingWSDLShouldFailWithPackageAndNoBindingsForNameDuplication() throws Exception {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(".");
+ File outputDir = new File(url.getFile());
+ URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
+ WSConsumer importer = newConsumer();
+ importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, "org.jboss.wise", null, System.out, null);
+ }
+
+ @Test()
+ public void getClassNamesShouldFindFooClassPlaceHolder() throws Exception {
+ WSConsumer importer = newConsumer();
+ URL url = Thread.currentThread().getContextClassLoader().getResource("./placeHolderClasses/");
+ File file = new File(url.getFile());
+ List<String> list = importer.getClassNames(file);
+ assertThat(list.size(), is(1));
+ assertThat(list, hasItem("org.jboss.foo.Foo"));
+
+ }
+
+ private WSConsumer newConsumer() {
+ return (WSConsumer) SpiLoader.loadService("org.jboss.wise.consumer.WSConsumer", "org.jboss.wise.core.consumer.impl.jbossws.DefaultWSImportImpl");
+ }
+}
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.core.consumer.impl.jbosswsnative;
-
-import static org.junit.matchers.JUnitMatchers.containsString;
-
-import static org.mockito.Matchers.contains;
-
-import static org.junit.matchers.JUnitMatchers.hasItems;
-
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.matchers.JUnitMatchers.hasItem;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import java.io.File;
-import java.net.URL;
-import java.util.List;
-
-import org.hamcrest.Matcher;
-import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.junit.Test;
-
-/**
- * @author stefano.maestri(a)javalinux.it
- */
-public class WSImportImplTest {
-
- @Test
- public void parseHelloGreetingWSDLShouldWorkWithoutPackage() throws Exception {
- URL url = Thread.currentThread().getContextClassLoader().getResource(".");
- File outputDir = new File(url.getFile());
- URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
- WSImportImpl importer = new WSImportImpl();
- importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, null, System.out, null);
- }
-
- @Test
- public void importObjectFromWsdlShouldSetProviderProperties() throws Exception {
- URL url = Thread.currentThread().getContextClassLoader().getResource(".");
- File outputDir = new File(url.getFile());
- URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
- WSImportImpl.ProviderChanger providerChanger = mock(WSImportImpl.ProviderChanger.class);
- WSImportImpl importer = new WSImportImpl(providerChanger);
- importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, null, System.out, null);
- verify(providerChanger).changeProvider();
- verify(providerChanger).restoreDefaultProvider();
-
- }
-
- @Test
- public void importObjectFromWsdlShouldRestoreDefaultProviderProperties() throws Exception {
- URL url = Thread.currentThread().getContextClassLoader().getResource(".");
- File outputDir = new File(url.getFile());
- URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
- WSImportImpl importer = new WSImportImpl();
- String defaultProvider = System.getProperty("javax.xml.ws.spi.Provider");
- importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, null, System.out, null);
- assertThat(System.getProperty("javax.xml.ws.spi.Provider"), equalTo(defaultProvider));
-
- }
-
- @Test()
- public void parseHelloWSDLWithBindingFile() throws Exception {
- URL url = Thread.currentThread().getContextClassLoader().getResource(".");
- File outputDir = new File(url.getFile());
- URL bindingURL = Thread.currentThread().getContextClassLoader().getResource("./jaxws-binding.xml");
- URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
- File bindFile = new File(bindingURL.getFile());
- List<File> bindings = new java.util.ArrayList<File>();
- bindings.add(bindFile);
- WSImportImpl importer = new WSImportImpl();
- importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, bindings, System.out, null);
- File generatedClass = new File(url.getFile(), "org/mytest");
- assertTrue(generatedClass.exists());
- }
-
- @Test(expected = WiseRuntimeException.class)
- public void parseHelloGreetingWSDLShouldFailWithPackageAndNoBindingsForNameDuplication() throws Exception {
- URL url = Thread.currentThread().getContextClassLoader().getResource(".");
- File outputDir = new File(url.getFile());
- URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
- WSImportImpl importer = new WSImportImpl();
- importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, "org.jboss.wise", null, System.out, null);
- }
-
- @Test()
- public void getClassNamesShouldFindFooClassPlaceHolder() throws Exception {
- WSImportImpl importer = new WSImportImpl();
- URL url = Thread.currentThread().getContextClassLoader().getResource("./placeHolderClasses/");
- File file = new File(url.getFile());
- List<String> list = importer.getClassNames(file);
- assertThat(list.size(), is(1));
- assertThat(list, hasItem("org.jboss.foo.Foo"));
-
- }
-
- @Test()
- public void defineAdditionalCompilerClassPathShouldReturnRightJars() {
-
- WSImportImpl importer = new WSImportImpl();
- List<String> jars = importer.defineAdditionalCompilerClassPath();
- assertThat(jars, hasItems(containsString("jbossws-native-jaxws"), containsString("jbossws-native-jaxws-ext"), containsString("jaxb-api"), containsString("jaxb-impl")));
- }
-}
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -1,63 +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.jboss.wise.core.consumer.impl.jbosswsnative;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import org.junit.Test;
-
-/**
- * @author oracle
- *
- */
-public class WiseForceToolsProviderClassLoaderTest {
-
- /**
- * Test method for
- * {@link org.jboss.wise.core.consumer.impl.jbosswsnative.WiseForceToolsProviderClassLoader#getResourceAsStream(java.lang.String)}
- * .
- *
- * @throws Exception
- */
- @Test
- public void getResourceAsStreamShouldGetToolsProvider() throws Exception {
- URL[] urls = {};
- WiseForceToolsProviderClassLoader cl = new WiseForceToolsProviderClassLoader(urls, Thread.currentThread()
- .getContextClassLoader());
-
- InputStream inStream = cl.getResourceAsStream("META-INF/services/javax.xml.ws.spi.Provider");
- String factoryName = null;
- if (inStream != null) {
- BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
- factoryName = br.readLine();
- br.close();
- }
- assertThat(factoryName, is("com.sun.xml.ws.spi.ProviderImpl"));
-
- }
-}
Modified: core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java
===================================================================
--- core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -21,8 +21,6 @@
*/
package org.jboss.wise.core.client.jaxrs.impl;
-import java.net.ConnectException;
-
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
Added: core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java
===================================================================
--- core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java (rev 0)
+++ core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImpl.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.core.consumer.impl.jbosswsnative;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.jboss.wise.core.consumer.impl.jbossws.DefaultWSImportImpl;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+/**
+ * @author stefano.maestri(a)javalinux.it
+ * @author alessio.soldano(a)jboss.com
+ */
+@ThreadSafe
+public class WSImportImpl extends DefaultWSImportImpl {
+
+ private final ProviderChanger providerChanger;
+
+ public WSImportImpl() {
+ super();
+ providerChanger = new ProviderChanger();
+ }
+
+ // for test purpose
+ WSImportImpl(ProviderChanger changer) {
+ super();
+ providerChanger = changer;
+ }
+
+ public WSImportImpl(boolean keepSource, boolean verbose) {
+ super();
+ providerChanger = new ProviderChanger();
+ this.setKeepSource(keepSource);
+ this.setVerbose(verbose);
+ }
+
+ @Override
+ protected void runWSConsume(WSContractConsumer wsImporter, String wsdlURL) throws MalformedURLException {
+ try {
+ // NEEDED for WISE-36 issue
+ providerChanger.changeProvider();
+ wsImporter.consume(wsdlURL);
+ } finally {
+ // NEEDED for WISE-36 issue
+ providerChanger.restoreDefaultProvider();
+ }
+ }
+
+ @Override
+ protected List<String> defineAdditionalCompilerClassPath() throws WiseRuntimeException {
+ return super.defineAdditionalCompilerClassPath();
+ }
+
+ public class ProviderChanger {
+
+ private final ClassLoader defaultCl = Thread.currentThread().getContextClassLoader();
+
+ public void changeProvider() {
+ URL[] urls = {};
+ Thread.currentThread().setContextClassLoader(new WiseForceToolsProviderClassLoader(urls, defaultCl));
+ }
+
+ public void restoreDefaultProvider() {
+ Thread.currentThread().setContextClassLoader(defaultCl);
+ }
+ }
+}
Added: core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java
===================================================================
--- core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java (rev 0)
+++ core/trunk/core-native/src/main/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoader.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.core.consumer.impl.jbosswsnative;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+public class WiseForceToolsProviderClassLoader extends URLClassLoader {
+
+ public WiseForceToolsProviderClassLoader(URL[] urls, ClassLoader parent) {
+ super(urls, parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
+ */
+ @Override
+ public InputStream getResourceAsStream(String name) {
+ if (name != "META-INF/services/javax.xml.ws.spi.Provider") {
+ return super.getResourceAsStream(name);
+ }
+ String returnString = "com.sun.xml.ws.spi.ProviderImpl";
+
+ final StringReader reader = new StringReader(returnString);
+ return new InputStream() {
+
+ @Override
+ public int read() throws IOException {
+ return reader.read();
+ }
+ };
+
+ }
+
+}
Added: core/trunk/core-native/src/main/resources/META-INF/services/org.jboss.wise.consumer.WSConsumer
===================================================================
--- core/trunk/core-native/src/main/resources/META-INF/services/org.jboss.wise.consumer.WSConsumer (rev 0)
+++ core/trunk/core-native/src/main/resources/META-INF/services/org.jboss.wise.consumer.WSConsumer 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1 @@
+org.jboss.wise.core.consumer.impl.jbosswsnative.WSImportImpl
\ No newline at end of file
Added: core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java
===================================================================
--- core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java (rev 0)
+++ core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WSImportImplTest.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.core.consumer.impl.jbosswsnative;
+
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertThat;
+import static org.junit.matchers.JUnitMatchers.containsString;
+import static org.junit.matchers.JUnitMatchers.hasItems;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.junit.Test;
+
+/**
+ * @author stefano.maestri(a)javalinux.it
+ */
+public class WSImportImplTest {
+
+ @Test
+ public void importObjectFromWsdlShouldSetProviderProperties() throws Exception {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(".");
+ File outputDir = new File(url.getFile());
+ URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
+ WSImportImpl.ProviderChanger providerChanger = mock(WSImportImpl.ProviderChanger.class);
+ WSImportImpl importer = new WSImportImpl(providerChanger);
+ importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, null, System.out, null);
+ verify(providerChanger).changeProvider();
+ verify(providerChanger).restoreDefaultProvider();
+
+ }
+
+ @Test
+ public void importObjectFromWsdlShouldRestoreDefaultProviderProperties() throws Exception {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(".");
+ File outputDir = new File(url.getFile());
+ URL wsdURL = Thread.currentThread().getContextClassLoader().getResource("./hello_world.wsdl");
+ WSImportImpl importer = new WSImportImpl();
+ String defaultProvider = System.getProperty("javax.xml.ws.spi.Provider");
+ importer.importObjectFromWsdl(wsdURL.toExternalForm(), outputDir, outputDir, null, null, System.out, null);
+ assertThat(System.getProperty("javax.xml.ws.spi.Provider"), equalTo(defaultProvider));
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test()
+ public void defineAdditionalCompilerClassPathShouldReturnRightJars() {
+
+ WSImportImpl importer = new WSImportImpl();
+ List<String> jars = importer.defineAdditionalCompilerClassPath();
+ assertThat(jars, hasItems(containsString("jaxb-impl")));
+ }
+}
Added: core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java
===================================================================
--- core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java (rev 0)
+++ core/trunk/core-native/src/test/java/org/jboss/wise/core/consumer/impl/jbosswsnative/WiseForceToolsProviderClassLoaderTest.java 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,63 @@
+/*
+ * 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.jboss.wise.core.consumer.impl.jbosswsnative;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.junit.Test;
+
+/**
+ * @author oracle
+ *
+ */
+public class WiseForceToolsProviderClassLoaderTest {
+
+ /**
+ * Test method for
+ * {@link org.jboss.wise.core.consumer.impl.jbosswsnative.WiseForceToolsProviderClassLoader#getResourceAsStream(java.lang.String)}
+ * .
+ *
+ * @throws Exception
+ */
+ @Test
+ public void getResourceAsStreamShouldGetToolsProvider() throws Exception {
+ URL[] urls = {};
+ WiseForceToolsProviderClassLoader cl = new WiseForceToolsProviderClassLoader(urls, Thread.currentThread()
+ .getContextClassLoader());
+
+ InputStream inStream = cl.getResourceAsStream("META-INF/services/javax.xml.ws.spi.Provider");
+ String factoryName = null;
+ if (inStream != null) {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ }
+ assertThat(factoryName, is("com.sun.xml.ws.spi.ProviderImpl"));
+
+ }
+}
Added: core/trunk/core-native/src/test/resources/hello_world.wsdl
===================================================================
--- core/trunk/core-native/src/test/resources/hello_world.wsdl (rev 0)
+++ core/trunk/core-native/src/test/resources/hello_world.wsdl 2010-09-05 23:21:17 UTC (rev 395)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="HelloWorld" targetNamespace="http://www.jboss.org/hello_world_soap_http"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.jboss.org/hello_world_soap_http"
+ xmlns:x1="http://www.jboss.org/hello_world_soap_http/types"
+ xmlns:x2="http://www.jboss.org/mytypes"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="http://www.jboss.org/hello_world_soap_http/types"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.jboss.org/hello_world_soap_http/types"
+ elementFormDefault="qualified">
+ <simpleType name="MyStringType">
+ <restriction base="string">
+ <maxLength value="30" />
+ </restriction>
+ </simpleType>
+
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="myStringType" type="tns:MyStringType"/>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ <schema targetNamespace="http://www.jboss.org/mytypes"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.jboss.org/mytypes"
+ elementFormDefault="qualified">
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+
+
+ </wsdl:types>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x2:greetMeResponse" name="out"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="greetMe">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-09-05 21:43:40 UTC (rev 394)
+++ core/trunk/pom.xml 2010-09-05 23:21:17 UTC (rev 395)
@@ -159,6 +159,12 @@
</dependency>
<dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-container</artifactId>
<version>2.0.0.Beta</version>
@@ -553,6 +559,12 @@
<modules>
<module>core-cxf</module>
</modules>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws.cxf</groupId>
+ <artifactId>jbossws-cxf-client</artifactId>
+ </dependency>
+ </dependencies>
</profile>
</profiles>
14 years, 4 months
wise SVN: r394 - in core/trunk: core and 31 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-05 17:43:40 -0400 (Sun, 05 Sep 2010)
New Revision: 394
Added:
core/trunk/core-cxf/
core/trunk/core-cxf/pom.xml
core/trunk/core-cxf/src/
core/trunk/core-cxf/src/main/
core/trunk/core-cxf/src/main/java/
core/trunk/core-cxf/src/main/java/org/
core/trunk/core-cxf/src/main/java/org/jboss/
core/trunk/core-cxf/src/main/java/org/jboss/wise/
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java
core/trunk/core-cxf/src/main/resources/
core/trunk/core-cxf/src/main/resources/META-INF/
core/trunk/core-cxf/src/main/resources/META-INF/services/
core/trunk/core-cxf/src/main/resources/META-INF/services/org.jboss.wise.core.client.builder.RSDynamicClientBuilder
core/trunk/core-cxf/src/test/
core/trunk/core-cxf/src/test/java/
core/trunk/core-cxf/src/test/java/org/
core/trunk/core-cxf/src/test/java/org/jboss/
core/trunk/core-cxf/src/test/java/org/jboss/wise/
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java
core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java
core/trunk/core-cxf/src/test/resources/
core/trunk/core-cxf/src/test/resources/jaxrs/
core/trunk/core-cxf/src/test/resources/jaxrs/add_book.txt
core/trunk/core-cxf/src/test/resources/jaxrs/expected_add_book.txt
core/trunk/core-cxf/src/test/resources/jaxrs/expected_get_book123.txt
core/trunk/core-cxf/src/test/resources/jaxrs/expected_update_book.txt
core/trunk/core-cxf/src/test/resources/jaxrs/update_book.txt
core/trunk/core/src/main/java/org/jboss/wise/core/client/builder/RSDynamicClientBuilder.java
Removed:
core/trunk/core/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java
core/trunk/core/src/test/resources/jaxrs/add_book.txt
core/trunk/core/src/test/resources/jaxrs/expected_add_book.txt
core/trunk/core/src/test/resources/jaxrs/expected_get_book123.txt
core/trunk/core/src/test/resources/jaxrs/expected_update_book.txt
core/trunk/core/src/test/resources/jaxrs/update_book.txt
Modified:
core/trunk/core/pom.xml
core/trunk/core/src/main/java/org/jboss/wise/core/client/factories/WSDynamicClientFactory.java
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WSDLResolver.java
core/trunk/core/src/main/java/org/jboss/wise/core/wsextensions/impl/WSSecurityEnabler.java
core/trunk/pom.xml
Log:
[WISE-169] Adding core-cxf module and moving jaxrs impl stuff there
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/pom.xml 2010-09-05 21:43:40 UTC (rev 394)
@@ -156,51 +156,6 @@
</dependency>
<dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http-jetty</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxrs</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-parser</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.abdera</groupId>
- <artifactId>abdera-extensions-json</artifactId>
- </exclusion>
-
- </exclusions>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-testutils</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.6.0</version>
Added: core/trunk/core/src/main/java/org/jboss/wise/core/client/builder/RSDynamicClientBuilder.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/builder/RSDynamicClientBuilder.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/builder/RSDynamicClientBuilder.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.core.client.builder;
+
+import java.net.ConnectException;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.jaxrs.RSDynamicClient;
+import org.jboss.wise.core.client.jaxrs.RSDynamicClient.HttpMethod;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+
+/**
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+@ThreadSafe
+public interface RSDynamicClientBuilder {
+
+ /**
+ * Build the {@link WSDynamicClient} with all parameters set on this class
+ *
+ * @return {@link WSDynamicClient}
+ * @throws IllegalStateException
+ * @throws ConnectException
+ * @throws WiseRuntimeException
+ */
+ public RSDynamicClient build() throws IllegalStateException, WiseRuntimeException;
+
+ public RSDynamicClientBuilder resourceURI(String resourceURI);
+
+ public RSDynamicClientBuilder httpMethod(HttpMethod httpMethod);
+
+ public RSDynamicClientBuilder produceMediaTypes(String produceMediaTypes);
+
+ public RSDynamicClientBuilder consumeMediaTypes(String consumeMediaTypes);
+
+ public String getResourceURI();
+
+ public String getProduceMediaTypes();
+
+ public String getConsumeMediaTypes();
+
+ public HttpMethod getHttpMethod();
+
+}
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/factories/WSDynamicClientFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/factories/WSDynamicClientFactory.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/factories/WSDynamicClientFactory.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -23,17 +23,18 @@
package org.jboss.wise.core.client.factories;
import java.net.URL;
+
import net.jcip.annotations.ThreadSafe;
+
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.helpers.NullEnumeration;
import org.apache.log4j.xml.DOMConfigurator;
import org.jboss.wise.core.client.SpiLoader;
+import org.jboss.wise.core.client.builder.RSDynamicClientBuilder;
import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
-import org.jboss.wise.core.client.impl.reflection.builder.ReflectionBasedWSDynamicClientBuilder;
import org.jboss.wise.core.client.jaxrs.RSDynamicClient;
-import org.jboss.wise.core.client.jaxrs.impl.RSDynamicClientImpl;
-import org.jboss.wise.core.consumer.WSConsumer;
+import org.jboss.wise.core.exception.WiseRuntimeException;
/**
* @author Stefano Maestri, stefano.maestri(a)javalinux.it
@@ -87,8 +88,13 @@
* to be called
*/
public static RSDynamicClient getJAXRSClient(String endpointURL, RSDynamicClient.HttpMethod httpMethod, String produceMediaTypes, String consumeMediaTypes, String userName, String password) {
- RSDynamicClient client = new RSDynamicClientImpl(endpointURL, produceMediaTypes, consumeMediaTypes, httpMethod);
- return client;
+ RSDynamicClientBuilder builder = (RSDynamicClientBuilder) SpiLoader
+ .loadService("org.jboss.wise.core.client.builder.RSDynamicClientBuilder", null);
+ if (builder == null)
+ {
+ throw new WiseRuntimeException("No RSDynamicClientBuilder implementation found!");
+ }
+ return builder.resourceURI(endpointURL).httpMethod(httpMethod).produceMediaTypes(produceMediaTypes).consumeMediaTypes(consumeMediaTypes).build();
}
/**
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WSDLResolver.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WSDLResolver.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/wsdlResolver/WSDLResolver.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -47,7 +47,6 @@
import org.jboss.logging.Logger;
import org.jboss.wise.core.utils.IDGenerator;
import org.jboss.ws.Constants;
-//import org.jboss.ws.tools.wsdl.JBossWSDLFactoryImpl;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.common.IOUtils;
Deleted: core/trunk/core/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,267 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt 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.jboss.wise.core.client.jaxrs.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Map;
-import net.jcip.annotations.ThreadSafe;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
-import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.FileRequestEntity;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.methods.RequestEntity;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.apache.log4j.Logger;
-import org.jboss.wise.core.client.InvocationResult;
-import org.jboss.wise.core.client.impl.reflection.InvocationResultImpl;
-import org.jboss.wise.core.client.jaxrs.RSDynamicClient;
-import org.jboss.wise.core.mapper.WiseMapper;
-
-/*
- * TODO:
- * 1. return headers
- * 2. Support MultipartRequestEntity
- * 3. Support HttpClient properties
- * 4. Support setting headers
- * 5. Return the result in formats other than InputStream
- * 6. Exception handling
- * 7. Using jax-rs providers
- */
-@ThreadSafe
-public class RSDynamicClientImpl implements RSDynamicClient {
- private final Logger log = Logger.getLogger(RSDynamicClientImpl.class);
-
- private final String resourceURI;
- private String user;
- private String password;
- private final String produceMediaTypes;
- private final String consumeMediaTypes;
- private final HttpMethod httpMethod;
- private final HttpClient httpClient;
- private Map<String, String> requestHeaders = new HashMap<String, String>();
-
- /**
- * Invoke JAXRS service.
- *
- * @param resourceURI
- * @param produceMediaTypes default to "* / *"
- * @param consumeMediaTypes default to "* / *"
- * @param httpMethod
- */
- public RSDynamicClientImpl( String resourceURI,
- String produceMediaTypes,
- String consumeMediaTypes,
- HttpMethod httpMethod ) {
- this.resourceURI = resourceURI;
- this.produceMediaTypes = produceMediaTypes;
- this.consumeMediaTypes = consumeMediaTypes;
- this.httpMethod = httpMethod;
-
- this.httpClient = new HttpClient();
- }
-
- public RSDynamicClientImpl( String resourceURI,
- String produceMediaTypes,
- String consumeMediaTypes,
- HttpMethod httpMethod,
- Map<String, String> requestHeaders ) {
- this.resourceURI = resourceURI;
- this.produceMediaTypes = produceMediaTypes;
- this.consumeMediaTypes = consumeMediaTypes;
- this.httpMethod = httpMethod;
- this.requestHeaders = requestHeaders;
-
- this.httpClient = new HttpClient();
- }
-
- public String getResourceURI() {
- return resourceURI;
- }
-
- public String getUser() {
- return user;
- }
-
- public String getPassword() {
- return password;
- }
-
- public HttpMethod getHttpMethod() {
- return httpMethod;
- }
-
- public String getProduceMediaTypes() {
- return produceMediaTypes;
- }
-
- public String getConsumeMediaTypes() {
- return consumeMediaTypes;
- }
-
- public InvocationResult invoke( Map<String, Object> inputObjects,
- WiseMapper mapper ) {
- // NOT SUPPORTED
- // transform inputObjects to String or InputStream using WiseMapper?
- return null;
- }
-
- public InvocationResult invoke( InputStream request,
- WiseMapper mapper ) {
- return invoke(new InputStreamRequestEntity(request), mapper);
- }
-
- public InvocationResult invoke( String request,
- WiseMapper mapper ) {
- RequestEntity requestEntity = null;
- try {
- requestEntity = new StringRequestEntity(request, produceMediaTypes, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- // TODO:
- }
- return invoke(requestEntity, mapper);
- }
-
- public InvocationResult invoke( byte[] request,
- WiseMapper mapper ) {
- return invoke(new ByteArrayRequestEntity(request), mapper);
- }
-
- public InvocationResult invoke( File request,
- WiseMapper mapper ) {
- return invoke(new FileRequestEntity(request, produceMediaTypes), mapper);
- }
-
- public InvocationResult invoke() {
- RequestEntity requestEntity = null;
- return invoke(requestEntity, null);
- }
-
- public InvocationResult invoke( RequestEntity requestEntity,
- WiseMapper mapper ) {
- InvocationResult result = null;
- Map<String, Object> responseHolder = new HashMap<String, Object>();
-
- if (HttpMethod.GET == httpMethod) {
- GetMethod get = new GetMethod(resourceURI);
- setRequestHeaders(get);
-
- try {
- int statusCode = httpClient.executeMethod(get);
- // TODO: Use InputStream
- String response = get.getResponseBodyAsString();
- responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
-
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
-
- // System.out.print(response);
- } catch (IOException e) {
- // TODO:
- } finally {
- get.releaseConnection();
- }
- } else if (HttpMethod.POST == httpMethod) {
- PostMethod post = new PostMethod(resourceURI);
- setRequestHeaders(post);
-
- post.setRequestEntity(requestEntity);
-
- try {
- int statusCode = httpClient.executeMethod(post);
- String response = post.getResponseBodyAsString();
- responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
-
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
-
- // System.out.print(response);
- } catch (IOException e) {
- // TODO:
- } finally {
- post.releaseConnection();
- }
- } else if (HttpMethod.PUT == httpMethod) {
- PutMethod put = new PutMethod(resourceURI);
- setRequestHeaders(put);
-
- put.setRequestEntity(requestEntity);
-
- try {
- int statusCode = httpClient.executeMethod(put);
- String response = put.getResponseBodyAsString();
- responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
-
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
-
- // System.out.print(response);
- } catch (IOException e) {
- // TODO:
- } finally {
- put.releaseConnection();
- }
- } else if (HttpMethod.DELETE == httpMethod) {
- DeleteMethod delete = new DeleteMethod(resourceURI);
- setRequestHeaders(delete);
-
- try {
- int statusCode = httpClient.executeMethod(delete);
- String response = delete.getResponseBodyAsString();
- responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
-
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
-
- // System.out.print(response);
- } catch (IOException e) {
- // TODO:
- } finally {
- delete.releaseConnection();
- }
- }
-
- return result;
- }
-
- private void setRequestHeaders( HttpMethodBase method ) {
- if (produceMediaTypes != null) {
- method.setRequestHeader("Content-Type", produceMediaTypes);
- }
-
- if (consumeMediaTypes != null) {
- method.setRequestHeader("Accept", consumeMediaTypes);
- }
-
- for (String headerName : requestHeaders.keySet()) {
- String headerValue = requestHeaders.get(headerName);
-
- method.setRequestHeader(headerName, headerValue);
- }
- }
-
-}
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/wsextensions/impl/WSSecurityEnabler.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/wsextensions/impl/WSSecurityEnabler.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/wsextensions/impl/WSSecurityEnabler.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -23,8 +23,8 @@
import net.jcip.annotations.Immutable;
import net.jcip.annotations.ThreadSafe;
+
import org.jboss.wise.core.client.WSDynamicClient;
-import org.jboss.wise.core.client.WSEndpoint;
import org.jboss.wise.core.wsextensions.EnablerDelegate;
import org.jboss.wise.core.wsextensions.WSExtensionEnabler;
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,38 +0,0 @@
-package org.jboss.wise.core.client.jaxrs;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-
-@XmlRootElement(name = "Book")
-public class Book {
- private String name;
- private long id;
-
- public Book() {
- init();
- }
-
- public Book(String name, long id) {
- this.name = name;
- this.id = id;
- }
-
- public void setName(String n) {
- name = n;
- }
-
- public String getName() {
- return name;
- }
-
- public void setId(long i) {
- id = i;
- }
- public long getId() {
- return id;
- }
- final void init() {
-
- }
-
-}
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,17 +0,0 @@
-package org.jboss.wise.core.client.jaxrs;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class BookNotFoundDetails {
- private long id;
-
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
-}
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,17 +0,0 @@
-package org.jboss.wise.core.client.jaxrs;
-
-import javax.xml.ws.WebFault;
-
-@WebFault
-public class BookNotFoundFault extends Exception {
- private BookNotFoundDetails details;
-
- public BookNotFoundFault(BookNotFoundDetails details) {
- super();
- this.details = details;
- }
-
- public BookNotFoundDetails getFaultInfo() {
- return details;
- }
-}
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,96 +0,0 @@
-package org.jboss.wise.core.client.jaxrs;
-
-
-import java.util.HashMap;
-import java.util.Map;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-
-@Path("/bookstore")
-public class BookStore {
-
- private Map<Long, Book> books = new HashMap<Long, Book>();
- private long bookId = 123;
-
- private String currentBookId;
-
- public BookStore() {
- init();
- }
-
- @GET
- @Path("/books/{bookId}/")
- public Book getBook(@PathParam("bookId") String id) throws BookNotFoundFault {
- return doGetBook(id);
- }
-
- private Book doGetBook(String id) throws BookNotFoundFault {
- System.out.println("----invoking getBook with id: " + id);
- Book book = books.get(Long.parseLong(id));
- if (book != null) {
- return book;
- } else {
- BookNotFoundDetails details = new BookNotFoundDetails();
- details.setId(Long.parseLong(id));
- throw new BookNotFoundFault(details);
- }
- }
-
- @POST
- @Path("/books")
- @Produces("application/xml")
- @Consumes("application/xml")
- public Response addBook(Book book) {
- book.setId(++bookId);
- books.put(book.getId(), book);
-
- return Response.ok(book).build();
- }
-
- @PUT
- @Path("/books/")
- public Response updateBook(Book book) {
- Book b = books.get(book.getId());
-
- Response r;
- if (b != null) {
- books.put(book.getId(), book);
- r = Response.ok().build();
- } else {
- r = Response.notModified().build();
- }
-
- return r;
- }
-
- @DELETE
- @Path("/books/{bookId}/")
- public Response deleteBook(@PathParam("bookId") String id) {
- Book b = books.get(Long.parseLong(id));
-
- Response r;
- if (b != null) {
- r = Response.ok().build();
- } else {
- r = Response.notModified().build();
- }
-
- return r;
- }
-
- final void init() {
- Book book = new Book();
- book.setId(bookId);
- book.setName("CXF in Action");
- books.put(book.getId(), book);
- }
-}
-
-
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,106 +0,0 @@
-package org.jboss.wise.core.client.jaxrs;
-
-import java.io.InputStream;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.io.CachedOutputStream;
-import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
-import org.jboss.wise.core.client.InvocationResult;
-import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class ClientServerJaxrsTest extends AbstractClientServerTestBase {
-
- @BeforeClass
- public static void startServers() throws Exception {
- assertTrue("server did not launch correctly", launchServer(JaxrsServer.class));
- }
-
- @Test
- public void testGetBook() throws Exception {
- RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books/123",
- RSDynamicClient.HttpMethod.GET,
- null,
- "application/xml");
- InvocationResult result = client.invoke();
- String response = (String)result.getResult().get(InvocationResult.RESPONSE);
-
- String expected = getStringFromInputStream(getClass().getResourceAsStream("/jaxrs/expected_get_book123.txt"));
-
- assertEquals(response, expected);
- }
-
- @Test
- public void testAddBook() throws Exception {
- RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books",
- RSDynamicClient.HttpMethod.POST,
- "application/xml",
- "application/xml");
-
- InputStream request = getClass().getResourceAsStream("/jaxrs/add_book.txt");
- InvocationResult result = client.invoke(request, null);
-
- String response = (String)result.getResult().get(InvocationResult.RESPONSE);
- System.out.println("-------------" + response);
-
- String expected = getStringFromInputStream(getClass().getResourceAsStream("/jaxrs/expected_add_book.txt"));
-
- assertEquals(response, expected);
- }
-
- @Test
- public void testUpdateBook() throws Exception {
- RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books",
- RSDynamicClient.HttpMethod.PUT,
- "application/xml",
- "application/xml");
-
- InputStream request = getClass().getResourceAsStream("/jaxrs/update_book.txt");
- InvocationResult result = client.invoke(request, null);
-
- String response = (String)result.getResult().get(InvocationResult.RESPONSE);
- int statusCode = ((Integer)result.getResult().get(InvocationResult.STATUS)).intValue();
- assertEquals(200, statusCode);
-
- // verify result
- client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books/123",
- RSDynamicClient.HttpMethod.GET,
- null,
- "application/xml");
- result = client.invoke();
- response = (String)result.getResult().get(InvocationResult.RESPONSE);
-
- String expected = getStringFromInputStream(getClass().getResourceAsStream("/jaxrs/expected_update_book.txt"));
-
- assertEquals(response, expected);
-
- // Roll back changes:
- client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books",
- RSDynamicClient.HttpMethod.PUT,
- "application/xml",
- "application/xml");
- request = getClass().getResourceAsStream("/jaxrs/expected_get_book123.txt");
- result = client.invoke(request, null);
- }
-
- @Test
- public void testDeleteBook() throws Exception {
- RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books/123",
- RSDynamicClient.HttpMethod.DELETE,
- "application/xml",
- "application/xml");
-
- InvocationResult result = client.invoke();
- int statusCode = ((Integer)result.getResult().get(InvocationResult.STATUS)).intValue();
- assertEquals(200, statusCode);
- }
-
- private String getStringFromInputStream( InputStream in ) throws Exception {
- CachedOutputStream bos = new CachedOutputStream();
- IOUtils.copy(in, bos);
- in.close();
- bos.close();
- return bos.getOut().toString();
- }
-
-}
Deleted: core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -1,34 +0,0 @@
-package org.jboss.wise.core.client.jaxrs;
-
-import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
-import org.apache.cxf.testutil.common.AbstractTestServerBase;
-
-public class JaxrsServer extends AbstractTestServerBase{
-
- protected void run() {
- JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
- sf.setResourceClasses(BookStore.class);
-
- // default life cycle is per-request, change it to singleton
- sf.setResourceProvider(BookStore.class,
- new SingletonResourceProvider(new BookStore()));
- sf.setAddress("http://localhost:9080/");
-
- sf.create();
- }
-
- public static void main(String[] args) {
- try {
- JaxrsServer s = new JaxrsServer();
-
- s.start();
- } catch (Exception ex) {
- ex.printStackTrace();
- System.exit(-1);
- } finally {
- System.out.println("done!");
- }
- }
-
-}
Deleted: core/trunk/core/src/test/resources/jaxrs/add_book.txt
===================================================================
--- core/trunk/core/src/test/resources/jaxrs/add_book.txt 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/resources/jaxrs/add_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><name>CXF in Action - 2</name></Book>
\ No newline at end of file
Deleted: core/trunk/core/src/test/resources/jaxrs/expected_add_book.txt
===================================================================
--- core/trunk/core/src/test/resources/jaxrs/expected_add_book.txt 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/resources/jaxrs/expected_add_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><id>124</id><name>CXF in Action - 2</name></Book>
\ No newline at end of file
Deleted: core/trunk/core/src/test/resources/jaxrs/expected_get_book123.txt
===================================================================
--- core/trunk/core/src/test/resources/jaxrs/expected_get_book123.txt 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/resources/jaxrs/expected_get_book123.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><id>123</id><name>CXF in Action</name></Book>
\ No newline at end of file
Deleted: core/trunk/core/src/test/resources/jaxrs/expected_update_book.txt
===================================================================
--- core/trunk/core/src/test/resources/jaxrs/expected_update_book.txt 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/resources/jaxrs/expected_update_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><id>123</id><name>CXF in Action - 3</name></Book>
\ No newline at end of file
Deleted: core/trunk/core/src/test/resources/jaxrs/update_book.txt
===================================================================
--- core/trunk/core/src/test/resources/jaxrs/update_book.txt 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/core/src/test/resources/jaxrs/update_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -1 +0,0 @@
-<Book><id>123</id><name>CXF in Action - 3</name></Book>
\ No newline at end of file
Property changes on: core/trunk/core-cxf
___________________________________________________________________
Name: svn:ignore
+ target
.project
.classpath
.settings
Added: core/trunk/core-cxf/pom.xml
===================================================================
--- core/trunk/core-cxf/pom.xml (rev 0)
+++ core/trunk/core-cxf/pom.xml 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,158 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-core-cxf</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <name>Wise Core - CXF</name>
+ <url>http://www.jboss.org/wise</url>
+
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.wise</groupId>
+ <artifactId>wise-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ws.cxf</groupId>
+ <artifactId>jbossws-cxf-client</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.abdera</groupId>
+ <artifactId>abdera-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.abdera</groupId>
+ <artifactId>abdera-parser</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.abdera</groupId>
+ <artifactId>abdera-extensions-json</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-testutils</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.5.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <header>JBoss Wise API</header>
+ <footer>JBoss Wise API</footer>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>log4j.configuration</name>
+ <value>test-log4j.xml</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+
+
+</project>
Added: core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java
===================================================================
--- core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java (rev 0)
+++ core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/CXFRSDynamicClientBuilder.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jboss.wise.core.client.jaxrs.impl;
+
+import java.net.ConnectException;
+
+import net.jcip.annotations.GuardedBy;
+import net.jcip.annotations.ThreadSafe;
+
+import org.jboss.wise.core.client.builder.RSDynamicClientBuilder;
+import org.jboss.wise.core.client.jaxrs.RSDynamicClient;
+import org.jboss.wise.core.client.jaxrs.RSDynamicClient.HttpMethod;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Sep-2010
+ *
+ */
+@ThreadSafe
+public class CXFRSDynamicClientBuilder implements RSDynamicClientBuilder
+{
+
+ @GuardedBy("this")
+ private String resourceURI;
+ @GuardedBy("this")
+ private HttpMethod httpMethod;
+ @GuardedBy("this")
+ private String produceMediaTypes;
+ @GuardedBy("this")
+ private String consumeMediaTypes;
+
+
+ public synchronized RSDynamicClient build() throws IllegalStateException, WiseRuntimeException
+ {
+ return new RSDynamicClientImpl(resourceURI, produceMediaTypes, consumeMediaTypes, httpMethod);
+ }
+
+ public synchronized RSDynamicClientBuilder resourceURI(String resourceURI)
+ {
+ this.resourceURI = resourceURI;
+ return this;
+ }
+
+ public synchronized RSDynamicClientBuilder httpMethod(HttpMethod httpMethod)
+ {
+ this.httpMethod = httpMethod;
+ return this;
+ }
+
+ public synchronized RSDynamicClientBuilder produceMediaTypes(String produceMediaTypes)
+ {
+ this.produceMediaTypes = produceMediaTypes;
+ return this;
+ }
+
+ public synchronized RSDynamicClientBuilder consumeMediaTypes(String consumeMediaTypes)
+ {
+ this.consumeMediaTypes = consumeMediaTypes;
+ return this;
+ }
+
+ public synchronized String getResourceURI()
+ {
+ return this.resourceURI;
+ }
+
+ public synchronized String getProduceMediaTypes()
+ {
+ return this.produceMediaTypes;
+ }
+
+ public synchronized String getConsumeMediaTypes()
+ {
+ return this.consumeMediaTypes;
+ }
+
+ public synchronized HttpMethod getHttpMethod()
+ {
+ return this.httpMethod;
+ }
+
+}
Added: core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java
===================================================================
--- core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java (rev 0)
+++ core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,267 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt 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.jboss.wise.core.client.jaxrs.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
+import org.apache.commons.httpclient.methods.DeleteMethod;
+import org.apache.commons.httpclient.methods.FileRequestEntity;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+import org.apache.commons.httpclient.methods.RequestEntity;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.impl.reflection.InvocationResultImpl;
+import org.jboss.wise.core.client.jaxrs.RSDynamicClient;
+import org.jboss.wise.core.mapper.WiseMapper;
+
+/*
+ * TODO:
+ * 1. return headers
+ * 2. Support MultipartRequestEntity
+ * 3. Support HttpClient properties
+ * 4. Support setting headers
+ * 5. Return the result in formats other than InputStream
+ * 6. Exception handling
+ * 7. Using jax-rs providers
+ */
+@ThreadSafe
+public class RSDynamicClientImpl implements RSDynamicClient {
+
+ private final String resourceURI;
+ private String user;
+ private String password;
+ private final String produceMediaTypes;
+ private final String consumeMediaTypes;
+ private final HttpMethod httpMethod;
+ private final HttpClient httpClient;
+ private Map<String, String> requestHeaders = new HashMap<String, String>();
+
+ /**
+ * Invoke JAXRS service.
+ *
+ * @param resourceURI
+ * @param produceMediaTypes default to "* / *"
+ * @param consumeMediaTypes default to "* / *"
+ * @param httpMethod
+ */
+ public RSDynamicClientImpl( String resourceURI,
+ String produceMediaTypes,
+ String consumeMediaTypes,
+ HttpMethod httpMethod ) {
+ this.resourceURI = resourceURI;
+ this.produceMediaTypes = produceMediaTypes;
+ this.consumeMediaTypes = consumeMediaTypes;
+ this.httpMethod = httpMethod;
+
+ this.httpClient = new HttpClient();
+ }
+
+ public RSDynamicClientImpl( String resourceURI,
+ String produceMediaTypes,
+ String consumeMediaTypes,
+ HttpMethod httpMethod,
+ Map<String, String> requestHeaders ) {
+ this.resourceURI = resourceURI;
+ this.produceMediaTypes = produceMediaTypes;
+ this.consumeMediaTypes = consumeMediaTypes;
+ this.httpMethod = httpMethod;
+ this.requestHeaders = requestHeaders;
+
+ this.httpClient = new HttpClient();
+ }
+
+ public String getResourceURI() {
+ return resourceURI;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public HttpMethod getHttpMethod() {
+ return httpMethod;
+ }
+
+ public String getProduceMediaTypes() {
+ return produceMediaTypes;
+ }
+
+ public String getConsumeMediaTypes() {
+ return consumeMediaTypes;
+ }
+
+ public InvocationResult invoke( Map<String, Object> inputObjects,
+ WiseMapper mapper ) {
+ // NOT SUPPORTED
+ // transform inputObjects to String or InputStream using WiseMapper?
+ return null;
+ }
+
+ public InvocationResult invoke( InputStream request,
+ WiseMapper mapper ) {
+ return invoke(new InputStreamRequestEntity(request), mapper);
+ }
+
+ public InvocationResult invoke( String request,
+ WiseMapper mapper ) {
+ RequestEntity requestEntity = null;
+ try {
+ requestEntity = new StringRequestEntity(request, produceMediaTypes, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // TODO:
+ }
+ return invoke(requestEntity, mapper);
+ }
+
+ public InvocationResult invoke( byte[] request,
+ WiseMapper mapper ) {
+ return invoke(new ByteArrayRequestEntity(request), mapper);
+ }
+
+ public InvocationResult invoke( File request,
+ WiseMapper mapper ) {
+ return invoke(new FileRequestEntity(request, produceMediaTypes), mapper);
+ }
+
+ public InvocationResult invoke() {
+ RequestEntity requestEntity = null;
+ return invoke(requestEntity, null);
+ }
+
+ public InvocationResult invoke( RequestEntity requestEntity,
+ WiseMapper mapper ) {
+ InvocationResult result = null;
+ Map<String, Object> responseHolder = new HashMap<String, Object>();
+
+ if (HttpMethod.GET == httpMethod) {
+ GetMethod get = new GetMethod(resourceURI);
+ setRequestHeaders(get);
+
+ try {
+ int statusCode = httpClient.executeMethod(get);
+ // TODO: Use InputStream
+ String response = get.getResponseBodyAsString();
+ responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
+
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+
+ // System.out.print(response);
+ } catch (IOException e) {
+ // TODO:
+ } finally {
+ get.releaseConnection();
+ }
+ } else if (HttpMethod.POST == httpMethod) {
+ PostMethod post = new PostMethod(resourceURI);
+ setRequestHeaders(post);
+
+ post.setRequestEntity(requestEntity);
+
+ try {
+ int statusCode = httpClient.executeMethod(post);
+ String response = post.getResponseBodyAsString();
+ responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
+
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+
+ // System.out.print(response);
+ } catch (IOException e) {
+ // TODO:
+ } finally {
+ post.releaseConnection();
+ }
+ } else if (HttpMethod.PUT == httpMethod) {
+ PutMethod put = new PutMethod(resourceURI);
+ setRequestHeaders(put);
+
+ put.setRequestEntity(requestEntity);
+
+ try {
+ int statusCode = httpClient.executeMethod(put);
+ String response = put.getResponseBodyAsString();
+ responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
+
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+
+ // System.out.print(response);
+ } catch (IOException e) {
+ // TODO:
+ } finally {
+ put.releaseConnection();
+ }
+ } else if (HttpMethod.DELETE == httpMethod) {
+ DeleteMethod delete = new DeleteMethod(resourceURI);
+ setRequestHeaders(delete);
+
+ try {
+ int statusCode = httpClient.executeMethod(delete);
+ String response = delete.getResponseBodyAsString();
+ responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
+
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+
+ // System.out.print(response);
+ } catch (IOException e) {
+ // TODO:
+ } finally {
+ delete.releaseConnection();
+ }
+ }
+
+ return result;
+ }
+
+ private void setRequestHeaders( HttpMethodBase method ) {
+ if (produceMediaTypes != null) {
+ method.setRequestHeader("Content-Type", produceMediaTypes);
+ }
+
+ if (consumeMediaTypes != null) {
+ method.setRequestHeader("Accept", consumeMediaTypes);
+ }
+
+ for (String headerName : requestHeaders.keySet()) {
+ String headerValue = requestHeaders.get(headerName);
+
+ method.setRequestHeader(headerName, headerValue);
+ }
+ }
+
+}
Added: core/trunk/core-cxf/src/main/resources/META-INF/services/org.jboss.wise.core.client.builder.RSDynamicClientBuilder
===================================================================
--- core/trunk/core-cxf/src/main/resources/META-INF/services/org.jboss.wise.core.client.builder.RSDynamicClientBuilder (rev 0)
+++ core/trunk/core-cxf/src/main/resources/META-INF/services/org.jboss.wise.core.client.builder.RSDynamicClientBuilder 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1 @@
+org.jboss.wise.core.client.jaxrs.impl.CXFRSDynamicClientBuilder
\ No newline at end of file
Added: core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java
===================================================================
--- core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java (rev 0)
+++ core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/Book.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,38 @@
+package org.jboss.wise.core.client.jaxrs;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+@XmlRootElement(name = "Book")
+public class Book {
+ private String name;
+ private long id;
+
+ public Book() {
+ init();
+ }
+
+ public Book(String name, long id) {
+ this.name = name;
+ this.id = id;
+ }
+
+ public void setName(String n) {
+ name = n;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setId(long i) {
+ id = i;
+ }
+ public long getId() {
+ return id;
+ }
+ final void init() {
+
+ }
+
+}
Added: core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java
===================================================================
--- core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java (rev 0)
+++ core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundDetails.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,17 @@
+package org.jboss.wise.core.client.jaxrs;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class BookNotFoundDetails {
+ private long id;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+}
Added: core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java
===================================================================
--- core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java (rev 0)
+++ core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookNotFoundFault.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,17 @@
+package org.jboss.wise.core.client.jaxrs;
+
+import javax.xml.ws.WebFault;
+
+@WebFault
+public class BookNotFoundFault extends Exception {
+ private BookNotFoundDetails details;
+
+ public BookNotFoundFault(BookNotFoundDetails details) {
+ super();
+ this.details = details;
+ }
+
+ public BookNotFoundDetails getFaultInfo() {
+ return details;
+ }
+}
Added: core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java
===================================================================
--- core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java (rev 0)
+++ core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/BookStore.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,96 @@
+package org.jboss.wise.core.client.jaxrs;
+
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+@Path("/bookstore")
+public class BookStore {
+
+ private Map<Long, Book> books = new HashMap<Long, Book>();
+ private long bookId = 123;
+
+ private String currentBookId;
+
+ public BookStore() {
+ init();
+ }
+
+ @GET
+ @Path("/books/{bookId}/")
+ public Book getBook(@PathParam("bookId") String id) throws BookNotFoundFault {
+ return doGetBook(id);
+ }
+
+ private Book doGetBook(String id) throws BookNotFoundFault {
+ System.out.println("----invoking getBook with id: " + id);
+ Book book = books.get(Long.parseLong(id));
+ if (book != null) {
+ return book;
+ } else {
+ BookNotFoundDetails details = new BookNotFoundDetails();
+ details.setId(Long.parseLong(id));
+ throw new BookNotFoundFault(details);
+ }
+ }
+
+ @POST
+ @Path("/books")
+ @Produces("application/xml")
+ @Consumes("application/xml")
+ public Response addBook(Book book) {
+ book.setId(++bookId);
+ books.put(book.getId(), book);
+
+ return Response.ok(book).build();
+ }
+
+ @PUT
+ @Path("/books/")
+ public Response updateBook(Book book) {
+ Book b = books.get(book.getId());
+
+ Response r;
+ if (b != null) {
+ books.put(book.getId(), book);
+ r = Response.ok().build();
+ } else {
+ r = Response.notModified().build();
+ }
+
+ return r;
+ }
+
+ @DELETE
+ @Path("/books/{bookId}/")
+ public Response deleteBook(@PathParam("bookId") String id) {
+ Book b = books.get(Long.parseLong(id));
+
+ Response r;
+ if (b != null) {
+ r = Response.ok().build();
+ } else {
+ r = Response.notModified().build();
+ }
+
+ return r;
+ }
+
+ final void init() {
+ Book book = new Book();
+ book.setId(bookId);
+ book.setName("CXF in Action");
+ books.put(book.getId(), book);
+ }
+}
+
+
Added: core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java
===================================================================
--- core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java (rev 0)
+++ core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/ClientServerJaxrsTest.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,106 @@
+package org.jboss.wise.core.client.jaxrs;
+
+import java.io.InputStream;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.io.CachedOutputStream;
+import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ClientServerJaxrsTest extends AbstractClientServerTestBase {
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(JaxrsServer.class));
+ }
+
+ @Test
+ public void testGetBook() throws Exception {
+ RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books/123",
+ RSDynamicClient.HttpMethod.GET,
+ null,
+ "application/xml");
+ InvocationResult result = client.invoke();
+ String response = (String)result.getResult().get(InvocationResult.RESPONSE);
+
+ String expected = getStringFromInputStream(getClass().getResourceAsStream("/jaxrs/expected_get_book123.txt"));
+
+ assertEquals(response, expected);
+ }
+
+ @Test
+ public void testAddBook() throws Exception {
+ RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books",
+ RSDynamicClient.HttpMethod.POST,
+ "application/xml",
+ "application/xml");
+
+ InputStream request = getClass().getResourceAsStream("/jaxrs/add_book.txt");
+ InvocationResult result = client.invoke(request, null);
+
+ String response = (String)result.getResult().get(InvocationResult.RESPONSE);
+ System.out.println("-------------" + response);
+
+ String expected = getStringFromInputStream(getClass().getResourceAsStream("/jaxrs/expected_add_book.txt"));
+
+ assertEquals(response, expected);
+ }
+
+ @Test
+ public void testUpdateBook() throws Exception {
+ RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books",
+ RSDynamicClient.HttpMethod.PUT,
+ "application/xml",
+ "application/xml");
+
+ InputStream request = getClass().getResourceAsStream("/jaxrs/update_book.txt");
+ InvocationResult result = client.invoke(request, null);
+
+ String response = (String)result.getResult().get(InvocationResult.RESPONSE);
+ int statusCode = ((Integer)result.getResult().get(InvocationResult.STATUS)).intValue();
+ assertEquals(200, statusCode);
+
+ // verify result
+ client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books/123",
+ RSDynamicClient.HttpMethod.GET,
+ null,
+ "application/xml");
+ result = client.invoke();
+ response = (String)result.getResult().get(InvocationResult.RESPONSE);
+
+ String expected = getStringFromInputStream(getClass().getResourceAsStream("/jaxrs/expected_update_book.txt"));
+
+ assertEquals(response, expected);
+
+ // Roll back changes:
+ client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books",
+ RSDynamicClient.HttpMethod.PUT,
+ "application/xml",
+ "application/xml");
+ request = getClass().getResourceAsStream("/jaxrs/expected_get_book123.txt");
+ result = client.invoke(request, null);
+ }
+
+ @Test
+ public void testDeleteBook() throws Exception {
+ RSDynamicClient client = WSDynamicClientFactory.getJAXRSClient("http://localhost:9080/bookstore/books/123",
+ RSDynamicClient.HttpMethod.DELETE,
+ "application/xml",
+ "application/xml");
+
+ InvocationResult result = client.invoke();
+ int statusCode = ((Integer)result.getResult().get(InvocationResult.STATUS)).intValue();
+ assertEquals(200, statusCode);
+ }
+
+ private String getStringFromInputStream( InputStream in ) throws Exception {
+ CachedOutputStream bos = new CachedOutputStream();
+ IOUtils.copy(in, bos);
+ in.close();
+ bos.close();
+ return bos.getOut().toString();
+ }
+
+}
Added: core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java
===================================================================
--- core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java (rev 0)
+++ core/trunk/core-cxf/src/test/java/org/jboss/wise/core/client/jaxrs/JaxrsServer.java 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1,34 @@
+package org.jboss.wise.core.client.jaxrs;
+
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
+import org.apache.cxf.testutil.common.AbstractTestServerBase;
+
+public class JaxrsServer extends AbstractTestServerBase{
+
+ protected void run() {
+ JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
+ sf.setResourceClasses(BookStore.class);
+
+ // default life cycle is per-request, change it to singleton
+ sf.setResourceProvider(BookStore.class,
+ new SingletonResourceProvider(new BookStore()));
+ sf.setAddress("http://localhost:9080/");
+
+ sf.create();
+ }
+
+ public static void main(String[] args) {
+ try {
+ JaxrsServer s = new JaxrsServer();
+
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+
+}
Added: core/trunk/core-cxf/src/test/resources/jaxrs/add_book.txt
===================================================================
--- core/trunk/core-cxf/src/test/resources/jaxrs/add_book.txt (rev 0)
+++ core/trunk/core-cxf/src/test/resources/jaxrs/add_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><name>CXF in Action - 2</name></Book>
\ No newline at end of file
Added: core/trunk/core-cxf/src/test/resources/jaxrs/expected_add_book.txt
===================================================================
--- core/trunk/core-cxf/src/test/resources/jaxrs/expected_add_book.txt (rev 0)
+++ core/trunk/core-cxf/src/test/resources/jaxrs/expected_add_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><id>124</id><name>CXF in Action - 2</name></Book>
\ No newline at end of file
Added: core/trunk/core-cxf/src/test/resources/jaxrs/expected_get_book123.txt
===================================================================
--- core/trunk/core-cxf/src/test/resources/jaxrs/expected_get_book123.txt (rev 0)
+++ core/trunk/core-cxf/src/test/resources/jaxrs/expected_get_book123.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><id>123</id><name>CXF in Action</name></Book>
\ No newline at end of file
Added: core/trunk/core-cxf/src/test/resources/jaxrs/expected_update_book.txt
===================================================================
--- core/trunk/core-cxf/src/test/resources/jaxrs/expected_update_book.txt (rev 0)
+++ core/trunk/core-cxf/src/test/resources/jaxrs/expected_update_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><id>123</id><name>CXF in Action - 3</name></Book>
\ No newline at end of file
Added: core/trunk/core-cxf/src/test/resources/jaxrs/update_book.txt
===================================================================
--- core/trunk/core-cxf/src/test/resources/jaxrs/update_book.txt (rev 0)
+++ core/trunk/core-cxf/src/test/resources/jaxrs/update_book.txt 2010-09-05 21:43:40 UTC (rev 394)
@@ -0,0 +1 @@
+<Book><id>123</id><name>CXF in Action - 3</name></Book>
\ No newline at end of file
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-09-04 17:28:37 UTC (rev 393)
+++ core/trunk/pom.xml 2010-09-05 21:43:40 UTC (rev 394)
@@ -201,6 +201,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.ws.cxf</groupId>
+ <artifactId>jbossws-cxf-client</artifactId>
+ <version>3.3.1.GA</version>
+ </dependency>
+
+ <dependency>
<groupId>org.milyn</groupId>
<artifactId>milyn-smooks-core</artifactId>
<version>1.2.1</version>
@@ -544,9 +550,9 @@
<name>cxf.stack</name>
</property>
</activation>
- <!-- <modules>
+ <modules>
<module>core-cxf</module>
- </modules> -->
+ </modules>
</profile>
</profiles>
14 years, 4 months