cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1465529 - in /cxf/branches/2.5.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/
Date Mon, 08 Apr 2013 02:30:08 GMT
Author: ffang
Date: Mon Apr  8 02:30:08 2013
New Revision: 1465529

URL: http://svn.apache.org/r1465529
Log:
Merged revisions 1465527 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

................
  r1465527 | ffang | 2013-04-08 09:40:19 +0800 (一, 08  4 2013) | 20 lines
  
  Merged revisions 1465526 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
  
  ................
    r1465526 | ffang | 2013-04-08 09:33:19 +0800 (一, 08  4 2013) | 13 lines
    
    Merged revisions 1465337,1465373 via svnmerge from 
    https://svn.apache.org/repos/asf/cxf/trunk
    
    ........
      r1465337 | ffang | 2013-04-07 15:42:23 +0800 (日, 07  4 2013) | 1 line
      
      [CXF-4940]add a testcase to demonstrate exception hierarchy works
    ........
      r1465373 | ffang | 2013-04-07 20:32:59 +0800 (日, 07  4 2013) | 1 line
      
      [CXF-4940]CXF not (always) responding with the correct exception when working with an
exception hierarchy 
    ........
  ................
................

Added:
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersSubException.java
      - copied unchanged from r1465527, cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersSubException.java
Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersException.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloInterface.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1465526
  Merged /cxf/trunk:r1465337-1465373
  Merged /cxf/branches/2.6.x-fixes:r1465527

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java?rev=1465529&r1=1465528&r2=1465529&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
Mon Apr  8 02:30:08 2013
@@ -143,16 +143,20 @@ public class FaultOutInterceptor extends
      * @param class1
      * @return
      */
-    public FaultInfo getFaultForClass(BindingOperationInfo op, Class class1) {
+    public FaultInfo getFaultForClass(BindingOperationInfo op, Class<?> class1) {
+        FaultInfo selectedFaultInfo = null;
+        Class<?> selectedFaultInfoClass = null;
         for (BindingFaultInfo bfi : op.getFaults()) {
 
             FaultInfo faultInfo = bfi.getFaultInfo();
-            Class<?> c = (Class)faultInfo.getProperty(Class.class.getName());
-            if (c != null && c.isAssignableFrom(class1)) {
-                return faultInfo;
+            Class<?> c = (Class<?>)faultInfo.getProperty(Class.class.getName());
+            if (c != null && c.isAssignableFrom(class1)
+                && (selectedFaultInfo == null || selectedFaultInfoClass.isAssignableFrom(c)))
{
+                selectedFaultInfo = faultInfo;
+                selectedFaultInfoClass = c;
+
             }
         }
-
-        return null;
+        return selectedFaultInfo;
     }
 }

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?rev=1465529&r1=1465528&r2=1465529&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
Mon Apr  8 02:30:08 2013
@@ -47,6 +47,7 @@ import org.apache.cxf.frontend.ServerFac
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.jaxws.service.AddNumbersException;
+import org.apache.cxf.jaxws.service.AddNumbersSubException;
 import org.apache.cxf.jaxws.service.ArrayService;
 import org.apache.cxf.jaxws.service.ArrayServiceImpl;
 import org.apache.cxf.jaxws.service.Entity;
@@ -247,6 +248,15 @@ public class CodeFirstTest extends Abstr
         } catch (AddNumbersException e) {
             assertEquals(e.getInfo(), "Sum is less than 0.");
         }
+        
+        try {   
+            proxy.addNumbers(1, 99);
+            fail("should throw AddNumbersSubException");
+        } catch (AddNumbersSubException e) {
+            assertEquals(e.getSubInfo(), "Sum is 100");
+        } catch (AddNumbersException e) {
+            fail("should throw AddNumbersSubException");
+        }
 
     }
 

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersException.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersException.java?rev=1465529&r1=1465528&r2=1465529&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersException.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/AddNumbersException.java
Mon Apr  8 02:30:08 2013
@@ -23,7 +23,7 @@ import javax.xml.ws.WebFault;
 @WebFault
 public class AddNumbersException extends Exception {
     private static final long serialVersionUID = 1L;
-    private String info;
+    protected String info;
 
     public AddNumbersException() {
     }

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java?rev=1465529&r1=1465528&r2=1465529&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
Mon Apr  8 02:30:08 2013
@@ -70,10 +70,13 @@ public class Hello {
     }
     
     @WebMethod
-    public String addNumbers(int arg0, int arg1) throws AddNumbersException {
+    public String addNumbers(int arg0, int arg1) throws AddNumbersSubException, AddNumbersException
{
         if (arg0 + arg1 < 0) {
             throw new AddNumbersException("Sum is less than 0.");
         }
+        if (arg0 + arg1 == 100) {
+            throw new AddNumbersSubException("Sum is 100");
+        }
         return "Result = " + String.valueOf(arg0 + arg1);
     }
 }

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloInterface.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloInterface.java?rev=1465529&r1=1465528&r2=1465529&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloInterface.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloInterface.java
Mon Apr  8 02:30:08 2013
@@ -34,5 +34,5 @@ public interface HelloInterface {
     @WebMethod
     List<String> getStringList(List<String> list);
     @WebMethod
-    String addNumbers(int arg0, int arg1) throws AddNumbersException;
+    String addNumbers(int arg0, int arg1) throws AddNumbersSubException, AddNumbersException;
 }



Mime
View raw message