[jbossws-commits] JBossWS SVN: r12735 - in thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test: java/org/apache/cxf/systest/soapfault and 1 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Aug 4 15:21:43 EDT 2010


Author: fnasser at redhat.com
Date: 2010-08-04 15:21:42 -0400 (Wed, 04 Aug 2010)
New Revision: 12735

Added:
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/LoggingHandler.java
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultImpl.java
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultRequestTestCase.java
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/Server.java
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/handlers.xml
   thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/resources/wsdl_systest/soap_fault.wsdl
Log:
Fix problem that causes JTS tests to fail (Alessio Soldano)  **Fix previous commit, add missing new files**

Added: thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/LoggingHandler.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/LoggingHandler.java	                        (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/LoggingHandler.java	2010-08-04 19:21:42 UTC (rev 12735)
@@ -0,0 +1,101 @@
+/**
+ * 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.soapfault;
+
+import java.io.PrintStream;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/*
+ * This simple SOAPHandler will output the contents of incoming
+ * and outgoing messages.
+ */
+public class LoggingHandler implements SOAPHandler<SOAPMessageContext> {
+
+    private PrintStream out;
+
+    public LoggingHandler() {
+        setLogStream(System.out);
+    }
+
+    protected final void setLogStream(PrintStream ps) {
+        out = ps;
+    }
+
+    public void init(Map c) {
+    }
+
+    public Set<QName> getHeaders() {
+        return null;
+    }
+
+    public boolean handleMessage(SOAPMessageContext smc) {
+        //System.out.println("LoggingHandler : handleMessage Called....");
+        logToSystemOut(smc);
+        return true;
+    }
+
+    public boolean handleFault(SOAPMessageContext smc) {
+        //System.out.println("LoggingHandler : handleFault Called....");
+        logToSystemOut(smc);
+        return true;
+    }
+
+    // nothing to clean up
+    public void close(MessageContext messageContext) {
+        //System.out.println("LoggingHandler : close() Called....");
+    }
+
+    // nothing to clean up
+    public void destroy() {
+        //System.out.println("LoggingHandler : destroy() Called....");
+    }
+
+    /*
+     * Check the MESSAGE_OUTBOUND_PROPERTY in the context
+     * to see if this is an outgoing or incoming message.
+     * Write a brief message to the print stream and
+     * output the message. The writeTo() method can throw
+     * SOAPException or IOException
+     */
+    protected void logToSystemOut(SOAPMessageContext smc) {
+        Boolean outboundProperty = (Boolean)smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+        if (outboundProperty.booleanValue()) {
+            //out.println("\nOutbound message:");
+        } else {
+            //out.println("\nInbound message:");
+        }
+
+        SOAPMessage message = smc.getMessage();
+        try {
+            message.writeTo(out);
+            //out.println();
+        } catch (Exception e) {
+            //out.println("Exception in handler: " + e);
+            e.printStackTrace();
+        }
+    }
+}

Added: thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultImpl.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultImpl.java	                        (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultImpl.java	2010-08-04 19:21:42 UTC (rev 12735)
@@ -0,0 +1,38 @@
+/**
+ * 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.soapfault;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.apache.cxf.soapfault.SoapFaultPortType;
+import org.xmlsoap.schemas.soap.envelope.Fault;
+
+ at WebService(endpointInterface = "org.apache.cxf.soapfault.SoapFaultPortType", 
+            serviceName = "SoapFaultService")
+ at HandlerChain(file = "./handlers.xml", name = "TestHandlerChain")
+public class SOAPFaultImpl implements SoapFaultPortType {
+    public void soapFault(Fault fault) {
+        System.out.println("Received soap fault message");
+        System.out.println("FaultString: " + fault.getFaultstring());
+        System.out.println("FaulCode: " + fault.getFaultcode());
+    }
+
+}

Added: thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultRequestTestCase.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultRequestTestCase.java	                        (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/SOAPFaultRequestTestCase.java	2010-08-04 19:21:42 UTC (rev 12735)
@@ -0,0 +1,55 @@
+/**
+ * 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.soapfault;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.soapfault.SoapFaultPortType;
+import org.apache.cxf.soapfault.SoapFaultService;
+import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.xmlsoap.schemas.soap.envelope.Fault;
+
+public class SOAPFaultRequestTestCase extends AbstractClientServerTestBase {
+    private final QName portName = new QName("http://cxf.apache.org/soapfault", "SoapFaultPortType");
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", launchServer(Server.class));
+    }
+
+    @Test
+    public void testSendSoapFaultRequest() throws Exception {
+
+        SoapFaultService service = new SoapFaultService();
+        assertNotNull(service);
+
+        SoapFaultPortType soapFaultPort = service.getPort(portName, SoapFaultPortType.class);
+
+        Fault fault = new Fault();
+        fault.setFaultstring("ClientSetFaultString");
+        fault.setFaultcode(new QName("http://cxf.apache.org/soapfault", "ClientSetError"));
+        soapFaultPort.soapFault(fault);
+
+    }
+
+}

Added: thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/Server.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/Server.java	                        (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/Server.java	2010-08-04 19:21:42 UTC (rev 12735)
@@ -0,0 +1,46 @@
+/**
+ * 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.soapfault;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+
+public class Server extends AbstractBusTestServerBase {    
+    protected void run() {
+        String address = "http://localhost:9199/SoapFault";
+
+        Object implementor1 = new SOAPFaultImpl();
+        Endpoint.publish(address, implementor1);
+    }
+
+    public static void main(String[] args) {
+        try {
+            Server s = new Server();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally {
+            System.out.println("done!");
+        }
+    }
+}
+

Added: thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/handlers.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/handlers.xml	                        (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/java/org/apache/cxf/systest/soapfault/handlers.xml	2010-08-04 19:21:42 UTC (rev 12735)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee" 
+xmlns:cfg="http://cxf.apache.org/configuration/cfg" 
+xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+    <handler-chain>
+        <handler>
+		<handler-name>ph1</handler-name>
+		<handler-class>org.apache.cxf.systest.soapfault.LoggingHandler</handler-class>
+		<init-param>
+			<param-name>token</param-name>
+			<param-value>String</param-value>
+		</init-param>
+	</handler>
+    </handler-chain>
+</handler-chains>

Added: thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/resources/wsdl_systest/soap_fault.wsdl
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/resources/wsdl_systest/soap_fault.wsdl	                        (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.6/systests/uncategorized/src/test/resources/wsdl_systest/soap_fault.wsdl	2010-08-04 19:21:42 UTC (rev 12735)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+<definitions
+        xmlns:s="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://cxf.apache.org/soapfault"
+        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+        xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl"
+        targetNamespace="http://cxf.apache.org/soapfault"
+    xmlns="http://schemas.xmlsoap.org/wsdl/">
+    <types>
+        <s:schema>
+            <s:import namespace="http://schemas.xmlsoap.org/soap/envelope/"
+                      schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/>
+        </s:schema>
+    </types>
+    <message name="SoapFault">
+         <part name="fault" element="soapenv:Fault" />
+    </message>
+
+ 
+
+    <portType name="SoapFaultPortType">
+        <operation name="SoapFault">
+            <input name="SoapFault" message="tns:SoapFault" />
+        </operation>
+    </portType>
+
+ 
+
+    <binding name="SoapFault_SOAPBinding" type="tns:SoapFaultPortType">
+      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+      <operation name="SoapFault">
+        <input message="tns:Soapfault">
+          <soap:body use="literal"/>
+        </input>
+      </operation>
+    </binding>
+
+    <service name="SoapFaultService">
+      <port binding="tns:SoapFault_SOAPBinding" name="SoapFaultPortType">
+    <wsaw:UsingAddressing required="true"/>
+    <soap:address location="http://localhost:9199/SoapFault"/>
+      </port>
+    </service> 
+</definitions>



More information about the jbossws-commits mailing list