Author: veithen
Date: Sun Oct 7 08:26:45 2012
New Revision: 1395239
URL: http://svn.apache.org/viewvc?rev=1395239&view=rev
Log:
Finalized the migration of test/wsdl/soap12/additional to the Maven build.
Added:
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPHandler.java
(with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/wsdl/
axis/axis1/java/trunk/interop-mock/src/main/resources/wsdl/soap12-add-test.wsdl
- copied unchanged from r1393087,
axis/axis1/java/trunk/interop/src/test/wsdl/soap12/additional/soap12-add-test.wsdl
axis/axis1/java/trunk/interop/src/test/resources/
axis/axis1/java/trunk/interop/src/test/resources/client-config.wsdd
Removed:
axis/axis1/java/trunk/interop/src/test/wsdl/
axis/axis1/java/trunk/test/wsdl/soap12/additional/
Modified:
axis/axis1/java/trunk/interop/ (props changed)
axis/axis1/java/trunk/interop-mock/pom.xml
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java
axis/axis1/java/trunk/interop-mock/src/main/resources/log4j.properties
axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml
axis/axis1/java/trunk/interop/pom.xml
axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
axis/axis1/java/trunk/pom.xml
Propchange: axis/axis1/java/trunk/interop/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Oct 7 08:26:45 2012
@@ -0,0 +1,4 @@
+.classpath
+.project
+target
+.settings
Modified: axis/axis1/java/trunk/interop-mock/pom.xml
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/pom.xml?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/pom.xml (original)
+++ axis/axis1/java/trunk/interop-mock/pom.xml Sun Oct 7 08:26:45 2012
@@ -56,6 +56,11 @@
<version>2.6</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
Modified:
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
---
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java
(original)
+++
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java
Sun Oct 7 08:26:45 2012
@@ -35,10 +35,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
-import org.springframework.web.HttpRequestHandler;
import org.w3c.dom.Element;
-public class MockGetHandler implements HttpRequestHandler, InitializingBean {
+public class MockGetHandler extends SOAPHandler implements InitializingBean {
private static final Log log = LogFactory.getLog(MockGetHandler.class);
private Resource response;
@@ -55,7 +54,8 @@ public class MockGetHandler implements H
responseContentType = SOAPUtil.getContentType(responseMessage);
}
- public void handleRequest(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws ServletException, IOException {
+ @Override
+ protected void handleSOAPRequest(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws ServletException, IOException {
if (!httpRequest.getMethod().equals("GET")) {
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "This
endpoint only supports GET requests");
return;
Modified:
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
---
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java
(original)
+++
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java
Sun Oct 7 08:26:45 2012
@@ -40,12 +40,11 @@ import javax.xml.transform.stream.Stream
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
-import org.springframework.web.HttpRequestHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
-public class MockPostHandler implements HttpRequestHandler, InitializingBean {
+public class MockPostHandler extends SOAPHandler implements InitializingBean {
private static final Log log = LogFactory.getLog(MockPostHandler.class);
private List<MessageProcessor> requestProcessors;
@@ -67,7 +66,8 @@ public class MockPostHandler implements
}
}
- public void handleRequest(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws ServletException, IOException {
+ @Override
+ protected void handleSOAPRequest(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws ServletException, IOException {
if (!httpRequest.getMethod().equals("POST")) {
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "This
endpoint only supports POST requests");
return;
Added:
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPHandler.java
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPHandler.java?rev=1395239&view=auto
==============================================================================
---
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPHandler.java
(added)
+++
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPHandler.java
Sun Oct 7 08:26:45 2012
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.axis.test.interop.mock;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.IOUtils;
+import org.springframework.core.io.Resource;
+import org.springframework.web.HttpRequestHandler;
+
+public abstract class SOAPHandler implements HttpRequestHandler {
+ private Resource wsdl;
+
+ public void setWsdl(Resource wsdl) {
+ this.wsdl = wsdl;
+ }
+
+ public final void handleRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
+ if (request.getMethod().equals("GET") && request.getQueryString() !=
null && request.getQueryString().equalsIgnoreCase("wsdl")) {
+ if (wsdl == null) {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND, "No WSDL
available for this service");
+ } else {
+ response.setContentType("text/xml");
+ InputStream in = wsdl.getInputStream();
+ try {
+ IOUtils.copy(in, response.getOutputStream());
+ } finally {
+ in.close();
+ }
+ }
+ } else {
+ handleSOAPRequest(request, response);
+ }
+ }
+
+ protected abstract void handleSOAPRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException;
+}
Propchange:
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/log4j.properties
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/log4j.properties?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/log4j.properties
(original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/log4j.properties Sun
Oct 7 08:26:45 2012
@@ -19,7 +19,7 @@
log4j.rootLogger=INFO, CONSOLE
-log4j.logger.org.apache.axis.test.interop.mock=DEBUG
+#log4j.logger.org.apache.axis.test.interop.mock=DEBUG
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
Modified:
axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
---
axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml
(original)
+++
axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml
Sun Oct 7 08:26:45 2012
@@ -25,6 +25,7 @@
<!-- Endpoints that mock http://www.whitemesa.net -->
<bean name="/soap12/add-test-rpc"
class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <property name="wsdl" value="classpath:wsdl/soap12-add-test.wsdl"/>
<property name="requestProcessors">
<list>
<bean
class="org.apache.axis.test.interop.mock.MustUnderstandNormalizer"/>
@@ -92,6 +93,7 @@
</bean>
<bean name="/soap12/add-test-doc"
class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <property name="wsdl" value="classpath:wsdl/soap12-add-test.wsdl"/>
<property name="exchanges">
<list>
<bean class="org.apache.axis.test.interop.mock.Exchange">
@@ -107,6 +109,7 @@
</bean>
<bean name="/soap12/add-test-doc-int"
class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <property name="wsdl" value="classpath:wsdl/soap12-add-test.wsdl"/>
<property name="requestProcessors">
<list>
<bean
class="org.apache.axis.test.interop.mock.MustUnderstandNormalizer"/>
@@ -143,6 +146,7 @@
</bean>
<bean name="/soap12/add-test-doc-int-uc"
class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <property name="wsdl" value="classpath:wsdl/soap12-add-test.wsdl"/>
<property name="exchanges">
<list>
<bean class="org.apache.axis.test.interop.mock.Exchange">
Modified: axis/axis1/java/trunk/interop/pom.xml
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop/pom.xml?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop/pom.xml (original)
+++ axis/axis1/java/trunk/interop/pom.xml Sun Oct 7 08:26:45 2012
@@ -39,6 +39,20 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>interop-mock</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <!-- TODO: we should run the tests with the standard HTTP transport,
but this doesn't work yet -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axis-rt-transports-http-javanet</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -53,7 +67,7 @@
<goal>generate-test-sources</goal>
</goals>
<configuration>
-
<file>src/test/wsdl/soap12/additional/soap12-add-test.wsdl</file>
+
<file>../interop-mock/src/main/resources/wsdl/soap12-add-test.wsdl</file>
<generate>both</generate>
<mappings>
<mapping>
@@ -70,6 +84,105 @@
</executions>
</plugin>
<plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>reserve-network-port</id>
+ <goals>
+ <goal>reserve-network-port</goal>
+ </goals>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <portNames>
+ <portName>mock.httpPort</portName>
+ <portName>jetty.stopPort</portName>
+ </portNames>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+
<outputDirectory>${project.build.directory}</outputDirectory>
+ <includeTypes>war</includeTypes>
+ <stripVersion>true</stripVersion>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <war>${project.build.directory}/interop-mock.war</war>
+ <stopKey>foo</stopKey>
+ <stopPort>${jetty.stopPort}</stopPort>
+ <connectors>
+ <connector
implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+ <port>${mock.httpPort}</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deploy-war</goal>
+ </goals>
+ <configuration>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <systemPropertyVariables>
+ <mock.httpPort>${mock.httpPort}</mock.httpPort>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
Modified:
axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
---
axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
(original)
+++
axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
Sun Oct 7 08:26:45 2012
@@ -52,7 +52,7 @@ public class WhiteMesaSoap12AddTestSvcTe
// Endpoints
// TODO : Shouldn't be hardcoded!
- public static String HOST = "http://localhost:9080";
+ public static String HOST = "http://localhost:" +
System.getProperty("mock.httpPort", "9080");
// public static String HOST = "http://www.whitemesa.net";
public static String RPC_ENDPOINT = HOST + "/soap12/add-test-rpc";
public static String DOC_ENDPOINT = HOST + "/soap12/add-test-doc";
@@ -82,28 +82,28 @@ public class WhiteMesaSoap12AddTestSvcTe
public void testSoap12AddTestDocUpperPortWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory =
javax.xml.rpc.ServiceFactory.newInstance();
- java.net.URL url = new java.net.URL(new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocUpperPortAddress()
+ "?WSDL");
+ java.net.URL url = new java.net.URL(DOC_INT_UC_ENDPOINT + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getServiceName());
assertTrue(service != null);
}
public void testSoap12AddTestRpcPortWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory =
javax.xml.rpc.ServiceFactory.newInstance();
- java.net.URL url = new java.net.URL(new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestRpcPortAddress()
+ "?WSDL");
+ java.net.URL url = new java.net.URL(RPC_ENDPOINT + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getServiceName());
assertTrue(service != null);
}
public void testSoap12AddTestDocIntermediaryPortWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory =
javax.xml.rpc.ServiceFactory.newInstance();
- java.net.URL url = new java.net.URL(new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocIntermediaryPortAddress()
+ "?WSDL");
+ java.net.URL url = new java.net.URL(DOC_INT_ENDPOINT + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getServiceName());
assertTrue(service != null);
}
public void testSoap12AddTestDocPortWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory =
javax.xml.rpc.ServiceFactory.newInstance();
- java.net.URL url = new java.net.URL(new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocPortAddress()
+ "?WSDL");
+ java.net.URL url = new java.net.URL(DOC_ENDPOINT + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new
test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getServiceName());
assertTrue(service != null);
}
Added: axis/axis1/java/trunk/interop/src/test/resources/client-config.wsdd
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop/src/test/resources/client-config.wsdd?rev=1395239&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop/src/test/resources/client-config.wsdd (added)
+++ axis/axis1/java/trunk/interop/src/test/resources/client-config.wsdd Sun Oct
7 08:26:45 2012
@@ -0,0 +1,10 @@
+<!-- TODO: we should run the tests with the standard HTTP transport, but this
doesn't work yet -->
+<deployment name="testClientConfig"
+ xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <globalConfiguration>
+ <parameter name="disablePrettyXML" value="true"/>
+ <parameter name="enableNamespacePrefixOptimization" value="false"/>
+ </globalConfiguration>
+ <transport name="http"
pivot="java:org.apache.axis.transport.http.javanet.JavaNetHTTPSender"/>
+</deployment>
\ No newline at end of file
Modified: axis/axis1/java/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/pom.xml?rev=1395239&r1=1395238&r2=1395239&view=diff
==============================================================================
--- axis/axis1/java/trunk/pom.xml (original)
+++ axis/axis1/java/trunk/pom.xml Sun Oct 7 08:26:45 2012
@@ -69,6 +69,7 @@
<module>axis-testutils</module>
<module>integration</module>
<module>interop-mock</module>
+ <module>interop</module>
<module>axis-war</module>
<module>samples</module>
<module>distribution</module>