Author: iocanel
Date: Sat Oct 22 13:14:40 2011
New Revision: 1187713

URL: http://svn.apache.org/viewvc?rev=1187713&view=rev
Log:
[DIRECTMEMORY-22] Added osgi integration tests that test Cache as an OSGi 
service.

Added:
    
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/DirectMemoryOsgiTestSupport.java
    
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceExportingActivator.java
    
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceTest.java
      - copied, changed from r1186497, 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java
Modified:
    incubator/directmemory/trunk/itests/osgi/pom.xml
    
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java
    incubator/directmemory/trunk/pom.xml

Modified: incubator/directmemory/trunk/itests/osgi/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/itests/osgi/pom.xml?rev=1187713&r1=1187712&r2=1187713&view=diff
==============================================================================
--- incubator/directmemory/trunk/itests/osgi/pom.xml (original)
+++ incubator/directmemory/trunk/itests/osgi/pom.xml Sat Oct 22 13:14:40 2011
@@ -34,6 +34,11 @@ under the License.
 
   <dependencies>
 
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+    </dependency>
+
     <!-- Test -->
     <dependency>
       <groupId>org.apache.directmemory</groupId>

Added: 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/DirectMemoryOsgiTestSupport.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/DirectMemoryOsgiTestSupport.java?rev=1187713&view=auto
==============================================================================
--- 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/DirectMemoryOsgiTestSupport.java
 (added)
+++ 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/DirectMemoryOsgiTestSupport.java
 Sat Oct 22 13:14:40 2011
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.directmemory.tests.osgi;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.options.UrlProvisionOption;
+import org.ops4j.store.Store;
+import org.ops4j.store.StoreFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+
+public class DirectMemoryOsgiTestSupport {
+
+  public static final String JVM_DEBUG_OPTIONS = 
"-Xrunjdwp:transport=dt_socket,server=y,suspend=%s,address=%s";
+  public static final String DO_SUSPEND = "y";
+  public static final String DONT_SUSPEND = "n";
+
+  public static final long DEFAULT_TIMEOUT = 30000;
+
+
+  @Inject
+  protected BundleContext bundleContext;
+
+  protected <T> T getOsgiService(Class<T> type, long timeout) {
+    return getOsgiService(type, null, timeout);
+  }
+
+  protected <T> T getOsgiService(Class<T> type) {
+    return getOsgiService(type, null, DEFAULT_TIMEOUT);
+  }
+
+  /*
+  * Explode the dictionary into a ,-delimited list of key=value pairs
+  */
+  private static String explode(Dictionary dictionary) {
+    Enumeration keys = dictionary.keys();
+    StringBuffer result = new StringBuffer();
+    while (keys.hasMoreElements()) {
+      Object key = keys.nextElement();
+      result.append(String.format("%s=%s", key, dictionary.get(key)));
+      if (keys.hasMoreElements()) {
+        result.append(", ");
+      }
+    }
+    return result.toString();
+  }
+
+  protected <T> T getOsgiService(Class<T> type, String filter, long timeout) {
+    ServiceTracker tracker = null;
+    try {
+      String flt;
+      if (filter != null) {
+        if (filter.startsWith("(")) {
+          flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")" + 
filter + ")";
+        } else {
+          flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")(" + 
filter + "))";
+        }
+      } else {
+        flt = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+      }
+      Filter osgiFilter = FrameworkUtil.createFilter(flt);
+      tracker = new ServiceTracker(bundleContext, osgiFilter, null);
+      tracker.open(true);
+
+      Object svc = type.cast(tracker.waitForService(timeout));
+      if (svc == null) {
+        Dictionary dic = bundleContext.getBundle().getHeaders();
+        System.err.println("Test bundle headers: " + explode(dic));
+
+        for (ServiceReference ref : 
asCollection(bundleContext.getAllServiceReferences(null, null))) {
+          System.err.println("ServiceReference: " + ref);
+        }
+
+        for (ServiceReference ref : 
asCollection(bundleContext.getAllServiceReferences(null, flt))) {
+          System.err.println("Filtered ServiceReference: " + ref);
+        }
+
+        throw new RuntimeException("Gave up waiting for service " + flt);
+      }
+      return type.cast(svc);
+    } catch (InvalidSyntaxException e) {
+      throw new IllegalArgumentException("Invalid filter", e);
+    } catch (InterruptedException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+
+  /*
+  * Provides an iterable collection of references, even if the original array 
is null
+  */
+  private static Collection<ServiceReference> asCollection(ServiceReference[] 
references) {
+    return references != null ? Arrays.asList(references) : 
Collections.<ServiceReference>emptyList();
+  }
+
+  /**
+   * Returns an array of {@link Option} required to install DynamicMemory on 
any OSGi container.
+   *
+   * @return
+   */
+  public static Option[] getDynamicMemoryOptions() {
+    return new Option[]{
+            
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.2.8"),
+            
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("1.6.2"),
+            
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-service").version("1.6.2"),
+            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.guava").version("09_1"),
+            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.ant").version("1.7.0_5"),
+            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.oro").version("2.0.8_5"),
+            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.josql").version("1.5_5"),
+            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.aspectj").version("1.6.8_2"),
+            
mavenBundle().groupId("com.dyuproject.protostuff").artifactId("protostuff-uberjar").version("1.0.2"),
+            
mavenBundle().groupId("org.apache.directmemory").artifactId("directmemory-cache").version("0.5.5-SNAPSHOT")
+    };
+  }
+
+  protected static UrlProvisionOption bundle(final InputStream stream) throws 
IOException {
+    Store<InputStream> store = StoreFactory.defaultStore();
+    return new 
UrlProvisionOption(store.getLocation(store.store(stream)).toURL().toExternalForm());
+  }
+
+  /**
+   * Returns an {@link Option} that will enable debugging of the test.
+   *
+   * @param port
+   * @param suspend
+   * @return
+   */
+  public static Option enabledDebuggingOnPort(int port, boolean suspend) {
+    if (suspend) {
+      return vmOption(String.format(JVM_DEBUG_OPTIONS, DO_SUSPEND, port));
+    } else {
+      return vmOption(String.format(JVM_DEBUG_OPTIONS, DONT_SUSPEND, port));
+    }
+  }
+}

Added: 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceExportingActivator.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceExportingActivator.java?rev=1187713&view=auto
==============================================================================
--- 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceExportingActivator.java
 (added)
+++ 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceExportingActivator.java
 Sat Oct 22 13:14:40 2011
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.directmemory.tests.osgi.cache;
+
+import java.util.Properties;
+import org.apache.directmemory.cache.CacheService;
+import org.apache.directmemory.cache.CacheServiceImpl;
+import org.apache.directmemory.measures.Ram;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class CacheServiceExportingActivator implements BundleActivator {
+
+  CacheService cacheService = new CacheServiceImpl();
+
+  @Override
+  public void start(BundleContext context) throws Exception {
+    cacheService.init(1, Ram.Mb(16));
+    cacheService.put("1",new SimpleObject("1,","Activator Object"));
+    
context.registerService(CacheService.class.getCanonicalName(),cacheService,new 
Properties());
+  }
+
+  @Override
+  public void stop(BundleContext context) throws Exception {
+  }
+}

Copied: 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceTest.java
 (from r1186497, 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java)
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceTest.java?p2=incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceTest.java&p1=incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java&r1=1186497&r2=1187713&rev=1187713&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java
 (original)
+++ 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheServiceTest.java
 Sat Oct 22 13:14:40 2011
@@ -22,18 +22,12 @@ package org.apache.directmemory.tests.os
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Properties;
-import org.apache.directmemory.cache.Cache;
+import org.apache.directmemory.cache.CacheService;
 import org.apache.directmemory.measures.Every;
-import org.apache.directmemory.measures.Monitor;
-import org.apache.directmemory.measures.Ram;
 import org.apache.directmemory.memory.Pointer;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
+import org.apache.directmemory.tests.osgi.DirectMemoryOsgiTestSupport;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-
 import org.ops4j.pax.exam.Customizer;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
@@ -41,36 +35,36 @@ import org.ops4j.pax.exam.junit.JUnit4Te
 import org.osgi.framework.Constants;
 
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.ops4j.pax.exam.CoreOptions.equinox;
 import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.OptionUtils.combine;
-import static org.ops4j.pax.exam.OptionUtils.expand;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
-import static 
org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.modifyBundle;
+import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
 
 @RunWith(JUnit4TestRunner.class)
-public class CacheTest {
+public class CacheServiceTest extends DirectMemoryOsgiTestSupport{
 
   /**
    * This tests basic cache operations(put,retrieve) inside OSGi
    */
   @Test
-  public void testWithString() {
-    String key = "1";
+  public void testCacheService() {
+    String key = "2";
     String obj = "Simple String Object";
-    Cache.init(1, Ram.Mb(16));
-               Cache.scheduleDisposalEvery(Every.seconds(1));
-               Cache.dump();
-
-    Pointer p = Cache.put("1", obj);
-    Object result = Cache.retrieve("1");
-
-    Cache.dump();
-    Monitor.dump("cache");
+    CacheService cacheService = getOsgiService(CacheService.class);
 
+    //Test retrieving an object added by an other bundle.
+    Object result = cacheService.retrieve("1");
+    assertNotNull(result);
+
+               cacheService.scheduleDisposalEvery(Every.seconds(1));
+               cacheService.dump();
+
+    Pointer p = cacheService.put("2", obj);
+    result = cacheService.retrieve("2");
+    cacheService.dump();
     assertEquals(obj, result);
   }
 
@@ -78,20 +72,20 @@ public class CacheTest {
    * This test basic cache operations(put,retrieve) inside OSGi using an 
object of an imported class (provided by an other bundle).
    */
   @Test
-  public void testWithImportedObject() {
-    SimpleObject obj1 = new SimpleObject("1","Object One");
-    SimpleObject obj2 = new SimpleObject("2","Object Two");
-    Cache.init(1, Ram.Mb(16));
-               Cache.scheduleDisposalEvery(Every.seconds(1));
-               Cache.dump();
-
-    Pointer p1 = Cache.put("1",obj1 );
-    Pointer p2 = Cache.put("2",obj2 );
-    Object result1 = Cache.retrieve("1");
-    Object result2 = Cache.retrieve("2");
+  public void testCacheServiceWithImportedObject() {
+    SimpleObject obj1 = new SimpleObject("2","Object Two");
+    SimpleObject obj2 = new SimpleObject("3","Object Three");
+
+    CacheService cacheService = getOsgiService(CacheService.class);
+               cacheService.scheduleDisposalEvery(Every.seconds(1));
+               cacheService.dump();
+
+    Pointer p1 = cacheService.put("2",obj1 );
+    Pointer p2 = cacheService.put("3",obj2 );
+    Object result1 = cacheService.retrieve("2");
+    Object result2 = cacheService.retrieve("3");
 
-    Cache.dump();
-    Monitor.dump("cache");
+    cacheService.dump();
 
     assertEquals(obj1, result1);
     assertEquals(obj2, result2);
@@ -99,29 +93,29 @@ public class CacheTest {
 
 
   @Configuration
-  public Option[] configure() {
-    return expand(
-            
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.2.8"),
-            
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("1.6.2"),
-            
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-service").version("1.6.2"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.guava").version("09_1"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.ant").version("1.7.0_5"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.oro").version("2.0.8_5"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.josql").version("1.5_5"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.aspectj").version("1.6.8_2"),
-            
mavenBundle().groupId("com.dyuproject.protostuff").artifactId("protostuff-uberjar").version("1.0.2"),
-            
mavenBundle().groupId("org.apache.directmemory").artifactId("directmemory-cache").version("0.5.5-SNAPSHOT"),
+  public Option[] configure() throws IOException {
+    return combine(
+            getDynamicMemoryOptions(),
+
+            bundle(newBundle()
+                    .add(SimpleObject.class)
+                    .add(CacheServiceExportingActivator.class)
+                    .set(Constants.BUNDLE_ACTIVATOR, 
CacheServiceExportingActivator.class.getCanonicalName())
+                    .set(Constants.BUNDLE_SYMBOLICNAME, 
"org.apache.directmemory.tests.osgi.cacheservice.exporter")
+                    .set(Constants.BUNDLE_VERSION, "1.0.0")
+                    .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
+                    .build()).start(),
+
             new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe(InputStream 
testProbe) {
-                        return modifyBundle(testProbe)
-                                .add(SimpleObject.class)
-                                .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                                .build();
-                    }
-                },
+              @Override
+              public InputStream customizeTestProbe(InputStream testProbe) {
+                return modifyBundle(testProbe)
+                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
+                        .build();
+              }
+            },
             //Uncomment the line below to debug test
-            
//vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
+            //enabledDebuggingOnPort(5005,true),
             felix(),
             equinox()
     );

Modified: 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java?rev=1187713&r1=1187712&r2=1187713&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java
 (original)
+++ 
incubator/directmemory/trunk/itests/osgi/src/test/java/org/apache/directmemory/tests/osgi/cache/CacheTest.java
 Sat Oct 22 13:14:40 2011
@@ -20,17 +20,13 @@
 package org.apache.directmemory.tests.osgi.cache;
 
 
-import java.io.IOException;
 import java.io.InputStream;
-import java.util.Properties;
 import org.apache.directmemory.cache.Cache;
 import org.apache.directmemory.measures.Every;
 import org.apache.directmemory.measures.Monitor;
 import org.apache.directmemory.measures.Ram;
 import org.apache.directmemory.memory.Pointer;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
+import org.apache.directmemory.tests.osgi.DirectMemoryOsgiTestSupport;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -46,19 +42,16 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.CoreOptions.felix;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.OptionUtils.combine;
-import static org.ops4j.pax.exam.OptionUtils.expand;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
-import static 
org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.modifyBundle;
 
 @RunWith(JUnit4TestRunner.class)
-public class CacheTest {
+public class CacheTest extends DirectMemoryOsgiTestSupport{
 
   /**
    * This tests basic cache operations(put,retrieve) inside OSGi
    */
   @Test
-  public void testWithString() {
+  public void testCacheSingleton() {
     String key = "1";
     String obj = "Simple String Object";
     Cache.init(1, Ram.Mb(16));
@@ -78,7 +71,7 @@ public class CacheTest {
    * This test basic cache operations(put,retrieve) inside OSGi using an 
object of an imported class (provided by an other bundle).
    */
   @Test
-  public void testWithImportedObject() {
+  public void testCacheSingletonWithImportedObject() {
     SimpleObject obj1 = new SimpleObject("1","Object One");
     SimpleObject obj2 = new SimpleObject("2","Object Two");
     Cache.init(1, Ram.Mb(16));
@@ -100,17 +93,8 @@ public class CacheTest {
 
   @Configuration
   public Option[] configure() {
-    return expand(
-            
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.2.8"),
-            
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("1.6.2"),
-            
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-service").version("1.6.2"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.guava").version("09_1"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.ant").version("1.7.0_5"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.oro").version("2.0.8_5"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.josql").version("1.5_5"),
-            
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.aspectj").version("1.6.8_2"),
-            
mavenBundle().groupId("com.dyuproject.protostuff").artifactId("protostuff-uberjar").version("1.0.2"),
-            
mavenBundle().groupId("org.apache.directmemory").artifactId("directmemory-cache").version("0.5.5-SNAPSHOT"),
+    return combine(
+            getDynamicMemoryOptions(),
             new Customizer() {
                     @Override
                     public InputStream customizeTestProbe(InputStream 
testProbe) {
@@ -121,7 +105,7 @@ public class CacheTest {
                     }
                 },
             //Uncomment the line below to debug test
-            
//vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
+            //enabledDebuggingOnPort(5005,false),
             felix(),
             equinox()
     );

Modified: incubator/directmemory/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/pom.xml?rev=1187713&r1=1187712&r2=1187713&view=diff
==============================================================================
--- incubator/directmemory/trunk/pom.xml (original)
+++ incubator/directmemory/trunk/pom.xml Sat Oct 22 13:14:40 2011
@@ -243,6 +243,7 @@ under the License.
     <junit-benchamrks.version>0.3.0-SNAPSHOT</junit-benchamrks.version>
     <logback.version>0.9.26</logback.version>
     <oro.bundle.version>2.0.8_5</oro.bundle.version>
+    <osgi.version>4.2.0</osgi.version>
     <pax-exam.version>1.2.4</pax-exam.version>
     <pax-tiny-bundle.version>1.3.1</pax-tiny-bundle.version>
     <protostuff.version>1.0.2</protostuff.version>
@@ -536,6 +537,12 @@ under the License.
       </dependency>
 
       <dependency>
+        <groupId>org.osgi</groupId>
+        <artifactId>org.osgi.core</artifactId>
+        <version>${osgi.version}</version>
+      </dependency>
+
+      <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam</artifactId>
         <version>${pax-exam.version}</version>


Reply via email to