aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1603766 - in /aries/trunk/subsystem/subsystem-core/src: main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java test/java/org/apache/aries/subsystem/core/internal/BundleRevisionResourceTest.java
Date Thu, 19 Jun 2014 08:59:11 GMT
Author: davidb
Date: Thu Jun 19 08:59:11 2014
New Revision: 1603766

URL: http://svn.apache.org/r1603766
Log:
ARIES-1214 NPE in subsystem-core when used without modeller.

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java
    aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/BundleRevisionResourceTest.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java?rev=1603766&r1=1603765&r2=1603766&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java
Thu Jun 19 08:59:11 2014
@@ -76,7 +76,7 @@ public class BundleRevisionResource impl
         Activator activator = Activator.getInstance();
         ServiceModeller modeller = activator.getServiceModeller();
         if (modeller == null)
-            return null;
+            return Collections.emptyList();
         ServiceModeller.ServiceModel model =
                 modeller.computeRequirementsAndCapabilities(this, new BundleDirectory(revision.getBundle()));
         return model.getServiceRequirements();

Modified: aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/BundleRevisionResourceTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/BundleRevisionResourceTest.java?rev=1603766&r1=1603765&r2=1603766&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/BundleRevisionResourceTest.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/BundleRevisionResourceTest.java
Thu Jun 19 08:59:11 2014
@@ -43,9 +43,16 @@ public class BundleRevisionResourceTest 
     }
 
     @Test
-    public void testNoServiceCapabilities() {
+    public void testNoModellerServiceCapabilities() {
         BundleRevision br = EasyMock.createNiceMock(BundleRevision.class);
         BundleRevisionResource brr = new BundleRevisionResource(br);
         assertEquals(0, brr.getCapabilities("osgi.service").size());
     }
+
+    @Test
+    public void testNoModellerServiceRequirements() {
+        BundleRevision br = EasyMock.createNiceMock(BundleRevision.class);
+        BundleRevisionResource brr = new BundleRevisionResource(br);
+        assertEquals(0, brr.getRequirements("osgi.service").size());
+    }
 }



Mime
View raw message