This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag 
org.apache.sling.testing.osgi-mock-1.1.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit 740687dbd680c91d78b0d7147adbd0a8c1cef1f1
Author: Stefan Seifert <[email protected]>
AuthorDate: Thu Oct 16 16:10:16 2014 +0000

    SLING-4042 make sure dependency injection is continued even if not all 
injections succeeded, and report root cause of invocation target exceptions
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/osgi-mock@1632374 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/testing/mock/osgi/ReflectionServiceUtil.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/testing/mock/osgi/ReflectionServiceUtil.java 
b/src/main/java/org/apache/sling/testing/mock/osgi/ReflectionServiceUtil.java
index aa338a3..fe363ab 100644
--- 
a/src/main/java/org/apache/sling/testing/mock/osgi/ReflectionServiceUtil.java
+++ 
b/src/main/java/org/apache/sling/testing/mock/osgi/ReflectionServiceUtil.java
@@ -85,7 +85,7 @@ final class ReflectionServiceUtil {
                         + targetClass.getName(), ex);
             } catch (InvocationTargetException ex) {
                 throw new RuntimeException("Unable to invoke 
activate/deactivate method for class "
-                        + targetClass.getName(), ex);
+                        + targetClass.getName(), ex.getCause());
             }
         }
         log.warn("Method {}(ComponentContext) not found in class {}", 
methodName, targetClass.getName());
@@ -119,7 +119,8 @@ final class ReflectionServiceUtil {
         // try to inject services
         boolean allInjected = true;
         for (Reference reference : references) {
-            allInjected = allInjected && injectServiceReference(reference, 
target, bundleContext);
+            boolean injectSuccess = injectServiceReference(reference, target, 
bundleContext);
+            allInjected = allInjected && injectSuccess;
         }
         return allInjected;
     }
@@ -179,7 +180,7 @@ final class ReflectionServiceUtil {
                                 + targetClass.getName(), ex);
                     } catch (InvocationTargetException ex) {
                         throw new RuntimeException("Unable to invoke method " 
+ bindMethodName + " for class "
-                                + targetClass.getName(), ex);
+                                + targetClass.getName(), ex.getCause());
                     }
                 }
                 return true;
@@ -200,7 +201,7 @@ final class ReflectionServiceUtil {
                                     + targetClass.getName(), ex);
                         } catch (InvocationTargetException ex) {
                             throw new RuntimeException("Unable to invoke 
method " + bindMethodName + " for class "
-                                    + targetClass.getName(), ex);
+                                    + targetClass.getName(), ex.getCause());
                         }
                     }
                     return true;
@@ -221,7 +222,7 @@ final class ReflectionServiceUtil {
                                             + " for class " + 
targetClass.getName(), ex);
                                 } catch (InvocationTargetException ex) {
                                     throw new RuntimeException("Unable to 
invoke method " + bindMethodName
-                                            + " for class " + 
targetClass.getName(), ex);
+                                            + " for class " + 
targetClass.getName(), ex.getCause());
                                 }
                             }
                         }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to