cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r831600 - in /cxf/trunk: api/src/main/java/org/apache/cxf/ parent/ rt/core/src/main/java/org/apache/cxf/service/invoker/ rt/databinding/aegis/ rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/ rt/databinding/aegis/src/test/java...
Date Sat, 31 Oct 2009 22:07:27 GMT
Author: bimargulies
Date: Sat Oct 31 22:07:27 2009
New Revision: 831600

URL: http://svn.apache.org/viewvc?rev=831600&view=rev
Log:
As a result of CXF-1471, add unit test for GET against Aegis+JAX-WS, and improve error message
when
using GET against an operation that isn't there.

Added:
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/AegisJaxwsGetTest.java
  (with props)
Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
    cxf/trunk/rt/databinding/aegis/pom.xml
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/Echo.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java?rev=831600&r1=831599&r2=831600&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java Sat Oct 31 22:07:27 2009
@@ -42,7 +42,7 @@
     /** 
      * Creates a new bus. 
      * While concrete <code>BusFactory</code> may offer differently
-     * parametrized methods for creating a bus, all factories support
+     * parameterized methods for creating a bus, all factories support
      * this no-arg factory method.
      *
      * @return the newly created bus.

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=831600&r1=831599&r2=831600&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Sat Oct 31 22:07:27 2009
@@ -836,6 +836,11 @@
                 </exclusions>
             </dependency>
             <dependency>
+              <groupId>commons-codec</groupId>
+              <artifactId>commons-codec</artifactId>
+              <version>1.3</version>
+            </dependency>
+            <dependency>
                 <groupId>commons-logging</groupId>
                 <artifactId>commons-logging</artifactId>
                 <version>1.1.1</version>

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java?rev=831600&r1=831599&r2=831600&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java Sat
Oct 31 22:07:27 2009
@@ -52,6 +52,11 @@
         try {
 
             BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+            if (bop == null) {
+                LOG.severe(new Message("MISSING_BINDING_OPERATION", LOG).toString());
+                throw new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG, 
+                                             "No binding operation info", "unknown method",
"unknown"));
+            }
             MethodDispatcher md = (MethodDispatcher) 
                 exchange.get(Service.class).get(MethodDispatcher.class.getName());
             Method m = md.getMethod(bop);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties?rev=831600&r1=831599&r2=831600&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties Sat
Oct 31 22:07:27 2009
@@ -26,3 +26,4 @@
 EXCEPTION_INVOKING_OBJECT={0} while invoking {1} with params {2}.
 SUSPENDED_INVOCATION_EXCEPTION=Invocation of method {1} on object {0} with params {2} has
been suspended.
 INVOKING_METHOD=Invoking method {1} on object {0} with params {2}.
+MISSING_BINDING_OPERATION= Invocation without a binding operation.

Modified: cxf/trunk/rt/databinding/aegis/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/pom.xml?rev=831600&r1=831599&r2=831600&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/pom.xml (original)
+++ cxf/trunk/rt/databinding/aegis/pom.xml Sat Oct 31 22:07:27 2009
@@ -95,6 +95,16 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+          <groupId>commons-httpclient</groupId>
+          <artifactId>commons-httpclient</artifactId>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>commons-codec</groupId>
+          <artifactId>commons-codec</artifactId>
+          <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Added: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/AegisJaxwsGetTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/AegisJaxwsGetTest.java?rev=831600&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/AegisJaxwsGetTest.java
(added)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/AegisJaxwsGetTest.java
Sat Oct 31 22:07:27 2009
@@ -0,0 +1,72 @@
+/**
+ * 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.aegis.jaxws;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
+import org.apache.cxf.aegis.services.Echo;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.test.AbstractCXFTest;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class AegisJaxwsGetTest extends AbstractCXFTest {
+    
+    @Before
+    public void before() throws Exception {
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.setAddress("http://localhost:9167/Echo");
+        sf.setDataBinding(new AegisDatabinding());
+        sf.setServiceBean(new Echo());
+        Server server = sf.create();
+        // turn off nanny in URIMappingInterceptor
+        server.getEndpoint()
+            .getService().put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
+    }
+    
+    
+    private HttpClient createClient() {
+        HttpClient httpClient = new HttpClient();
+        httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
+        return httpClient;
+    }
+    
+    @Test
+    public void testGetEcho() throws Exception {
+        HttpClient httpClient = createClient();
+        String url = "http://localhost:9167/Echo/echo/echo/hello";
+        HttpMethod method = null;
+        method = new GetMethod(url);
+        int status = httpClient.executeMethod(method);
+        assertEquals(HttpStatus.SC_OK, status);
+        String result = method.getResponseBodyAsString();
+        assertTrue(result.contains("hello"));
+        method.releaseConnection();
+    }
+}

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/jaxws/AegisJaxwsGetTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/Echo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/Echo.java?rev=831600&r1=831599&r2=831600&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/Echo.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/Echo.java Sat
Oct 31 22:07:27 2009
@@ -18,13 +18,15 @@
  */
 package org.apache.cxf.aegis.services;
 
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+
 /**
- * Echo
- * 
- * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ * Simple echo service.
  */
 public class Echo {
-    public String echo(String echo) {
+    @WebMethod
+    public String echo(@WebParam(name = "echo") String echo) {
         return echo;
     }
 }



Mime
View raw message