aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1206197 - in /aries/trunk/spi-fly: spi-fly-core/src/main/java/org/apache/aries/spifly/api/SpiFlyConstants.java spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java
Date Fri, 25 Nov 2011 14:44:19 GMT
Author: davidb
Date: Fri Nov 25 14:44:19 2011
New Revision: 1206197

URL: http://svn.apache.org/viewvc?rev=1206197&view=rev
Log:
Support for capability filtering on bundle versions.

Modified:
    aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/api/SpiFlyConstants.java
    aries/trunk/spi-fly/spi-fly-dynamic-bundle/src/test/java/org/apache/aries/spifly/dynamic/ClientWeavingHookGenericCapabilityTest.java

Modified: aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/api/SpiFlyConstants.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/api/SpiFlyConstants.java?rev=1206197&r1=1206196&r2=1206197&view=diff
==============================================================================
--- aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/api/SpiFlyConstants.java
(original)
+++ aries/trunk/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/api/SpiFlyConstants.java
Fri Nov 25 14:44:19 2011
@@ -19,6 +19,7 @@
 package org.apache.aries.spifly.api;
 
 public interface SpiFlyConstants {
+    // Not taken from OSGi Constants because this code needs to compile with the 4.2 OSGi
classes.
     String PROVIDE_CAPABILITY = "Provide-Capability";
     String REQUIRE_CAPABILITY = "Require-Capability";
 

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=1206197&r1=1206196&r2=1206197&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
Fri Nov 25 14:44:19 2011
@@ -249,11 +249,10 @@ public class ClientWeavingHookGenericCap
         Assert.assertEquals("Only the services from bundle impl2 should be selected", "HELLO5",
result);
     }
 
-    /* Not yet supported in the generic capability model
     @Test
     public void testClientSpecifyingProviderVersion() throws Exception {
         Dictionary<String, String> headers = new Hashtable<String, String>();
-        headers.put(SpiFlyConstants.SPI_CONSUMER_HEADER, "java.util.ServiceLoader#load(java.lang.Class);bundle=impl2:version=1.2.3");
+        headers.put(SpiFlyConstants.REQUIRE_CAPABILITY, "osgi.spi.provider; effective:=active;
filter:=\"(&(bundle-symbolic-name=impl2)(bundle-version=1.2.3))\"");
 
         Bundle providerBundle1 = mockProviderBundle("impl1", 1);
         Bundle providerBundle2 = mockProviderBundle("impl2", 2);
@@ -263,7 +262,7 @@ public class ClientWeavingHookGenericCap
         activator.registerProviderBundle("org.apache.aries.mytest.MySPI", providerBundle3);
 
         Bundle consumerBundle = mockConsumerBundle(headers, providerBundle1, providerBundle2,
providerBundle3);
-        activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.SPI_CONSUMER_HEADER);
+        activator.addConsumerWeavingData(consumerBundle, SpiFlyConstants.REQUIRE_CAPABILITY);
         Bundle spiFlyBundle = mockSpiFlyBundle(consumerBundle, providerBundle1, providerBundle2,
providerBundle3);
         WeavingHook wh = new ClientWeavingHook(spiFlyBundle.getBundleContext(), activator);
 
@@ -279,7 +278,7 @@ public class ClientWeavingHookGenericCap
         Object result = method.invoke(cls.newInstance(), "hello");
         Assert.assertEquals("Only the services from bundle impl2 should be selected", "Updated!hello!Updated",
result);
     }
-    */
+
     @Test
     public void testClientMultipleTargetBundles() throws Exception {
         Dictionary<String, String> headers = new Hashtable<String, String>();



Mime
View raw message