[jboss-cvs] JBossAS SVN: r99782 - in projects: jboss-osgi/projects/runtime/framework/trunk/scripts and 9 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 21 16:35:15 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-01-21 16:35:15 -0500 (Thu, 21 Jan 2010)
New Revision: 99782

Added:
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeActivatorA.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeClassLoader.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86-64/
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86-64/libNative.so
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86/
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86/libNative.so
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/simple-nativecode.bnd
Modified:
   projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java
   projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/NativeLibraryProvider.java
   projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
Log:
[JBCL-136] Add a notion of native library mapping
Remove public getters
Add getLibraryName() to NativeLibraryProvider 
Use the libname as key to the map
Add simple nativecode test case

Modified: projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java
===================================================================
--- projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java	2010-01-21 21:34:36 UTC (rev 99781)
+++ projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/ClassLoaderPolicy.java	2010-01-21 21:35:15 UTC (rev 99782)
@@ -50,6 +50,7 @@
  * ClassLoader policy.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author thomas.diesler at jboss.com
  * @version $Revision: 1.1 $
  */
 public abstract class ClassLoaderPolicy extends BaseClassLoaderPolicy implements ClassNotFoundHandler, ClassFoundHandler
@@ -70,58 +71,19 @@
    private volatile Map<String, NativeLibraryProvider> libraryMap;
    
    /**
-    * Get the set of registered native library names.
-    * 
-    * @return Null if there are no native libraries registered.
-    */
-   public Set<String> getNativeLibraryNames()
-   {
-      Map<String, NativeLibraryProvider> map = libraryMap;
-
-      if (map == null)
-         return Collections.emptySet();
-      
-      return Collections.unmodifiableSet(libraryMap.keySet()); 
-   }
-   
-   /**
-    * Get the native library provider for the given name.
-    * 
-    * @param libname The library name 
-    * @return Null if there is no library with that name.
-    */
-   public NativeLibraryProvider getNativeLibrary(String libname)
-   {
-      Map<String, NativeLibraryProvider> map = libraryMap;
-      
-      return (map != null ? map.get(libname) : null);
-   }
-   
-   /**
     * Add a native library provider.
     * @param libname The library name 
     * @param provider The library file provider
     */
-   public void addNativeLibrary(String libname, NativeLibraryProvider provider)
+   public void addNativeLibrary(NativeLibraryProvider provider)
    {
       if (libraryMap == null)
          libraryMap = new ConcurrentHashMap<String, NativeLibraryProvider>();
       
-      libraryMap.put(libname, provider);
+      libraryMap.put(provider.getLibraryName(), provider);
    }
    
    /**
-    * Remove the native library provider for the given name.
-    * 
-    * @param libname The library name 
-    * @return Null if there is no library with that name.
-    */
-   public NativeLibraryProvider removeNativeLibrary(String libname)
-   {
-      return (libraryMap != null ? libraryMap.remove(libname) : null);
-   }
-   
-   /**
     * Returns the absolute path name of a native library.
     * 
     * @param libname The library name 
@@ -134,12 +96,7 @@
          return null;
       
       NativeLibraryProvider libProvider = map.get(libname);
-      
-      // [TODO] why does the TCK use 'Native' to mean 'libNative' ? 
       if (libProvider == null)
-         libProvider = map.get("lib" + libname);
-         
-      if (libProvider == null)
          return null;
       
       File libfile;
@@ -496,6 +453,44 @@
    }
 
    /**
+    * Get the set of registered native library names.
+    * 
+    * @return Null if there are no native libraries registered.
+    */
+   Set<String> getNativeLibraryNames()
+   {
+      Map<String, NativeLibraryProvider> map = libraryMap;
+      if (map == null)
+         return Collections.emptySet();
+      
+      return Collections.unmodifiableSet(map.keySet()); 
+   }
+   
+   /**
+    * Get the native library provider for the given name.
+    * 
+    * @param libname The library name 
+    * @return Null if there is no library with that name.
+    */
+   NativeLibraryProvider getNativeLibrary(String libname)
+   {
+      Map<String, NativeLibraryProvider> map = libraryMap;
+      return (map != null ? map.get(libname) : null);
+   }
+   
+   /**
+    * Remove the native library provider for the given name.
+    * 
+    * @param libname The library name 
+    * @return Null if there is no library with that name.
+    */
+   NativeLibraryProvider removeNativeLibrary(String libname)
+   {
+      Map<String, NativeLibraryProvider> map = libraryMap;
+      return (map != null ? map.remove(libname) : null);
+   }
+   
+   /**
     * Get the system classloader
     * 
     * @return the classloader

Modified: projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/NativeLibraryProvider.java
===================================================================
--- projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/NativeLibraryProvider.java	2010-01-21 21:34:36 UTC (rev 99781)
+++ projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/NativeLibraryProvider.java	2010-01-21 21:35:15 UTC (rev 99782)
@@ -25,7 +25,7 @@
 import java.io.IOException;
 
 /**
- * NativeLibraryProvider.
+ * Provides the local file location for a native library.
  * 
  * @author thomas.diesler at jboss.com
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
@@ -34,16 +34,29 @@
 public interface NativeLibraryProvider
 {
    /**
-    * Get the library path
+    * Get the library name.
     * 
+    * As it is used in the call to {@link System#loadLibrary(String)} 
+    * 
     * @return the library path
     */
+   String getLibraryName();
+   
+   /**
+    * Get the library path.
+    * 
+    * Relative to the deployment root.
+    * 
+    * @return the library path
+    */
    String getLibraryPath();
    
    /**
-    * Get the local library file location. This may be proved lazily.
+    * Get the local library file location. 
     * 
-    * @return the file
+    * This may be proved lazily.
+    * 
+    * @return The native library file
     * @throws IOException for any error
     */
    File getLibraryLocation() throws IOException;

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml	2010-01-21 21:34:36 UTC (rev 99781)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/scripts/antrun-test-jars.xml	2010-01-21 21:35:15 UTC (rev 99782)
@@ -62,6 +62,9 @@
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-fragB.jar" files="${tests.resources.dir}/fragments/simple-fragB.bnd" />
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-fragC.jar" files="${tests.resources.dir}/fragments/simple-fragC.bnd" />
 
+    <!-- nativecode -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-nativecode.jar" files="${tests.resources.dir}/nativecode/simple-nativecode.bnd" />
+    
     <!-- simple -->
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-bundle.jar" files="${tests.resources.dir}/integration/simple/simple.bnd" />
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-logservice-bundle.jar" files="${tests.resources.dir}/integration/simple/simple-logservice.bnd" />

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java	2010-01-21 21:34:36 UTC (rev 99781)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java	2010-01-21 21:35:15 UTC (rev 99782)
@@ -27,6 +27,8 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 import org.jboss.classloader.spi.ClassLoaderPolicy;
 import org.jboss.classloader.spi.NativeLibraryProvider;
@@ -73,52 +75,87 @@
       NativeLibraryMetaData libMetaData = classLoadingMetaData.getNativeLibraries();
       if (libMetaData == null || libMetaData.getNativeLibraries() == null)
          return;
-         
-      final OSGiBundleState bundleState = (OSGiBundleState)absBundleState;
-      final OSGiBundleManager bundleManager = bundleState.getBundleManager();
 
       // Add the native library mappings to the OSGiClassLoaderPolicy
-      ClassLoaderPolicy policy = unit.getAttachment(ClassLoaderPolicy.class);
+      OSGiBundleState bundleState = (OSGiBundleState)absBundleState;
+      ClassLoaderPolicy policy = (ClassLoaderPolicy)unit.getAttachment(ClassLoaderPolicy.class);
       for (NativeLibrary library : libMetaData.getNativeLibraries())
       {
-         final String libpath = library.getLibraryPath();
+         String libpath = library.getLibraryPath();
+         String libfile = new File(libpath).getName();
+         String libname = libfile.substring(0, libfile.lastIndexOf('.'));
+         
+         // Add the library provider to the policy
+         NativeLibraryProvider libProvider = new OSGiNativeLibraryProvider(bundleState, libname, libpath);
+         policy.addNativeLibrary(libProvider);
+         
+         // [TODO] why does the TCK use 'Native' to mean 'libNative' ? 
+         if (libname.startsWith("lib"))
+         {
+            libname = libname.substring(3);
+            libProvider = new OSGiNativeLibraryProvider(bundleState, libname, libpath);
+            policy.addNativeLibrary(libProvider);
+         }
+      }
+   }
+   
+   static class OSGiNativeLibraryProvider implements NativeLibraryProvider
+   {
+      private OSGiBundleState bundleState;
+      private String libpath;
+      private String libname;
+      private File libraryFile;
+      
+      OSGiNativeLibraryProvider(OSGiBundleState bundleState, String libname, String libpath)
+      {
+         this.bundleState = bundleState;
+         this.libpath = libpath;
+         this.libname = libname;
+         
+         // If a native code library in a selected native code clause cannot be found
+         // within the bundle then the bundle must fail to resolve
+         URL entryURL = bundleState.getEntry(libpath);
+         if (entryURL == null)
+            throw new IllegalStateException("Cannot find native library: " + libpath);
+      }
+      
+      public String getLibraryName()
+      {
+         return libname;
+      }
 
-         NativeLibraryProvider provider = new NativeLibraryProvider()
+      public String getLibraryPath()
+      {
+         return libpath;
+      }
+      
+      public File getLibraryLocation() throws IOException
+      {
+         if (libraryFile == null)
          {
-            private File libraryFile;
+            // Get the virtual file for entry for the library
+            VirtualFile fileSource = bundleState.getRoot().getChild(libpath);
             
-            public String getLibraryPath()
-            {
-               return libpath;
-            }
+            // Create a unique local file location
+            libraryFile = getUniqueLibraryFile(bundleState, libpath);
+            libraryFile.deleteOnExit();
             
-            public File getLibraryLocation() throws IOException
-            {
-               if (libraryFile == null)
-               {
-                  URL entryURL = bundleState.getEntry(libpath);
+            // Copy the native library to the bundle storage area
+            FileOutputStream fos = new FileOutputStream(libraryFile);
+            VFSUtils.copyStream(fileSource.openStream(), fos);
+            fos.close();
+         }
+         return libraryFile;
+      }
 
-                  // If a native code library in a selected native code clause cannot be found
-                  // within the bundle then the bundle must fail to resolve
-                  if (entryURL == null)
-                     throw new IOException("Cannot find native library: " + libpath);
-
-                  // Copy the native library to the bundle storage area
-                  VirtualFile nativeVirtualFile = bundleState.getRoot().getChild(libpath);
-                  BundleStoragePlugin plugin = bundleManager.getPlugin(BundleStoragePlugin.class);
-                  libraryFile = plugin.getDataFile(bundleState, libpath);
-                  FileOutputStream fos = new FileOutputStream(libraryFile);
-                  VFSUtils.copyStream(nativeVirtualFile.openStream(), fos);
-                  fos.close();
-               }
-               return libraryFile;
-            }
-         };
-         
-         // Add the library provider to the policy
-         String libfile = new File(libpath).getName();
-         String libname = libfile.substring(0, libfile.lastIndexOf('.'));
-         policy.addNativeLibrary(libname, provider);
+      private File getUniqueLibraryFile(final OSGiBundleState bundleState, final String libpath)
+      {
+         OSGiBundleManager bundleManager = bundleState.getBundleManager();
+         BundleStoragePlugin plugin = bundleManager.getPlugin(BundleStoragePlugin.class);
+         Date lmdate = new Date(bundleState.getLastModified());
+         String timestamp = new SimpleDateFormat("yyyyMMdd-HHmmss").format(lmdate);
+         String uniquePath = new StringBuffer(libpath).insert(libpath.lastIndexOf("."), timestamp).toString();
+         return plugin.getDataFile(bundleState, uniquePath);
       }
    }
 }

Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java	2010-01-21 21:35:15 UTC (rev 99782)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.nativecode;
+
+//$Id: FragmentTestCase.java 99648 2010-01-20 09:27:43Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.testing.OSGiTest;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * Test NativeCode-Library functionality
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 21-Jan-2010
+ */
+public class NativeCodeTestCase extends OSGiTest
+{
+   private Framework framework;
+   private BundleContext context;
+
+   @Before
+   public void setUp() throws Exception
+   {
+      OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+      framework = bootProvider.getFramework();
+      framework.start();
+      
+      context = framework.getBundleContext();
+   }
+
+   @After
+   public void tearDown() throws Exception
+   {
+      if (framework != null)
+      {
+         framework.stop();
+         framework.waitForStop(5000);
+      }
+   }
+
+   @Test
+   public void testNativeCode() throws Exception
+   {
+      Bundle bundleA = context.installBundle(getTestArchivePath("simple-nativecode.jar"));
+      assertBundleState(Bundle.INSTALLED, bundleA.getState());
+
+      bundleA.start();
+      assertBundleState(Bundle.ACTIVE, bundleA.getState());
+
+      bundleA.uninstall();
+      assertBundleState(Bundle.UNINSTALLED, bundleA.getState());
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeActivatorA.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeActivatorA.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeActivatorA.java	2010-01-21 21:35:15 UTC (rev 99782)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.nativecode.bundleA;
+
+//$Id: HostAActivator.java 99304 2010-01-12 17:29:06Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+public class NativeCodeActivatorA implements BundleActivator
+{
+   public void start(BundleContext context) throws BundleException
+   {
+      Bundle bundle = context.getBundle();
+      try
+      {
+         System.loadLibrary("Native");
+         throw new IllegalStateException("UnsatisfiedLinkError expected");
+      }
+      catch (UnsatisfiedLinkError ex)
+      {
+         String exmsg = ex.getMessage();
+         long bundleid = bundle.getBundleId();
+         String substr = "osgi-store/bundle-" + bundleid + "/linux_x86";
+         if (exmsg.indexOf(substr) < 0)
+            throw new UnsatisfiedLinkError("Cannot find '" + substr + "' in '" + exmsg + "'");
+      }
+   }
+
+   public void stop(BundleContext context)
+   {
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeClassLoader.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/nativecode/bundleA/NativeCodeClassLoader.java	2010-01-21 21:35:15 UTC (rev 99782)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.nativecode.bundleA;
+
+// $Id: $
+
+public class NativeCodeClassLoader extends ClassLoader
+{
+   public NativeCodeClassLoader(ClassLoader parent)
+   {
+      super(parent);
+   }
+
+   @Override
+   public String findLibrary(String libname)
+   {
+      String libPath = super.findLibrary(libname);
+      return libPath;
+   }
+}

Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86/libNative.so
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86/libNative.so	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86/libNative.so	2010-01-21 21:35:15 UTC (rev 99782)
@@ -0,0 +1 @@
+This is not really a native code library. We dont test linking. Instead we test that the file was extracted correctly.
\ No newline at end of file

Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86-64/libNative.so
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86-64/libNative.so	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/libs/linux_x86-64/libNative.so	2010-01-21 21:35:15 UTC (rev 99782)
@@ -0,0 +1 @@
+This is not really a native code library. We dont test linking. Instead we test that the file was extracted correctly.
\ No newline at end of file

Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/simple-nativecode.bnd
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/simple-nativecode.bnd	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/nativecode/simple-nativecode.bnd	2010-01-21 21:35:15 UTC (rev 99782)
@@ -0,0 +1,12 @@
+Bundle-Version: 2.0
+Bundle-Activator: org.jboss.test.osgi.nativecode.bundleA.NativeCodeActivatorA
+Private-Package: org.jboss.test.osgi.nativecode.bundleA
+Bundle-NativeCode: \
+ linux_x86/libNative.so; osname=Linux; processor=x86, \
+ linux_x86-64/libNative.so; osname=Linux; processor=x86-64
+Include-Resource: libs
+
+-removeheaders: Include-Resource
+
+
+




More information about the jboss-cvs-commits mailing list