aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1213379 - in /aries/trunk/spi-fly: spi-fly-core/src/main/java/org/apache/aries/spifly/ spi-fly-core/src/test/java/org/apache/aries/spifly/ spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/
Date Mon, 12 Dec 2011 19:21:21 GMT
Author: davidb
Date: Mon Dec 12 19:21:21 2011
New Revision: 1213379

URL: http://svn.apache.org/viewvc?rev=1213379&view=rev
Log:
Allow 'provided' services that aren't actually found in META-INF/services.


Modified:
    aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
    aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
    aries/trunk/spi-fly/spi-fly-core/src/test/java/org/apache/aries/spifly/UtilTest.java
    aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java
    aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookTest.java

Modified: aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java?rev=1213379&r1=1213378&r2=1213379&view=diff
==============================================================================
--- aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
(original)
+++ aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
Mon Dec 12 19:21:21 2011
@@ -152,11 +152,8 @@ public abstract class BaseActivator impl
         return wd;
     }
 
-    public void registerProviderBundle(String registrationClassName, Bundle bundle) {
-        registerProviderBundle(registrationClassName, bundle, Collections.<String, Object>emptyMap());
-    }
-
     public void registerProviderBundle(String registrationClassName, Bundle bundle, Map<String,
Object> customAttributes) {
+        registrationClassName = registrationClassName.trim();
         registeredProviders.putIfAbsent(registrationClassName,
                 Collections.synchronizedSortedMap(new TreeMap<Long, Pair<Bundle, Map<String,
Object>>>()));
 

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=1213379&r1=1213378&r2=1213379&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 Dec 12 19:21:21 2011
@@ -79,7 +79,12 @@ public class ProviderBundleTrackerCustom
         }
 
         if (providedServices == null && bundle.getHeaders().get(SpiFlyConstants.SPI_PROVIDER_HEADER)
!= null) {
-            providedServices = new ArrayList<String>();
+            String header = bundle.getHeaders().get(SpiFlyConstants.SPI_PROVIDER_HEADER).toString().trim();
+            if ("*".equals(header)) {
+                providedServices = new ArrayList<String>();
+            } else {
+                providedServices = Arrays.asList(header.split(","));
+            }
         }
 
         if (providedServices == null) {
@@ -93,6 +98,11 @@ public class ProviderBundleTrackerCustom
                     + bundle.getSymbolicName());
         }
 
+        for (String svc : providedServices) {
+            // Eagerly register any services that are explicitly listed, as they may not
be found in META-INF/services
+            activator.registerProviderBundle(svc, bundle, customAttributes);
+        }
+
         URL servicesDir = bundle.getResource("/" + METAINF_SERVICES);
         if (servicesDir == null)
             return null;

Modified: aries/trunk/spi-fly/spi-fly-core/src/test/java/org/apache/aries/spifly/UtilTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-core/src/test/java/org/apache/aries/spifly/UtilTest.java?rev=1213379&r1=1213378&r2=1213379&view=diff
==============================================================================
--- aries/trunk/spi-fly/spi-fly-core/src/test/java/org/apache/aries/spifly/UtilTest.java (original)
+++ aries/trunk/spi-fly/spi-fly-core/src/test/java/org/apache/aries/spifly/UtilTest.java Mon
Dec 12 19:21:21 2011
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertSam
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.Dictionary;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.ServiceLoader;
 
@@ -90,7 +91,7 @@ public class UtilTest {
             }
         }).anyTimes();
         EasyMock.replay(providerBundle);
-        activator.registerProviderBundle(MySPI.class.getName(), providerBundle);
+        activator.registerProviderBundle(MySPI.class.getName(), providerBundle, new HashMap<String,
Object>());
 
         Bundle clientBundle = EasyMock.createMock(Bundle.class);
         EasyMock.replay(clientBundle);

Modified: aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java?rev=1213379&r1=1213378&r2=1213379&view=diff
==============================================================================
--- aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java
(original)
+++ aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java
Mon Dec 12 19:21:21 2011
@@ -78,7 +78,7 @@ public class ClientWeavingHookGenericCap
 
         // Register the bundle that provides the SPI implementation.
         Bundle providerBundle = mockProviderBundle("impl1", 1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(consumerHeaders, providerBundle);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -120,7 +120,7 @@ public class ClientWeavingHookGenericCap
 
         // Register the bundle that provides the SPI implementation.
         Bundle providerBundle = mockProviderBundle("impl1", 1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(consumerHeaders, providerBundle);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -179,7 +179,7 @@ public class ClientWeavingHookGenericCap
 
         // ok the weaving is done, now prepare the registry for the call
         Bundle providerBundle = mockProviderBundle("impl1", 1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle,
new HashMap<String, Object>());
 
         // Invoke the woven class and check that it propertly sets the TCCL so that the
         // META-INF/services/org.apache.aries.mytest.MySPI file from impl1 is visible.
@@ -210,8 +210,8 @@ public class ClientWeavingHookGenericCap
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
 
         // Register in reverse order to make sure the order in which bundles are sorted is
correct
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
 
         // Invoke the woven class and check that it propertly sets the TCCL so that the
         // META-INF/services/org.apache.aries.mytest.MySPI files from impl1 and impl2 are
visible.
@@ -228,8 +228,8 @@ public class ClientWeavingHookGenericCap
 
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -258,9 +258,9 @@ public class ClientWeavingHookGenericCap
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle3 = mockProviderBundle("impl2_123", 3, new Version(1, 2, 3));
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle3);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle3,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle3);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -289,11 +289,11 @@ public class ClientWeavingHookGenericCap
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -323,11 +323,11 @@ public class ClientWeavingHookGenericCap
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -369,11 +369,11 @@ public class ClientWeavingHookGenericCap
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
@@ -415,11 +415,11 @@ public class ClientWeavingHookGenericCap
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);

Modified: aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookTest.java?rev=1213379&r1=1213378&r2=1213379&view=diff
==============================================================================
--- aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookTest.java
(original)
+++ aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookTest.java
Mon Dec 12 19:21:21 2011
@@ -33,6 +33,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
@@ -77,7 +78,7 @@ public class ClientWeavingHookTest {
 
         // Register the bundle that provides the SPI implementation.
         Bundle providerBundle = mockProviderBundle("impl1", 1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(consumerHeaders, providerBundle);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -118,7 +119,7 @@ public class ClientWeavingHookTest {
 
         // Register the bundle that provides the SPI implementation.
         Bundle providerBundle = mockProviderBundle("impl1", 1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(consumerHeaders, providerBundle);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -176,7 +177,7 @@ public class ClientWeavingHookTest {
 
         // ok the weaving is done, now prepare the registry for the call
         Bundle providerBundle = mockProviderBundle("impl1", 1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle,
new HashMap<String, Object>());
 
         // Invoke the woven class and check that it propertly sets the TCCL so that the
         // META-INF/services/org.apache.aries.mytest.MySPI file from impl1 is visible.
@@ -207,8 +208,8 @@ public class ClientWeavingHookTest {
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
 
         // Register in reverse order to make sure the order in which bundles are sorted is
correct
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
 
         // Invoke the woven class and check that it propertly sets the TCCL so that the
         // META-INF/services/org.apache.aries.mytest.MySPI files from impl1 and impl2 are
visible.
@@ -225,8 +226,8 @@ public class ClientWeavingHookTest {
 
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -255,9 +256,9 @@ public class ClientWeavingHookTest {
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle3 = mockProviderBundle("impl2_123", 3, new Version(1, 2, 3));
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle3);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle3,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle3);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -286,11 +287,11 @@ public class ClientWeavingHookTest {
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -319,11 +320,11 @@ public class ClientWeavingHookTest {
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -353,11 +354,11 @@ public class ClientWeavingHookTest {
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle4);
         activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -409,12 +410,12 @@ public class ClientWeavingHookTest {
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
         Bundle providerBundle3 = mockProviderBundle("impl3", 3);
         Bundle providerBundle4 = mockProviderBundle("impl4", 4);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2);
-        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle3);
-        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4);
-        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4);
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle1,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle2,
new HashMap<String, Object>());
+        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle3,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle4,
new HashMap<String, Object>());
+        activator.registerProviderBundle("org.apache.aries.mytest.AltSPI", providerBundle4,
new HashMap<String, Object>());
 
         Bundle consumerBundle1 = mockConsumerBundle(headers1, providerBundle1, providerBundle2,
providerBundle3, providerBundle4);
         activator.addConsumerWeavingData(consumerBundle1, SpiFlyConstants.SPI_CONSUMER_HEADER);
@@ -481,7 +482,7 @@ public class ClientWeavingHookTest {
         Bundle systembundle = mockSystemBundle();
 
         Bundle providerBundle = mockProviderBundle("impl3", 1);
-        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle);
+        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle,
new HashMap<String, Object>());
 
         Dictionary<String, String> headers = new Hashtable<String, String>();
         headers.put(SpiFlyConstants.SPI_CONSUMER_HEADER, "javax.xml.parsers.DocumentBuilderFactory#newInstance()");
@@ -505,7 +506,7 @@ public class ClientWeavingHookTest {
         Bundle systembundle = mockSystemBundle();
 
         Bundle providerBundle = mockProviderBundle("impl3", 1);
-        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle);
+        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle,
new HashMap<String, Object>());
 
         Dictionary<String, String> headers = new Hashtable<String, String>();
         headers.put(SpiFlyConstants.SPI_CONSUMER_HEADER, "javax.xml.parsers.DocumentBuilderFactory#newInstance();bundleId=0");
@@ -529,7 +530,7 @@ public class ClientWeavingHookTest {
         Bundle systembundle = mockSystemBundle();
 
         Bundle providerBundle = mockProviderBundle("impl3", 1);
-        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle);
+        activator.registerProviderBundle("javax.xml.parsers.DocumentBuilderFactory", providerBundle,
new HashMap<String, Object>());
 
         Dictionary<String, String> headers = new Hashtable<String, String>();
         headers.put(SpiFlyConstants.SPI_CONSUMER_HEADER, "javax.xml.parsers.DocumentBuilderFactory#newInstance();bundle=impl3");



Mime
View raw message