felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r963403 - /felix/trunk/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java
Date Mon, 12 Jul 2010 17:48:31 GMT
Author: clement
Date: Mon Jul 12 17:48:30 2010
New Revision: 963403

URL: http://svn.apache.org/viewvc?rev=963403&view=rev
Log:
Adapt the temporal dependency handler test suite to fit the change made for FELIX-2472 [iPOJO]
Proxies should throw the OSGi service exception.

Modified:
    felix/trunk/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java

Modified: felix/trunk/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java?rev=963403&r1=963402&r2=963403&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java
(original)
+++ felix/trunk/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java
Mon Jul 12 17:48:30 2010
@@ -38,10 +38,17 @@ public class CheckServiceProviderHelper 
         if (fs != null) { // Cannot be null
             try {
                 return fs.foo();
-            } catch (NullPointerException e) {
-                // Can throw a NPE for null policy.
-                System.out.println(e.getMessage());
-                return false;
+            } catch (RuntimeException e) { // Now it's a runtime exception (FELIX-2472)
+                // Can throw a RTE for null policy and for time out
+                if (e.getMessage().equals("No service available")) {
+                    // Has detected a null policy.
+                    System.out.println(e.getMessage());
+                    return false;
+                } else {
+                    // Timeout
+                    // Propagate the exception
+                    throw e;
+                }
             }
         }
         return false;



Mime
View raw message