aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1351286 - in /aries/trunk/spi-fly: spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java tck/ tck/apply-to-tck.sh
Date Mon, 18 Jun 2012 10:49:37 GMT
Author: davidb
Date: Mon Jun 18 10:49:37 2012
New Revision: 1351286

URL: http://svn.apache.org/viewvc?rev=1351286&view=rev
Log:
Remove the register="*" functionality from the osgi.serviceloader capability as this functionality
can be achieved by leaving out the directive.
This fixes one failing test on the OSGi ServiceLoader Mediator CT.

Also added a script to prepare and copy the ServiceLoader jar to the CT.

Added:
    aries/trunk/spi-fly/tck/
    aries/trunk/spi-fly/tck/apply-to-tck.sh   (with props)
Modified:
    aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java

Modified: aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java?rev=1351286&r1=1351285&r2=1351286&view=diff
==============================================================================
--- aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
(original)
+++ aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
Mon Jun 18 10:49:37 2012
@@ -73,7 +73,7 @@ public class ProviderBundleTrackerCustom
         Map<String, Object> customAttributes = new HashMap<String, Object>();
         if (bundle.getHeaders().get(SpiFlyConstants.REQUIRE_CAPABILITY) != null) {
             try {
-                providedServices = readRequireCapability(bundle.getHeaders(), customAttributes);
+                providedServices = readServiceLoaderMediatorCapabilityMetadata(bundle.getHeaders(),
customAttributes);
             } catch (InvalidSyntaxException e) {
                 log(LogService.LOG_ERROR, "Unable to read capabilities from bundle " + bundle,
e);
             }
@@ -190,7 +190,7 @@ public class ProviderBundleTrackerCustom
     // An empty list returned means 'all SPIs'
     // A return value of null means no SPIs
     // A populated list means: only these SPIs
-    private List<String> readRequireCapability(Dictionary<?,?> headers, Map<String,
Object> customAttributes) throws InvalidSyntaxException {
+    private List<String> readServiceLoaderMediatorCapabilityMetadata(Dictionary<?,?>
headers, Map<String, Object> customAttributes) throws InvalidSyntaxException {
         Object requirementHeader = headers.get(SpiFlyConstants.REQUIRE_CAPABILITY);
         if (requirementHeader == null)
             return null;
@@ -249,9 +249,6 @@ public class ProviderBundleTrackerCustom
             if ("".equals(registerDirective.trim()))
                 return null;
 
-            if ("*".equals(registerDirective.trim()))
-                return properties;
-
             if (implName.equals(registerDirective.trim()))
                 return properties;
         }
@@ -294,14 +291,14 @@ public class ProviderBundleTrackerCustom
         return null;
     }
 
-    private static Collection<GenericMetadata> findAllMetadata(List<GenericMetadata>
requirements, String namespace) {
-        List<GenericMetadata> reqs = new ArrayList<ManifestHeaderProcessor.GenericMetadata>();
-        for (GenericMetadata req : requirements) {
-            if (namespace.equals(req.getNamespace())) {
-                reqs.add(req);
+    private static Collection<GenericMetadata> findAllMetadata(List<GenericMetadata>
requirementsOrCapabilities, String namespace) {
+        List<GenericMetadata> reqsCaps = new ArrayList<ManifestHeaderProcessor.GenericMetadata>();
+        for (GenericMetadata reqCap : requirementsOrCapabilities) {
+            if (namespace.equals(reqCap.getNamespace())) {
+                reqsCaps.add(reqCap);
             }
         }
-        return reqs;
+        return reqsCaps;
     }
 
     public void modifiedBundle(Bundle bundle, BundleEvent event, Object registrations) {

Added: aries/trunk/spi-fly/tck/apply-to-tck.sh
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/tck/apply-to-tck.sh?rev=1351286&view=auto
==============================================================================
--- aries/trunk/spi-fly/tck/apply-to-tck.sh (added)
+++ aries/trunk/spi-fly/tck/apply-to-tck.sh Mon Jun 18 10:49:37 2012
@@ -0,0 +1,11 @@
+# Fill in the variable below, e.g. OSGI_GIT_DIR=/Users/david/clones/osgi-build
+OSGI_GIT_DIR=...the root of your OSGi build clone...
+
+# Updated the BSN of the implemetation bundle to org.apache.aries.spifly.dynamic as on some
Mac OSX having the bundle suffix
+# causes confusion
+rm META-INF/MANIFEST.MF
+cp ../spi-fly-dynamic-bundle/target/org.apache.aries.spifly.dynamic.bundle-0.4-SNAPSHOT.jar
org.apache.aries.spifly.dynamic-0.4.0.jar
+jar xvf org.apache.aries.spifly.dynamic-0.4.0.jar META-INF/MANIFEST.MF
+cat META-INF/MANIFEST.MF | sed s/org.apache.aries.spifly.dynamic.bundle/org.apache.aries.spifly.dynamic/
> UPDATED_MANIFEST.MF
+jar uvfm org.apache.aries.spifly.dynamic-0.4.0.jar UPDATED_MANIFEST.MF
+cp org.apache.aries.spifly.dynamic-0.4.0.jar $OSGI_GIT_DIR/licensed/repo/org.apache.aries.spifly.dynamic

Propchange: aries/trunk/spi-fly/tck/apply-to-tck.sh
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message