[DOSGI-254] Fix handling of inherited exceptions

Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/88b51ef4
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/88b51ef4
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/88b51ef4

Branch: refs/heads/master
Commit: 88b51ef4cbd45eabbf47b6e62a3b2eabd5080bc4
Parents: 97873bb
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Tue Jul 11 11:32:15 2017 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Tue Jul 11 11:32:15 2017 +0200

----------------------------------------------------------------------
 .../org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java    | 3 +++
 .../cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java  | 7 +------
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/88b51ef4/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java
----------------------------------------------------------------------
diff --git 
a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java 
b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java
index 77c72b2..2e3044b 100644
--- 
a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java
+++ 
b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java
@@ -54,6 +54,9 @@ public class ExceptionMapper {
         for (Method m : iType.getDeclaredMethods()) {
             addExceptions(m);
         }
+        for (Method m : iType.getMethods()) {
+            addExceptions(m);
+        }
     }
 
     private void addExceptions(Method m) {

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/88b51ef4/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
----------------------------------------------------------------------
diff --git 
a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
 
b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
index 43a90a7..af31b4d 100644
--- 
a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
+++ 
b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java
@@ -30,7 +30,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.junit.Test;
-import org.osgi.framework.ServiceException;
 
 public class ServiceInvocationHandlerTest {
 
@@ -84,11 +83,7 @@ public class ServiceInvocationHandlerTest {
         proxy.throwException2();
     }
     
-    /**
-     * Shows issue 
https://issues.apache.org/jira/projects/DOSGI/issues/DOSGI-254
-     * We would expect an IOexcpetion here
-     */
-    @Test(expected = ServiceException.class)
+    @Test(expected = IOException.class)
     public void testInheritedException() throws IOException {
         MySubService proxy = ProxyFactory.create(new MyServiceImpl(), 
MySubService.class);
         proxy.throwException1();

Reply via email to