cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r814795 - in /cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest: dispatch/ jaxws/ provider/
Date Mon, 14 Sep 2009 19:32:08 GMT
Author: dkulp
Date: Mon Sep 14 19:32:07 2009
New Revision: 814795

URL: http://svn.apache.org/viewvc?rev=814795&view=rev
Log:
Get jaxws tests back to state of jaxws on 2.1.x

Modified:
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Mon Sep 14 19:32:07 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.systest.dispatch;
 
 import java.io.InputStream;
-import java.net.SocketTimeoutException;
 import java.net.URL;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -372,7 +371,7 @@
             o.get(10, TimeUnit.SECONDS);
             fail("Should have gotten a SocketTimeoutException");
         } catch (ExecutionException ex) {
-            assertTrue(ex.getCause() instanceof SocketTimeoutException);
+            //ignore - expected
         }
 
         later.setRequestType(20000);

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Mon Sep 14 19:32:07 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.systest.jaxws;
 
 import java.io.InputStream;
-import java.lang.reflect.Field;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.HttpURLConnection;
 import java.net.URL;
@@ -49,7 +48,6 @@
 import org.apache.cxf.anonymous_complex_type.SplitName;
 import org.apache.cxf.anonymous_complex_type.SplitNameResponse.Names;
 import org.apache.cxf.binding.soap.Soap11;
-import org.apache.cxf.common.util.ASMHelper;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.helpers.XPathUtils;
@@ -58,8 +56,6 @@
 import org.apache.cxf.ordered_param_holder.ComplexStruct;
 import org.apache.cxf.ordered_param_holder.OrderedParamHolder;
 import org.apache.cxf.ordered_param_holder.OrderedParamHolder_Service;
-import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.CXF2411Result;
-import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.CXF2411SubClass;
 import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.Foo;
 import org.apache.cxf.tests.inherit.Inherit;
 import org.apache.cxf.tests.inherit.InheritService;
@@ -262,52 +258,6 @@
                                                              DocLitWrappedCodeFirstService.class);
         runDocLitTest(port);
     }
-
-    private void setASM(boolean b) throws Exception {
-        Field f = ASMHelper.class.getDeclaredField("oldASM");
-        f.setAccessible(true);
-        f.set(null, !b);
-    }
-    
-    @Test
-    public void testDocLitWrappedCodeFirstServiceNoWsdlNoASM() throws Exception {
-        try {
-            setASM(false);
-            QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService",

-                                       "DocLitWrappedCodeFirstServicePort");
-            QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService",

-                                       "DocLitWrappedCodeFirstService");
-            
-            Service service = Service.create(servName);
-            service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, ServerMisc.DOCLIT_CODEFIRST_URL);
-            DocLitWrappedCodeFirstService port = service.getPort(portName,
-                                                                 DocLitWrappedCodeFirstService.class);
-            runDocLitTest(port);
-        } finally {
-            setASM(true);
-        }
-    }
-
-    @Test
-    public void testDocLitWrappedCodeFirstServiceWsdlNoASM() throws Exception {
-        try {
-            setASM(false);
-            QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService",

-                                       "DocLitWrappedCodeFirstServicePort");
-            QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService",

-                                       "DocLitWrappedCodeFirstService");
-            
-            Service service = Service.create(new URL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl"),
-                                             servName);
-            DocLitWrappedCodeFirstService port = service.getPort(portName,
-                                                                 DocLitWrappedCodeFirstService.class);
-            runDocLitTest(port);
-        } finally {
-            setASM(true);
-        }
-    }
-    
-
     
     @Test
     public void testSimpleClientWithWsdl() throws Exception {
@@ -329,24 +279,12 @@
         assertEquals("Hello", echoMsg);
     }
     private void runDocLitTest(DocLitWrappedCodeFirstService port) throws Exception {
-        CXF2411Result<CXF2411SubClass> o = port.doCXF2411();
-        assertNotNull(o);
-        assertNotNull(o.getContent());
-        Object[] ar = o.getContent(); 
-        assertTrue(ar[0] instanceof CXF2411SubClass);
-        Foo foo = new Foo();
-        foo.setName("blah");
-        assertEquals("blah", port.modifyFoo(foo).getName());
-        
-
-        assertEquals("hello", port.outOnly(new Holder<String>(), new Holder<String>()));
-        
         long start = System.currentTimeMillis();
         port.doOneWay();
         assertTrue((System.currentTimeMillis() - start) < 500);
         
         assertEquals("Hello", port.echoStringNotReallyAsync("Hello"));
-
+        
         Set<Foo> fooSet = port.getFooSet();
         assertEquals(2, fooSet.size());
         assertEquals("size: 2", port.doFooList(new ArrayList<Foo>(fooSet)));
@@ -428,12 +366,7 @@
         int ints[] = port.echoIntArray(new int[] {1, 2 , 3}, null);
         assertEquals(3, ints.length);
         assertEquals(1, ints[0]);
-
-        if (new ASMHelper().createClassWriter() != null) {
-            //doing the type adapter things and such really 
-            //requires the ASM generated helper classes
-            assertEquals("Val", port.createBar("Val").getName());
-        }
+        assertEquals("Val", port.createBar("Val").getName());
         testExceptionCases(port);
     }
     
@@ -474,26 +407,7 @@
             fail("Expected exception not found");
         } catch (ComplexException ex) {
             assertEquals("Throw user fault -3", ex.getMessage());
-        }    
-        
-        try {
-            Foo foo = new Foo();
-            foo.setNameIgnore("DoNoName");
-            port.modifyFoo(foo);
-            fail("Expected exception not found");
-        } catch (SOAPFaultException ex) {
-            assertTrue(ex.getMessage().contains("NoName is not a valid name"));
-        }    
-        try {
-            Foo foo = new Foo();
-            foo.setNameIgnore("NoName");
-            port.modifyFoo(foo);
-            fail("Expected exception not found");
-        } catch (SOAPFaultException ex) {
-            assertTrue(ex.getMessage().contains("NoName is not a valid name"));
-        }    
-
-
+        }          
     }
     
     

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
Mon Sep 14 19:32:07 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.systest.jaxws;
 
 import java.io.InputStream;
-import java.io.StringReader;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.HttpURLConnection;
 import java.util.HashMap;
@@ -37,21 +36,15 @@
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.Dispatch;
 import javax.xml.ws.Endpoint;
 import javax.xml.xpath.XPathConstants;
 
 import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.helpers.XPathUtils;
-import org.apache.cxf.staxutils.W3CNamespaceContext;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.apache.hello_world_rpclit.GreeterRPCLit;
@@ -119,28 +112,7 @@
             throw (Exception)ex.getCause();
         }
     }
-     
-    @Test
-    public void testDispatchClient() throws Exception {
-        SOAPServiceRPCLit service = new SOAPServiceRPCLit();
-        Dispatch<Source> disp = service.createDispatch(portName, Source.class, 
-                                                       javax.xml.ws.Service.Mode.PAYLOAD);
-        
-        String req = "<ns1:sendReceiveData xmlns:ns1=\"http://apache.org/hello_world_rpclit\">"
-            + "<in xmlns:ns2=\"http://apache.org/hello_world_rpclit/types\">"
-            + "<ns2:elem1>elem1</ns2:elem1><ns2:elem2>elem2</ns2:elem2><ns2:elem3>45</ns2:elem3>"
-            + "</in></ns1:sendReceiveData>";
-        Source source = new StreamSource(new StringReader(req));
-        Source resp = disp.invoke(source);
-        assertNotNull(resp);
-        
-        Node nd = XMLUtils.fromSource(resp);
-        if (nd instanceof Document) {
-            nd = ((Document)nd).getDocumentElement();
-        }
-        XPathUtils xpu = new XPathUtils(new W3CNamespaceContext((Element)nd));
-        assertTrue(xpu.isExist("/ns1:sendReceiveDataResponse/out", nd, XPathConstants.NODE));
-    }
+    
     @Test
     public void testComplexType() throws Exception {
         SOAPServiceRPCLit service = new SOAPServiceRPCLit();

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Mon Sep 14 19:32:07 2009
@@ -104,13 +104,6 @@
         assertTrue("server did not launch correctly", launchServer(Server.class));
     }
     @Test
-    public void testCXF2419() {
-        org.apache.cxf.hello_world.elrefs.SOAPService serv 
-            = new org.apache.cxf.hello_world.elrefs.SOAPService();
-        assertEquals("Hello CXF", serv.getSoapPort().greetMe("CXF"));
-    }
-    
-    @Test
     public void testBase64() throws URISyntaxException  {
         URL wsdl = getClass().getResource("/wsdl/others/dynamic_client_base64.wsdl");
         assertNotNull(wsdl);

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Mon Sep 14 19:32:07 2009
@@ -166,22 +166,4 @@
             return dbReves;
         }
     }
-    
-    CXF2411Result<CXF2411SubClass> doCXF2411();
-    
-    public class CXF2411Result<T extends CXF2411Base> {
-        private T[] content;
-        public T[] getContent() {
-            return content;
-        }
-        public void setContent(T[] content) {
-            this.content = content;
-        }
-    }
-
-    public class CXF2411Base {
-    }
-
-    public class CXF2411SubClass extends CXF2411Base {
-    }
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Mon Sep 14 19:32:07 2009
@@ -223,12 +223,5 @@
         return f;
     }
 
-    public CXF2411Result<CXF2411SubClass> doCXF2411() {
-        CXF2411Result<CXF2411SubClass> ret = new CXF2411Result<CXF2411SubClass>();
-        CXF2411SubClass content[] = new CXF2411SubClass[1];
-        content[0] = new CXF2411SubClass();
-        ret.setContent(content);
-        return ret;
-    }
     
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
Mon Sep 14 19:32:07 2009
@@ -61,8 +61,7 @@
         connection.getOutputStream().close();
         is.close();
 
-        assertTrue("wrong content type: " + connection.getContentType(),
-                   connection.getContentType().contains("multipart/related"));
+        assertTrue("wrong content type", connection.getContentType().contains("multipart/related"));
         String input = IOUtils.toString(connection.getInputStream());
         
         int idx = input.indexOf("--uuid");

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
Mon Sep 14 19:32:07 2009
@@ -71,9 +71,6 @@
         DOMSource response = new DOMSource();
 
         Node n = request.getNode();
-        if (n instanceof Document) {
-            n = ((Document)n).getDocumentElement();
-        }
         if (n.getLocalName().equals(sayHi.getLocalPart())) {
             response.setNode(sayHiResponse);
         } else if (n.getLocalName().equals(greetMe.getLocalPart())) {

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
Mon Sep 14 19:32:07 2009
@@ -19,11 +19,9 @@
 
 package org.apache.cxf.systest.provider;
 import java.io.InputStream;
-import java.util.Iterator;
 
 import javax.jws.HandlerChain;
 import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.SOAPBody;
 import javax.xml.soap.SOAPMessage;
@@ -34,8 +32,6 @@
 
 import org.w3c.dom.Node;
 
-import org.apache.cxf.helpers.CastUtils;
-
 //The following wsdl file is used.
 //wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
 @WebServiceProvider(portName = "SoapPortProviderRPCLit1", 
@@ -77,17 +73,6 @@
             }
             if (n.getLocalName().equals(sayHi.getLocalPart())) {
                 response = sayHiResponse;
-                if (request.countAttachments() > 0) {
-                    MessageFactory factory = MessageFactory.newInstance();            
-                    InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
-                    response =  factory.createMessage(null, is);
-                    is.close();
-                    Iterator<AttachmentPart> it = CastUtils.cast(request.getAttachments(),

-                                                                 AttachmentPart.class);
-                    while (it.hasNext()) {
-                        response.addAttachmentPart(it.next());
-                    }
-                }
             } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
                 response = greetMeResponse;
             } else {

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java?rev=814795&r1=814794&r2=814795&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
Mon Sep 14 19:32:07 2009
@@ -112,17 +112,7 @@
         SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
         assertNotNull(service);
 
-        
-        String response1 = new String("TestGreetMeResponseServerLogicalHandlerServerSOAPHandler");
-        String response2 = new String("TestSayHiResponse");
-        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
-        String greeting = greeter.greetMe("Milestone-0");
-        assertNotNull("no response received from service", greeting);
-        assertEquals(response1, greeting);
-
-        String reply = greeter.sayHi();
-        assertNotNull("no response received from service", reply);
-        assertEquals(response2, reply);
+        doGreeterRPCLit(service, portName, 2, false);
     }
 
     @Test



Mime
View raw message