You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/09/02 17:30:55 UTC

svn commit: r810569 - in /cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest: dispatch/ mtom/ provider/ servlet/

Author: dkulp
Date: Wed Sep  2 15:30:54 2009
New Revision: 810569

URL: http://svn.apache.org/viewvc?rev=810569&view=rev
Log:
Fix tests for differences between 2.2 and 2.1

Modified:
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
    cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java

Modified: cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java Wed Sep  2 15:30:54 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/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java Wed Sep  2 15:30:54 2009
@@ -47,6 +47,7 @@
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.WSPolicyFeature;
 import org.apache.cxf.ws.policy.selector.FirstAlternativeSelector;
@@ -112,6 +113,8 @@
             policyElements.add(DOMUtils.readXml(
                 getClass().getResourceAsStream("mtom-policy-optional.xml"))
                            .getDocumentElement());
+            getBus().getExtension(PolicyConstants.class)
+               .setNamespace(PolicyConstants.NAMESPACE_W3_200607);
         } 
         policyFeature.setPolicyElements(policyElements);       
         

Modified: cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java Wed Sep  2 15:30:54 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/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java Wed Sep  2 15:30:54 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/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java Wed Sep  2 15:30:54 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/uncategorized/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java Wed Sep  2 15:30:54 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

Modified: cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java?rev=810569&r1=810568&r2=810569&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java Wed Sep  2 15:30:54 2009
@@ -22,7 +22,6 @@
 
 import org.w3c.dom.Document;
 
-import com.meterware.httpunit.HttpNotFoundException;
 import com.meterware.httpunit.PostMethodWebRequest;
 import com.meterware.httpunit.WebRequest;
 import com.meterware.httpunit.WebResponse;
@@ -149,17 +148,17 @@
     }
     
     @Test
-    public void testIgnoreServiceList() throws Exception {
+    public void testGetServiceList() throws Exception {
         ServletUnitClient client = newClient();
         client.setExceptionsThrownOnErrorStatus(true);
         
         WebRequest req = 
             new GetMethodQueryWebRequest(CONTEXT_URL + "/services/");
-        try {
-            client.getResponse(req);
-            fail();
-        } catch (HttpNotFoundException ex) {
-            // expected
-        }
+        WebResponse res = client.getResponse(req);
+        assertEquals(200, res.getResponseCode());
+        assertEquals("text/html", res.getContentType());
+        assertEquals("Here should have no services links ", 0, res.getLinks().length);
+                
     }
+    
 }