Author: richard.opalka(a)jboss.com
Date: 2011-08-13 12:53:41 -0400 (Sat, 13 Aug 2011)
New Revision: 14824
Added:
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/pom.xml
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/systest/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/systest/servlet/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/AbstractServletTest.java
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/TestUtilitiesWithBasicBus.java
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/systest/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/systest/servlet/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/systest/servlet/web.xml
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/test/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/test/java/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/test/java/org/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/test/java/org/apache/
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/test/java/org/apache/cxf/
Log:
importing CXF 2.3.1 tag - (per partes) because of unreliable SVN RH repo :(
Added: thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/pom.xml (rev
0)
+++ thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/pom.xml 2011-08-13 16:53:41 UTC (rev
14824)
@@ -0,0 +1,99 @@
+<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.apache.cxf</groupId>
+ <artifactId>cxf-rt-testsupport</artifactId>
+ <packaging>jar</packaging>
+ <version>2.3.1</version>
+ <name>Apache CXF Test Case Support</name>
+ <url>http://cxf.apache.org</url>
+
+ <parent>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-parent</artifactId>
+ <version>2.3.1</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-local</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-soap</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jra</groupId>
+ <artifactId>jra</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.6.2</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>jdk15</id>
+ <activation>
+ <jdk>1.5</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaxws_2.2_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-activation_1.1_spec</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
Property changes on: thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/pom.xml
___________________________________________________________________
Added: svn:executable
+ *
Added:
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java 2011-08-13
16:53:41 UTC (rev 14824)
@@ -0,0 +1,43 @@
+/**
+ * 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.cxf.systest.servlet;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+
+//Customer WebRequest for sending the "http://localhost/xxx?wsdl" request
+public class GetMethodQueryWebRequest extends GetMethodWebRequest {
+ private String urlString;
+
+ public GetMethodQueryWebRequest(String urlStr) {
+ super(urlStr);
+ urlString = urlStr;
+ }
+
+ public String getQueryString() {
+ int pos = urlString.indexOf('?');
+ if (pos > 0) {
+ return urlString.substring(pos + 1);
+ } else {
+ return "";
+ }
+ }
+
+
+
+}
Added:
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/AbstractServletTest.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/AbstractServletTest.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/AbstractServletTest.java 2011-08-13
16:53:41 UTC (rev 14824)
@@ -0,0 +1,96 @@
+/**
+ * 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.cxf.testsupport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+
+import org.xml.sax.SAXException;
+
+import com.meterware.httpunit.HttpException;
+import com.meterware.httpunit.HttpNotFoundException;
+import com.meterware.httpunit.HttpUnitOptions;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.servletunit.ServletRunner;
+import com.meterware.servletunit.ServletUnitClient;
+
+import org.apache.cxf.test.AbstractCXFTest;
+import org.junit.Before;
+
+public abstract class AbstractServletTest extends AbstractCXFTest {
+ public static final String CONTEXT = "/mycontext";
+ public static final String CONTEXT_URL = "http://localhost/mycontext";
+ protected ServletRunner sr;
+
+ @Before
+ public void setUp() throws Exception {
+ InputStream configurationStream = getResourceAsStream(getConfiguration());
+ sr = new ServletRunner(configurationStream, CONTEXT);
+
+ try {
+ sr.newClient().getResponse(CONTEXT_URL + "/services");
+ } catch (HttpNotFoundException e) {
+ // ignore, we just want to boot up the servlet
+ }
+
+ HttpUnitOptions.setExceptionsThrownOnErrorStatus(true);
+ }
+
+ /**
+ * @return The web.xml to use for testing.
+ */
+ protected String getConfiguration() {
+ return "/org/apache/cxf/systest/servlet/web.xml";
+ }
+
+ protected ServletUnitClient newClient() {
+ return sr.newClient();
+ }
+
+ /**
+ * Here we expect an errorCode other than 200, and look for it checking for
+ * text is omitted as it doesnt work. It would never work on java1.3, but
+ * one may have expected java1.4+ to have access to the error stream in
+ * responses. Clearly not.
+ *
+ * @param request
+ * @param errorCode
+ * @param errorText optional text string to search for
+ * @throws MalformedURLException
+ * @throws IOException
+ * @throws SAXException
+ */
+ protected void expectErrorCode(WebRequest request, int errorCode, String errorText)
+ throws MalformedURLException, IOException, SAXException {
+ String failureText = "Expected error " + errorCode + " from "
+ request.getURL();
+
+ try {
+ newClient().getResponse(request);
+ fail(errorText + " -got success instead");
+ } catch (HttpException e) {
+ assertEquals(failureText, errorCode, e.getResponseCode());
+ /*
+ * checking for text omitted as it doesnt work. if(errorText!=null) {
+ * assertTrue( "Failed to find "+errorText+" in "+
+ * e.getResponseMessage(), e.getMessage().indexOf(errorText)>=0); }
+ */
+ }
+ }
+}
Added:
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/TestUtilitiesWithBasicBus.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/TestUtilitiesWithBasicBus.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/TestUtilitiesWithBasicBus.java 2011-08-13
16:53:41 UTC (rev 14824)
@@ -0,0 +1,79 @@
+/**
+ * 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.cxf.testsupport;
+
+import org.apache.cxf.BusException;
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.binding.soap.SoapBindingFactory;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.common.util.SOAPConstants;
+import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl11.WSDLManagerImpl;
+
+public class TestUtilitiesWithBasicBus extends TestUtilities {
+
+ private LocalTransportFactory localTransport;
+
+ public TestUtilitiesWithBasicBus(Class<?> classpathReference) {
+ super(classpathReference);
+ }
+
+ /**
+ * Add objects to the bus to set up the local transport, soap transport, soap
bindings, and WSDL manager.
+ * All you need to test databindings and other type-related operations.
+ * @throws BusException
+ */
+ public void setUp() throws BusException {
+ SoapBindingFactory bindingFactory = new SoapBindingFactory();
+
+ bus.getExtension(BindingFactoryManager.class)
+ .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/",
bindingFactory);
+
+ DestinationFactoryManager dfm =
bus.getExtension(DestinationFactoryManager.class);
+
+ SoapTransportFactory soapDF = new SoapTransportFactory();
+ soapDF.setBus(bus);
+
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap...;,
soapDF);
+
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/",
soapDF);
+
dfm.registerDestinationFactory("http://cxf.apache.org/transports/loc...;,
soapDF);
+
+ localTransport = new LocalTransportFactory();
+
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http...;,
localTransport);
+
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap...;,
localTransport);
+
dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xform...;,
localTransport);
+
dfm.registerDestinationFactory("http://cxf.apache.org/transports/loc...;,
localTransport);
+
+ ConduitInitiatorManager extension =
bus.getExtension(ConduitInitiatorManager.class);
+ extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID,
localTransport);
+
extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/...;,
localTransport);
+
extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/...;,
localTransport);
+
extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/...;,
localTransport);
+
+ bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
+
+ addNamespace("wsdl", SOAPConstants.WSDL11_NS);
+ addNamespace("wsdlsoap", SOAPConstants.WSDL11_SOAP_NS);
+ addNamespace("xsd", SOAPConstants.XSD);
+ }
+
+}
Property changes on:
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/java/org/apache/cxf/testsupport/TestUtilitiesWithBasicBus.java
___________________________________________________________________
Added: svn:executable
+ *
Added:
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/systest/servlet/web.xml
===================================================================
---
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/systest/servlet/web.xml
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.3.1/rt/testsupport/src/main/resources/org/apache/cxf/systest/servlet/web.xml 2011-08-13
16:53:41 UTC (rev 14824)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<!--
+ 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.
+-->
+
+<web-app>
+
+ <servlet>
+ <servlet-name>CXFServlet</servlet-name>
+ <display-name>CXF Servlet</display-name>
+ <servlet-class>
+ org.apache.cxf.transport.servlet.CXFServlet
+ </servlet-class>
+ <init-param>
+ <param-name>config-location</param-name>
+
<param-value>/org/apache/cxf/systest/servlet/cxf-servlet.xml</param-value>
+ </init-param>
+ <!--init-param>
+ <param-name>bus.id</param-name>
+ <param-value>servlet.systest.bus.id</param-value>
+ </init-param-->
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CXFServlet</servlet-name>
+ <url-pattern>/services/*</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
\ No newline at end of file