[jboss-svn-commits] JBoss Common SVN: r4550 - in arquillian/trunk: bundle/src/main/java/org/jboss/arquillian and 8 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jun 24 04:55:50 EDT 2010


Author: thomas.diesler at jboss.com
Date: 2010-06-24 04:55:49 -0400 (Thu, 24 Jun 2010)
New Revision: 4550

Added:
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/BundleContextHolder.java
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/OSGiTestEnricher.java
   arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
Removed:
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/ArquillianActivator.java
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/JUnitBundleTestRunner.java
   arquillian/trunk/containers/osgi-embedded/hs_err_pid11887.log
   arquillian/trunk/containers/osgi-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
Modified:
   arquillian/trunk/bundle/pom.xml
   arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestRunner
   arquillian/trunk/containers/osgi-embedded/pom.xml
   arquillian/trunk/containers/osgi-embedded/src/test/java/org/jboss/arquillian/osgi/OSGiEmbeddedFrameworkTestCase.java
   arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/JUnitTestRunner.java
   arquillian/trunk/testenrichers/pom.xml
Log:
osgi: test bundle runner uses Arquillian

Modified: arquillian/trunk/bundle/pom.xml
===================================================================
--- arquillian/trunk/bundle/pom.xml	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/bundle/pom.xml	2010-06-24 08:55:49 UTC (rev 4550)
@@ -31,7 +31,7 @@
         <configuration>
           <instructions>
             <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
-            <Bundle-Activator>org.jboss.arquillian.bundle.ArquillianActivator</Bundle-Activator>
+            <Bundle-Activator>org.jboss.arquillian.osgi.ArquillianBundleActivator</Bundle-Activator>
             <Export-Package></Export-Package>
             <Import-Package>
               javax.management*,
@@ -45,7 +45,7 @@
               org.osgi.util.tracker;version="[1.4,2.0)",
             </Import-Package>
             <Private-Package>
-              org.jboss.arquillian.bundle,
+              org.jboss.arquillian.osgi,
             </Private-Package>
             <DynamicImport-Package>*</DynamicImport-Package>
             <Embed-Transitive>true</Embed-Transitive>
@@ -55,7 +55,6 @@
               arquillian-junit;inline=false,
               arquillian-protocol-jmx;inline=false,
               arquillian-spi;inline=false,
-              arquillian-testenricher-osgi;inline=false,
               shrinkwrap-api;inline=false,
               shrinkwrap-impl-base;inline=false,
               shrinkwrap-spi;inline=false,
@@ -64,8 +63,10 @@
             </Embed-Dependency>
             <_exportcontents>
               javax.inject;version=${version.javax.inject_javax.inject},
+              org.jboss.arquillian.junit;version=${version},
               org.jboss.shrinkwrap.api;version=${version.shrinkwrap_shrinkwrap},
               org.jboss.shrinkwrap.api.spec;version=${version.shrinkwrap_shrinkwrap},
+              org.junit.runner;version=${version.junit_junit},
               org.junit;version=${version.junit_junit},
             </_exportcontents>
           </instructions>
@@ -90,11 +91,6 @@
   <!-- Dependencies -->
   <dependencies>
     <dependency>
-      <groupId>org.jboss.arquillian.testenricher</groupId>
-      <artifactId>arquillian-testenricher-osgi</artifactId>
-      <version>${version}</version>
-    </dependency>
-    <dependency>
       <groupId>org.jboss.arquillian.protocol</groupId>
       <artifactId>arquillian-protocol-jmx</artifactId>
       <version>${version}</version>
@@ -105,6 +101,10 @@
       <version>${version}</version>
     </dependency>
     <dependency>
+     <groupId>javax.inject</groupId>
+     <artifactId>javax.inject</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.jboss.logging</groupId>
       <artifactId>jboss-logging-spi</artifactId>
     </dependency>

Deleted: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/ArquillianActivator.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/ArquillianActivator.java	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/ArquillianActivator.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -1,108 +0,0 @@
-/*
- * 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.arquillian.bundle;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.arquillian.protocol.jmx.JMXTestRunner;
-import org.jboss.logging.Logger;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- * This is the Arquillian {@link BundleActivator}.
- * 
- * It unconditionally starts the {@link JMXTestRunner}.
- * 
- * @author thomas.diesler at jboss.com
- * @since 17-May-2009
- */
-public class ArquillianActivator implements BundleActivator
-{
-   // Provide logging
-   private static Logger log = Logger.getLogger(ArquillianActivator.class);
-
-   // An thread local association 
-   static BundleContext bundleContext;
-   
-   @Override
-   public void start(BundleContext context) throws Exception
-   {
-      ArquillianActivator.bundleContext = context;
-      
-      // Register the JMX TestRunner
-      MBeanServer mbeanServer = getMBeanServer(context);
-      JMXTestRunner.register(mbeanServer);
-   }
-
-   @Override
-   public void stop(BundleContext context) throws Exception
-   {
-      // Unregister the JMX TestRunner
-      MBeanServer mbeanServer = getMBeanServer(context);
-      JMXTestRunner.unregister(mbeanServer);
-      
-      ArquillianActivator.bundleContext = null;
-   }
-
-   private MBeanServer getMBeanServer(BundleContext context)
-   {
-      MBeanServer mbeanServer = null;
-      
-      // Check if there is an MBeanServer service already
-      ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
-      if (sref != null)
-      {
-         mbeanServer = (MBeanServer)context.getService(sref);
-         log.debug("Found MBeanServer fom service: " + mbeanServer.getDefaultDomain());
-         return mbeanServer;
-      }
-
-      ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
-      if (serverArr.size() > 1)
-         log.warn("Multiple MBeanServer instances: " + serverArr);
-
-      if (serverArr.size() > 0)
-      {
-         mbeanServer = serverArr.get(0);
-         log.debug("Found MBeanServer: " + mbeanServer.getDefaultDomain());
-      }
-
-      if (mbeanServer == null)
-      {
-         log.debug("No MBeanServer, create one ...");
-         mbeanServer = MBeanServerFactory.createMBeanServer();
-      }
-      
-      // Register the MBeanServer under the system context
-      BundleContext syscontext = context.getBundle(0).getBundleContext();
-      syscontext.registerService(MBeanServer.class.getName(), mbeanServer, null);
-      
-      return mbeanServer;
-   }
-}
\ No newline at end of file

Deleted: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/JUnitBundleTestRunner.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/JUnitBundleTestRunner.java	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/JUnitBundleTestRunner.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.arquillian.bundle;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.arquillian.impl.context.AbstractEventContext;
-import org.jboss.arquillian.junit.JUnitTestRunner;
-import org.jboss.arquillian.spi.Context;
-import org.jboss.arquillian.testenricher.osgi.OSGiTestEnricher;
-import org.junit.runner.Description;
-import org.junit.runner.notification.RunListener;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * JUnitTestRunner
- * 
- * A Implementation of the Arquillian TestRunner SPI for JUnit.
- *
- * @author thomas.diesler at jboss.com
- * @version $Revision: $
- */
-public class JUnitBundleTestRunner extends JUnitTestRunner
-{
-   @Override
-   protected List<RunListener> getRunListeners()
-   {
-      List<RunListener> listeners = new ArrayList<RunListener>(super.getRunListeners());
-      listeners.add(new BundleRunListener());
-      return Collections.unmodifiableList(listeners);
-   }
-   
-   class BundleRunListener extends RunListener
-   {
-      @Override
-      public void testRunStarted(Description descr) throws Exception
-      {
-         Class<?> testClass = descr.getTestClass();
-         
-         // [TODO] This is a hack. Get the context in some other way
-         BundleContext context = ArquillianActivator.bundleContext;
-         if (context == null)
-            throw new IllegalStateException("Cannot obtain arquillian-bundle context");
-         
-         ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
-         PackageAdmin pa = (PackageAdmin)context.getService(sref);
-         Bundle testBundle = pa.getBundle(testClass);
-         
-         TestRunnerContext arquillianContext = new TestRunnerContext();
-         arquillianContext.add(BundleContext.class, context.getBundle(0).getBundleContext());
-         arquillianContext.add(Bundle.class, testBundle);
-
-         OSGiTestEnricher enricher = new OSGiTestEnricher();
-         enricher.enrich(arquillianContext, testClass);
-      }
-   }
-   
-   static class TestRunnerContext extends AbstractEventContext
-   {
-      @Override
-      public Context getParentContext()
-      {
-         return null;
-      }
-   }
-}

Copied: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java (from rev 4549, arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/bundle/ArquillianActivator.java)
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java	                        (rev 0)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -0,0 +1,140 @@
+/*
+ * 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.arquillian.osgi;
+
+// $Id$
+
+import java.util.ArrayList;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.management.StandardMBean;
+
+import org.jboss.arquillian.protocol.jmx.JMXTestRunner;
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * This is the Arquillian {@link BundleActivator}.
+ * 
+ * It unconditionally starts the {@link JMXTestRunner}.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 17-May-2009
+ */
+public class ArquillianBundleActivator implements BundleActivator
+{
+   // Provide logging
+   private static Logger log = Logger.getLogger(ArquillianBundleActivator.class);
+
+   @Override
+   public void start(final BundleContext context) throws Exception
+   {
+      // Register the JMXTestRunner
+      MBeanServer mbeanServer = getMBeanServer(context);
+      JMXTestRunner.register(mbeanServer);
+
+      // Register the BundleContextHolder
+      BundleContextHolder holder = new BundleContextHolder()
+      {
+         @Override
+         public BundleContext getBundleContext()
+         {
+            return context;
+         }
+      };
+      StandardMBean holderMBean = new StandardMBean(holder, BundleContextHolder.class);
+      mbeanServer.registerMBean(holderMBean, new ObjectName(BundleContextHolder.OBJECT_NAME));
+   }
+
+   @Override
+   public void stop(BundleContext context) throws Exception
+   {
+      // Unregister the JMXTestRunner
+      MBeanServer mbeanServer = getMBeanServer(context);
+      JMXTestRunner.unregister(mbeanServer);
+      
+      // Unregister the BundleContextHolder
+      mbeanServer.unregisterMBean(new ObjectName(BundleContextHolder.OBJECT_NAME));
+   }
+
+   static MBeanServer findOrCreateMBeanServer()
+   {
+      MBeanServer mbeanServer = null;
+
+      ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+      if (serverArr.size() > 1)
+         log.warn("Multiple MBeanServer instances: " + serverArr);
+
+      if (serverArr.size() > 0)
+      {
+         mbeanServer = serverArr.get(0);
+         log.debug("Found MBeanServer: " + mbeanServer.getDefaultDomain());
+      }
+
+      if (mbeanServer == null)
+      {
+         log.debug("No MBeanServer, create one ...");
+         mbeanServer = MBeanServerFactory.createMBeanServer();
+      }
+
+      return mbeanServer;
+   }
+   
+   /**
+    * Get the BundleContext associated with the arquillian-bundle
+    */
+   static BundleContext getBundleContext()
+   {
+      try
+      {
+         MBeanServer mbeanServer = findOrCreateMBeanServer();
+         ObjectName oname = new ObjectName(BundleContextHolder.OBJECT_NAME);
+         BundleContextHolder holder = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, oname, BundleContextHolder.class, false);
+         return holder.getBundleContext();
+      }
+      catch (JMException ex)
+      {
+         throw new IllegalStateException("Cannot obtain arquillian-bundle context", ex);
+      }
+   }
+   
+   private MBeanServer getMBeanServer(BundleContext context)
+   {
+      // Check if the MBeanServer is registered as an OSGi service 
+      ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+      if (sref != null)
+      {
+         MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+         log.debug("Found MBeanServer fom service: " + mbeanServer.getDefaultDomain());
+         return mbeanServer;
+      }
+      
+      // Find or create the MBeanServer
+      return findOrCreateMBeanServer();
+   }
+}
\ No newline at end of file

Added: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/BundleContextHolder.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/BundleContextHolder.java	                        (rev 0)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/BundleContextHolder.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.arquillian.osgi;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * BundleContextHolder
+ * 
+ * @author thomas.diesler at jboss.com
+ * @version $Revision: $
+ */
+public interface BundleContextHolder
+{
+   /** The ObjectName for this service: jboss.arquillian:service=bundle-context */
+   String OBJECT_NAME = "jboss.arquillian:service=bundle-context";
+   
+   BundleContext getBundleContext();
+}

Added: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java	                        (rev 0)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.arquillian.osgi;
+
+import org.jboss.arquillian.junit.JUnitTestRunner;
+import org.jboss.arquillian.spi.TestResult;
+
+/**
+ * A JUnitTestRunner for OSGi
+ *
+ * @author thomas.diesler at jboss.com
+ * @version $Revision: $
+ */
+public class JUnitBundleTestRunner extends JUnitTestRunner
+{
+   @Override
+   public TestResult execute(Class<?> testClass, String methodName)
+   {
+      ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         // Make sure we run in the context of the arquillian-bundle class loader
+         Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+         return super.execute(testClass, methodName);
+      }
+      finally
+      {
+         Thread.currentThread().setContextClassLoader(ctxLoader);
+      }
+   }
+}

Added: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/OSGiTestEnricher.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/OSGiTestEnricher.java	                        (rev 0)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/OSGiTestEnricher.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.arquillian.osgi;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.TestEnricher;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * The OSGi TestEnricher
+ * 
+ * The enricher supports the injection of the Framework and the Bundle under test.
+ * 
+ * <pre><code>
+ *    @Inject
+ *    BundleContext sysctx;
+ * 
+ *    @Inject
+ *    Bundle bundle;
+ * </code></pre>
+ * 
+ * @author thomas.diesler at jboss.com
+ * @version $Revision: $
+ */
+public class OSGiTestEnricher implements TestEnricher
+{
+   @Override
+   public void enrich(Context context, Object testCase)
+   {
+      Class<? extends Object> testClass = testCase.getClass();
+      for (Field field : testClass.getDeclaredFields())
+      {
+         if (field.isAnnotationPresent(Inject.class))
+         {
+            if (field.getType().isAssignableFrom(BundleContext.class))
+            {
+               injectBundleContext(context, testCase, field);
+            }
+            if (field.getType().isAssignableFrom(Bundle.class))
+            {
+               injectBundle(context, testCase, field);
+            }
+         }
+      }
+   }
+
+   @Override
+   public Object[] resolve(Context context, Method method)
+   {
+      return null;
+   }
+   
+   private void injectBundleContext(Context context, Object testCase, Field field) 
+   {
+      try
+      {
+         field.set(testCase, getBundleContext(context));
+      }
+      catch (IllegalAccessException ex)
+      {
+         throw new IllegalStateException("Cannot inject BundleContext", ex);
+      }
+   }
+
+   private void injectBundle(Context context, Object testCase, Field field) 
+   {
+      try
+      {
+         field.set(testCase, getTestBundle(context, testCase.getClass()));
+      }
+      catch (IllegalAccessException ex)
+      {
+         throw new IllegalStateException("Cannot inject Bundle", ex);
+      }
+   }
+
+   private BundleContext getBundleContext(Context context)
+   {
+      BundleContext bundleContext = context.get(BundleContext.class);
+      if (bundleContext == null)
+      {
+         bundleContext = ArquillianBundleActivator.getBundleContext();
+         bundleContext = bundleContext.getBundle(0).getBundleContext();
+      }
+      return bundleContext;
+   }
+
+   private Bundle getTestBundle(Context context, Class<?> testClass)
+   {
+      Bundle testbundle = context.get(Bundle.class);
+      if (testbundle == null)
+      {
+         BundleContext bundleContext = getBundleContext(context);
+         ServiceReference sref = bundleContext.getServiceReference(PackageAdmin.class.getName());
+         PackageAdmin pa = (PackageAdmin)bundleContext.getService(sref);
+         testbundle = pa.getBundle(testClass);
+      }
+      return testbundle;
+   }
+}

Added: arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher	                        (rev 0)
+++ arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher	2010-06-24 08:55:49 UTC (rev 4550)
@@ -0,0 +1 @@
+org.jboss.arquillian.osgi.OSGiTestEnricher
\ No newline at end of file

Modified: arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestRunner
===================================================================
--- arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestRunner	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestRunner	2010-06-24 08:55:49 UTC (rev 4550)
@@ -1 +1 @@
-org.jboss.arquillian.bundle.JUnitBundleTestRunner
\ No newline at end of file
+org.jboss.arquillian.osgi.JUnitBundleTestRunner

Deleted: arquillian/trunk/containers/osgi-embedded/hs_err_pid11887.log
===================================================================
--- arquillian/trunk/containers/osgi-embedded/hs_err_pid11887.log	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/containers/osgi-embedded/hs_err_pid11887.log	2010-06-24 08:55:49 UTC (rev 4550)
@@ -1,365 +0,0 @@
-#
-# A fatal error has been detected by the Java Runtime Environment:
-#
-#  SIGSEGV (0xb) at pc=0x00007f69da029182, pid=11887, tid=140092578993936
-#
-# JRE version: 6.0_20-b02
-# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.3-b01 mixed mode linux-amd64 )
-# Problematic frame:
-# V  [libjvm.so+0x2dd182]
-#
-# If you would like to submit a bug report, please visit:
-#   http://java.sun.com/webapps/bugreport/crash.jsp
-#
-
----------------  T H R E A D  ---------------
-
-Current thread (0x00007f69d4062800):  VMThread [stack: 0x00007f69d8581000,0x00007f69d8682000] [id=11900]
-
-siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x000000000019000c
-
-Registers:
-RAX=0x0000000000000008, RBX=0x000000000019000c, RCX=0x0000000000000001, RDX=0x0000000000000000
-RSP=0x00007f69d86806f0, RBP=0x00007f69d8680730, RSI=0x0000000000000026, RDI=0x0000000000000020
-R8 =0x0000000000000001, R9 =0x0000000000000001, R10=0x00007f69da65db70, R11=0x0000000000000003
-R12=0x00007f698dce7390, R13=0x00007f698dce7360, R14=0x0000000000000020, R15=0x00007f698dce7228
-RIP=0x00007f69da029182, EFL=0x0000000000010206, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
-  TRAPNO=0x000000000000000e
-
-Top of Stack: (sp=0x00007f69d86806f0)
-0x00007f69d86806f0:   00007f69d86806ff 08007f698dce74d8
-0x00007f69d8680700:   0000000000000003 00007f698dc64108
-0x00007f69d8680710:   0000000000000000 00007f69d8680760
-0x00007f69d8680720:   0000000000000000 00007f69d4015360
-0x00007f69d8680730:   00007f69d8680750 00007f69da2c8913
-0x00007f69d8680740:   0000000000000000 00007f69da7910e0
-0x00007f69d8680750:   00007f69d86807c0 00007f69da364836
-0x00007f69d8680760:   00007f69d4010100 0000000000000000
-0x00007f69d8680770:   00007f69d4061fa0 00007f69d4023600
-0x00007f69d8680780:   00007f69d86807a0 00007f69d40008c0
-0x00007f69d8680790:   00007f69d40606f0 00007f69d40607a0
-0x00007f69d86807a0:   00007f69d86807c0 0000000000143000
-0x00007f69d86807b0:   00007f69da66d268 00007f69da66f510
-0x00007f69d86807c0:   00007f69d86809f0 00007f69da3637f9
-0x00007f69d86807d0:   000000000c7d5680 00000000020307b8
-0x00007f69d86807e0:   00007f69d86809a0 00007f69d86808b0
-0x00007f69d86807f0:   00007f69d86808f0 00007f69d8680920
-0x00007f69d8680800:   00007f69d8680980 000000000e805e38
-0x00007f69d8680810:   00007f69d86809b0 00007f69d4016ae0
-0x00007f69d8680820:   0000000000654018 0000000002abc7b8
-0x00007f69d8680830:   0000000000989920 00000000031107d0
-0x00007f69d8680840:   00007f69d86808e0 00007f69d8680920
-0x00007f69d8680850:   00007f69d8680950 00007f69d86809b0
-0x00007f69d8680860:   00007f69d40170c0 00007f69d40151c0
-0x00007f69d8680870:   00007f69d4015130 00007f69d4016ae0
-0x00007f69d8680880:   00000012d4061050 00007f69d4014e10
-0x00007f69d8680890:   00007f69da677040 00007f6900000004
-0x00007f69d86808a0:   00007f69d40609c0 00007f6900000004
-0x00007f69d86808b0:   000000000000a5b9 0000000000a34c61
-0x00007f69d86808c0:   00007f69d1119b00 00007f69d40604a0
-0x00007f69d86808d0:   0000000000000000 00007f69d4060420
-0x00007f69d86808e0:   0000000000000000 0000000000a3f229 
-
-Instructions: (pc=0x00007f69da029182)
-0x00007f69da029172:   00 00 00 84 c9 74 7a 49 8b 5d 00 48 85 db 74 71
-0x00007f69da029182:   4c 8b 1b 41 83 e3 03 49 83 fb 03 74 64 4c 8b 23 
-
-Stack: [0x00007f69d8581000,0x00007f69d8682000],  sp=0x00007f69d86806f0,  free space=3fd0000000000000018k
-Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
-V  [libjvm.so+0x2dd182]
-V  [libjvm.so+0x57c913]
-V  [libjvm.so+0x618836]
-V  [libjvm.so+0x6177f9]
-V  [libjvm.so+0x6242d7]
-V  [libjvm.so+0x5ece5e]
-V  [libjvm.so+0x7109c9]
-V  [libjvm.so+0x71d60a]
-V  [libjvm.so+0x71cb92]
-V  [libjvm.so+0x71ce14]
-V  [libjvm.so+0x71c90e]
-V  [libjvm.so+0x5db02f]
-
-VM_Operation (0x00007f69d9d48880): ParallelGCFailedAllocation, mode: safepoint, requested by thread 0x00007f69d4007000
-
-
----------------  P R O C E S S  ---------------
-
-Java Threads: ( => current thread )
-  0x00007f69d428b800 JavaThread "pool-1-thread-5" [_thread_blocked, id=11916, stack(0x00007f698d4f9000,0x00007f698d5fa000)]
-  0x00007f69d428b000 JavaThread "pool-1-thread-4" [_thread_blocked, id=11915, stack(0x00007f698d5fa000,0x00007f698d6fb000)]
-  0x00007f694c001800 JavaThread "pool-1-thread-3" [_thread_blocked, id=11914, stack(0x00007f698d6fb000,0x00007f698d7fc000)]
-  0x00007f69d41ab800 JavaThread "pool-1-thread-2" [_thread_blocked, id=11913, stack(0x00007f698d7fc000,0x00007f698d8fd000)]
-  0x00007f69d41e4800 JavaThread "pool-1-thread-1" [_thread_blocked, id=11912, stack(0x00007f698d8fd000,0x00007f698d9fe000)]
-  0x00007f69d408f000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=11906, stack(0x00007f698daff000,0x00007f698dc00000)]
-  0x00007f69d408d000 JavaThread "CompilerThread1" daemon [_thread_blocked, id=11905, stack(0x00007f69d807c000,0x00007f69d817d000)]
-  0x00007f69d408a000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=11904, stack(0x00007f69d817d000,0x00007f69d827e000)]
-  0x00007f69d4088000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=11903, stack(0x00007f69d827e000,0x00007f69d837f000)]
-  0x00007f69d4069000 JavaThread "Finalizer" daemon [_thread_blocked, id=11902, stack(0x00007f69d837f000,0x00007f69d8480000)]
-  0x00007f69d4067000 JavaThread "Reference Handler" daemon [_thread_blocked, id=11901, stack(0x00007f69d8480000,0x00007f69d8581000)]
-  0x00007f69d4007000 JavaThread "main" [_thread_blocked, id=11895, stack(0x00007f69d9c4b000,0x00007f69d9d4c000)]
-
-Other Threads:
-=>0x00007f69d4062800 VMThread [stack: 0x00007f69d8581000,0x00007f69d8682000] [id=11900]
-  0x00007f69d4092000 WatcherThread [stack: 0x00007f698d9fe000,0x00007f698daff000] [id=11907]
-
-VM state:at safepoint (normal execution)
-
-VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
-[0x00007f69d4004a30] Threads_lock - owner thread: 0x00007f69d4062800
-[0x00007f69d4004f30] Heap_lock - owner thread: 0x00007f69d4007000
-
-Heap
- PSYoungGen      total 213888K, used 6480K [0x00007f69bc560000, 0x00007f69d0e80000, 0x00007f69d1000000)
-  eden space 192448K, 0% used [0x00007f69bc560000,0x00007f69bc560000,0x00007f69c8150000)
-  from space 21440K, 30% used [0x00007f69c8150000,0x00007f69c87a4018,0x00007f69c9640000)
-  to   space 20672K, 0% used [0x00007f69cfa50000,0x00007f69cfa50000,0x00007f69d0e80000)
- PSOldGen        total 43840K, used 43761K [0x00007f6993000000, 0x00007f6995ad0000, 0x00007f69bc560000)
-  object space 43840K, 99% used [0x00007f6993000000,0x00007f6995abc7b8,0x00007f6995ad0000)
- PSPermGen       total 21248K, used 9766K [0x00007f698dc00000, 0x00007f698f0c0000, 0x00007f6993000000)
-  object space 21248K, 45% used [0x00007f698dc00000,0x00007f698e589920,0x00007f698f0c0000)
-
-Dynamic libraries:
-40000000-40009000 r-xp 00000000 fd:03 139462                             /usr/java/jdk1.6.0_20/bin/java
-40108000-4010a000 rwxp 00008000 fd:03 139462                             /usr/java/jdk1.6.0_20/bin/java
-40e88000-40ea9000 rwxp 00000000 00:00 0                                  [heap]
-3673e00000-3673e1e000 r-xp 00000000 fd:03 292                            /lib64/ld-2.12.so
-367401e000-367401f000 r-xp 0001e000 fd:03 292                            /lib64/ld-2.12.so
-367401f000-3674020000 rwxp 0001f000 fd:03 292                            /lib64/ld-2.12.so
-3674020000-3674021000 rwxp 00000000 00:00 0 
-3674200000-3674375000 r-xp 00000000 fd:03 5341                           /lib64/libc-2.12.so
-3674375000-3674575000 ---p 00175000 fd:03 5341                           /lib64/libc-2.12.so
-3674575000-3674579000 r-xp 00175000 fd:03 5341                           /lib64/libc-2.12.so
-3674579000-367457a000 rwxp 00179000 fd:03 5341                           /lib64/libc-2.12.so
-367457a000-367457f000 rwxp 00000000 00:00 0 
-3674600000-3674617000 r-xp 00000000 fd:03 7483                           /lib64/libpthread-2.12.so
-3674617000-3674816000 ---p 00017000 fd:03 7483                           /lib64/libpthread-2.12.so
-3674816000-3674817000 r-xp 00016000 fd:03 7483                           /lib64/libpthread-2.12.so
-3674817000-3674818000 rwxp 00017000 fd:03 7483                           /lib64/libpthread-2.12.so
-3674818000-367481c000 rwxp 00000000 00:00 0 
-3674a00000-3674a02000 r-xp 00000000 fd:03 11352                          /lib64/libdl-2.12.so
-3674a02000-3674c02000 ---p 00002000 fd:03 11352                          /lib64/libdl-2.12.so
-3674c02000-3674c03000 r-xp 00002000 fd:03 11352                          /lib64/libdl-2.12.so
-3674c03000-3674c04000 rwxp 00003000 fd:03 11352                          /lib64/libdl-2.12.so
-3674e00000-3674e07000 r-xp 00000000 fd:03 7484                           /lib64/librt-2.12.so
-3674e07000-3675006000 ---p 00007000 fd:03 7484                           /lib64/librt-2.12.so
-3675006000-3675007000 r-xp 00006000 fd:03 7484                           /lib64/librt-2.12.so
-3675007000-3675008000 rwxp 00007000 fd:03 7484                           /lib64/librt-2.12.so
-3675600000-3675683000 r-xp 00000000 fd:03 7792                           /lib64/libm-2.12.so
-3675683000-3675882000 ---p 00083000 fd:03 7792                           /lib64/libm-2.12.so
-3675882000-3675883000 r-xp 00082000 fd:03 7792                           /lib64/libm-2.12.so
-3675883000-3675884000 rwxp 00083000 fd:03 7792                           /lib64/libm-2.12.so
-3683a00000-3683a16000 r-xp 00000000 fd:03 62723                          /lib64/libnsl-2.12.so
-3683a16000-3683c15000 ---p 00016000 fd:03 62723                          /lib64/libnsl-2.12.so
-3683c15000-3683c16000 r-xp 00015000 fd:03 62723                          /lib64/libnsl-2.12.so
-3683c16000-3683c17000 rwxp 00016000 fd:03 62723                          /lib64/libnsl-2.12.so
-3683c17000-3683c19000 rwxp 00000000 00:00 0 
-7f693c000000-7f693c021000 rwxp 00000000 00:00 0 
-7f693c021000-7f6940000000 ---p 00000000 00:00 0 
-7f6944000000-7f6944021000 rwxp 00000000 00:00 0 
-7f6944021000-7f6948000000 ---p 00000000 00:00 0 
-7f6948000000-7f6948021000 rwxp 00000000 00:00 0 
-7f6948021000-7f694c000000 ---p 00000000 00:00 0 
-7f694c000000-7f694c021000 rwxp 00000000 00:00 0 
-7f694c021000-7f6950000000 ---p 00000000 00:00 0 
-7f6950000000-7f6950021000 rwxp 00000000 00:00 0 
-7f6950021000-7f6954000000 ---p 00000000 00:00 0 
-7f6954000000-7f6954021000 rwxp 00000000 00:00 0 
-7f6954021000-7f6958000000 ---p 00000000 00:00 0 
-7f6958000000-7f6958021000 rwxp 00000000 00:00 0 
-7f6958021000-7f695c000000 ---p 00000000 00:00 0 
-7f695c000000-7f695d87f000 rwxp 00000000 00:00 0 
-7f695d87f000-7f6960000000 ---p 00000000 00:00 0 
-7f6960000000-7f6961892000 rwxp 00000000 00:00 0 
-7f6961892000-7f6964000000 ---p 00000000 00:00 0 
-7f6964000000-7f6964021000 rwxp 00000000 00:00 0 
-7f6964021000-7f6968000000 ---p 00000000 00:00 0 
-7f696a16f000-7f6970000000 r-xp 00000000 fd:03 8194                       /usr/lib/locale/locale-archive
-7f6970000000-7f6970021000 rwxp 00000000 00:00 0 
-7f6970021000-7f6974000000 ---p 00000000 00:00 0 
-7f6974000000-7f6974021000 rwxp 00000000 00:00 0 
-7f6974021000-7f6978000000 ---p 00000000 00:00 0 
-7f6978000000-7f6978021000 rwxp 00000000 00:00 0 
-7f6978021000-7f697c000000 ---p 00000000 00:00 0 
-7f697c000000-7f697c021000 rwxp 00000000 00:00 0 
-7f697c021000-7f6980000000 ---p 00000000 00:00 0 
-7f6980000000-7f6980021000 rwxp 00000000 00:00 0 
-7f6980021000-7f6984000000 ---p 00000000 00:00 0 
-7f6984000000-7f6984021000 rwxp 00000000 00:00 0 
-7f6984021000-7f6988000000 ---p 00000000 00:00 0 
-7f6988000000-7f6988021000 rwxp 00000000 00:00 0 
-7f6988021000-7f698c000000 ---p 00000000 00:00 0 
-7f698d4f9000-7f698d4fc000 ---p 00000000 00:00 0 
-7f698d4fc000-7f698d5fa000 rwxp 00000000 00:00 0 
-7f698d5fa000-7f698d5fd000 ---p 00000000 00:00 0 
-7f698d5fd000-7f698d6fb000 rwxp 00000000 00:00 0 
-7f698d6fb000-7f698d6fe000 ---p 00000000 00:00 0 
-7f698d6fe000-7f698d7fc000 rwxp 00000000 00:00 0 
-7f698d7fc000-7f698d7ff000 ---p 00000000 00:00 0 
-7f698d7ff000-7f698d8fd000 rwxp 00000000 00:00 0 
-7f698d8fd000-7f698d900000 ---p 00000000 00:00 0 
-7f698d900000-7f698d9fe000 rwxp 00000000 00:00 0 
-7f698d9fe000-7f698d9ff000 ---p 00000000 00:00 0 
-7f698d9ff000-7f698daff000 rwxp 00000000 00:00 0 
-7f698daff000-7f698db02000 ---p 00000000 00:00 0 
-7f698db02000-7f698f0c0000 rwxp 00000000 00:00 0 
-7f698f0c0000-7f6993000000 rwxp 00000000 00:00 0 
-7f6993000000-7f6995ad0000 rwxp 00000000 00:00 0 
-7f6995ad0000-7f69bc560000 rwxp 00000000 00:00 0 
-7f69bc560000-7f69d0e80000 rwxp 00000000 00:00 0 
-7f69d0e80000-7f69d1000000 rwxp 00000000 00:00 0 
-7f69d1000000-7f69d1270000 rwxp 00000000 00:00 0 
-7f69d1270000-7f69d43d5000 rwxp 00000000 00:00 0 
-7f69d43d5000-7f69d8000000 ---p 00000000 00:00 0 
-7f69d8010000-7f69d8011000 r-xs 00004000 fd:05 115476444                  /home/tdiesler/.m2/repository/org/apache/maven/maven-archiver/2.4/maven-archiver-2.4.jar
-7f69d8011000-7f69d8013000 r-xs 00004000 fd:05 115479313                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-active-collections/1.0-beta-2/plexus-active-collections-1.0-beta-2.jar
-7f69d8013000-7f69d8015000 r-xs 00008000 fd:05 115475719                  /home/tdiesler/.m2/repository/org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar
-7f69d8015000-7f69d8017000 r-xs 00006000 fd:05 115478200                  /home/tdiesler/.m2/repository/org/apache/maven/shared/file-management/1.1/file-management-1.1.jar
-7f69d8017000-7f69d8019000 r-xs 0000a000 fd:05 115479289                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-io/1.0-alpha-4/plexus-io-1.0-alpha-4.jar
-7f69d8019000-7f69d801b000 r-xs 0000b000 fd:05 115479284                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.7/plexus-interpolation-1.7.jar
-7f69d801b000-7f69d801f000 r-xs 00028000 fd:05 115478138                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-12/plexus-archiver-1.0-alpha-12.jar
-7f69d801f000-7f69d8020000 r-xs 00007000 fd:05 115478098                  /home/tdiesler/.m2/repository/org/apache/maven/shared/maven-plugin-testing-harness/1.1/maven-plugin-testing-harness-1.1.jar
-7f69d8020000-7f69d8025000 r-xs 00040000 fd:05 115478084                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.12/plexus-utils-1.5.12.jar
-7f69d8025000-7f69d8027000 r-xs 00006000 fd:05 115478085                  /home/tdiesler/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.1/maven-common-artifact-filters-1.1.jar
-7f69d8027000-7f69d8028000 r-xs 00003000 fd:05 115476258                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.5.3/plexus-compiler-javac-1.5.3.jar
-7f69d8028000-7f69d802a000 r-xs 00000000 fd:05 115476245                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/1.5.3/plexus-compiler-manager-1.5.3.jar
-7f69d802a000-7f69d802b000 r-xs 00004000 fd:05 115476233                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.5.3/plexus-compiler-api-1.5.3.jar
-7f69d802b000-7f69d802d000 r-xs 00026000 fd:05 115476016                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
-7f69d802d000-7f69d802f000 r-xs 0000d000 fd:05 115475930                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
-7f69d802f000-7f69d8031000 r-xs 00007000 fd:05 115475816                  /home/tdiesler/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-3/maven-filtering-1.0-beta-3.jar
-7f69d8031000-7f69d8035000 r-xs 00034000 fd:05 115475811                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
-7f69d8035000-7f69d803a000 r-xs 00040000 fd:05 115476014                  /home/tdiesler/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar
-7f69d803a000-7f69d803c000 r-xs 0000c000 fd:05 115476018                  /home/tdiesler/.m2/repository/org/apache/maven/enforcer/enforcer-rules/1.0-beta-1/enforcer-rules-1.0-beta-1.jar
-7f69d803c000-7f69d803d000 r-xs 00002000 fd:05 115476012                  /home/tdiesler/.m2/repository/org/apache/maven/enforcer/enforcer-api/1.0-beta-1/enforcer-api-1.0-beta-1.jar
-7f69d803d000-7f69d8041000 r-xs 00038000 fd:05 115476013                  /home/tdiesler/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar
-7f69d8041000-7f69d807c000 r-xs 002c7000 fd:03 262163                     /usr/java/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
-7f69d807c000-7f69d807f000 ---p 00000000 00:00 0 
-7f69d807f000-7f69d817d000 rwxp 00000000 00:00 0 
-7f69d817d000-7f69d8180000 ---p 00000000 00:00 0 
-7f69d8180000-7f69d827e000 rwxp 00000000 00:00 0 
-7f69d827e000-7f69d8281000 ---p 00000000 00:00 0 
-7f69d8281000-7f69d837f000 rwxp 00000000 00:00 0 
-7f69d837f000-7f69d8382000 ---p 00000000 00:00 0 
-7f69d8382000-7f69d8480000 rwxp 00000000 00:00 0 
-7f69d8480000-7f69d8483000 ---p 00000000 00:00 0 
-7f69d8483000-7f69d8581000 rwxp 00000000 00:00 0 
-7f69d8581000-7f69d8582000 ---p 00000000 00:00 0 
-7f69d8582000-7f69d8bba000 rwxp 00000000 00:00 0 
-7f69d8bba000-7f69d8d50000 r-xs 02fd0000 fd:03 137808                     /usr/java/jdk1.6.0_20/jre/lib/rt.jar
-7f69d8d50000-7f69d8d78000 rwxp 00000000 00:00 0 
-7f69d8d78000-7f69d8d79000 ---p 00000000 00:00 0 
-7f69d8d79000-7f69d8e79000 rwxp 00000000 00:00 0 
-7f69d8e79000-7f69d8e7a000 ---p 00000000 00:00 0 
-7f69d8e7a000-7f69d8f7a000 rwxp 00000000 00:00 0 
-7f69d8f7a000-7f69d8f7b000 ---p 00000000 00:00 0 
-7f69d8f7b000-7f69d907b000 rwxp 00000000 00:00 0 
-7f69d907b000-7f69d907c000 ---p 00000000 00:00 0 
-7f69d907c000-7f69d9187000 rwxp 00000000 00:00 0 
-7f69d9187000-7f69d91a6000 rwxp 00000000 00:00 0 
-7f69d91a6000-7f69d91bc000 rwxp 00000000 00:00 0 
-7f69d91bc000-7f69d92f1000 rwxp 00000000 00:00 0 
-7f69d92f1000-7f69d92fc000 rwxp 00000000 00:00 0 
-7f69d92fc000-7f69d931b000 rwxp 00000000 00:00 0 
-7f69d931b000-7f69d9331000 rwxp 00000000 00:00 0 
-7f69d9331000-7f69d9465000 rwxp 00000000 00:00 0 
-7f69d9465000-7f69d950b000 rwxp 00000000 00:00 0 
-7f69d950b000-7f69d9516000 rwxp 00000000 00:00 0 
-7f69d9516000-7f69d95cc000 rwxp 00000000 00:00 0 
-7f69d95cc000-7f69d95da000 r-xp 00000000 fd:03 140106                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libzip.so
-7f69d95da000-7f69d96dc000 ---p 0000e000 fd:03 140106                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libzip.so
-7f69d96dc000-7f69d96df000 rwxp 00010000 fd:03 140106                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libzip.so
-7f69d96df000-7f69d96e0000 rwxp 00000000 00:00 0 
-7f69d96e0000-7f69d96ec000 r-xp 00000000 fd:03 5041                       /lib64/libnss_files-2.12.so
-7f69d96ec000-7f69d98eb000 ---p 0000c000 fd:03 5041                       /lib64/libnss_files-2.12.so
-7f69d98eb000-7f69d98ec000 r-xp 0000b000 fd:03 5041                       /lib64/libnss_files-2.12.so
-7f69d98ec000-7f69d98ed000 rwxp 0000c000 fd:03 5041                       /lib64/libnss_files-2.12.so
-7f69d98ed000-7f69d98ee000 r-xs 00001000 fd:05 115475806                  /home/tdiesler/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
-7f69d98ee000-7f69d98f3000 r-xs 0003d000 fd:05 115476015                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar
-7f69d98f3000-7f69d98f7000 r-xs 0002f000 fd:05 115477671                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-4/maven-assembly-plugin-2.2-beta-4.jar
-7f69d98f7000-7f69d98f8000 r-xs 00005000 fd:05 115475533                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-source-plugin/2.1.1/maven-source-plugin-2.1.1.jar
-7f69d98f8000-7f69d98fa000 r-xs 00004000 fd:05 115475463                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-enforcer-plugin/1.0-beta-1/maven-enforcer-plugin-1.0-beta-1.jar
-7f69d98fa000-7f69d98fb000 r-xs 00007000 fd:05 115475513                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-release-plugin/2.0-beta-9/maven-release-plugin-2.0-beta-9.jar
-7f69d98fb000-7f69d98fc000 r-xs 00005000 fd:05 115475739                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-install-plugin/2.3/maven-install-plugin-2.3.jar
-7f69d98fc000-7f69d98fe000 r-xs 00005000 fd:05 115475499                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.jar
-7f69d98fe000-7f69d98ff000 r-xs 00005000 fd:05 115475547                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.jar
-7f69d98ff000-7f69d9902000 r-xs 00020000 fd:05 115476338                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
-7f69d9902000-7f69d9909000 r-xp 00000000 fd:03 140108                     /usr/java/jdk1.6.0_20/jre/lib/amd64/native_threads/libhpi.so
-7f69d9909000-7f69d9a0a000 ---p 00007000 fd:03 140108                     /usr/java/jdk1.6.0_20/jre/lib/amd64/native_threads/libhpi.so
-7f69d9a0a000-7f69d9a0c000 rwxp 00008000 fd:03 140108                     /usr/java/jdk1.6.0_20/jre/lib/amd64/native_threads/libhpi.so
-7f69d9a0c000-7f69d9a0d000 rwxp 00000000 00:00 0 
-7f69d9a0d000-7f69d9a36000 r-xp 00000000 fd:03 140119                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libjava.so
-7f69d9a36000-7f69d9b35000 ---p 00029000 fd:03 140119                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libjava.so
-7f69d9b35000-7f69d9b3c000 rwxp 00028000 fd:03 140119                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libjava.so
-7f69d9b3c000-7f69d9b49000 r-xp 00000000 fd:03 140101                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libverify.so
-7f69d9b49000-7f69d9c48000 ---p 0000d000 fd:03 140101                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libverify.so
-7f69d9c48000-7f69d9c4b000 rwxp 0000c000 fd:03 140101                     /usr/java/jdk1.6.0_20/jre/lib/amd64/libverify.so
-7f69d9c4b000-7f69d9c4e000 ---p 00000000 00:00 0 
-7f69d9c4e000-7f69d9d4c000 rwxp 00000000 00:00 0 
-7f69d9d4c000-7f69da501000 r-xp 00000000 fd:03 140126                     /usr/java/jdk1.6.0_20/jre/lib/amd64/server/libjvm.so
-7f69da501000-7f69da600000 ---p 007b5000 fd:03 140126                     /usr/java/jdk1.6.0_20/jre/lib/amd64/server/libjvm.so
-7f69da600000-7f69da78b000 rwxp 007b4000 fd:03 140126                     /usr/java/jdk1.6.0_20/jre/lib/amd64/server/libjvm.so
-7f69da78b000-7f69da7c7000 rwxp 00000000 00:00 0 
-7f69da7c7000-7f69da7ce000 r-xp 00000000 fd:03 140091                     /usr/java/jdk1.6.0_20/jre/lib/amd64/jli/libjli.so
-7f69da7ce000-7f69da8cf000 ---p 00007000 fd:03 140091                     /usr/java/jdk1.6.0_20/jre/lib/amd64/jli/libjli.so
-7f69da8cf000-7f69da8d1000 rwxp 00008000 fd:03 140091                     /usr/java/jdk1.6.0_20/jre/lib/amd64/jli/libjli.so
-7f69da8d1000-7f69da8d2000 rwxp 00000000 00:00 0 
-7f69da8d2000-7f69da8d3000 r-xs 00004000 fd:05 115475483                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.0.2/maven-compiler-plugin-2.0.2.jar
-7f69da8d3000-7f69da8d4000 r-xs 00005000 fd:05 115476478                  /home/tdiesler/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.4.1/maven-resources-plugin-2.4.1.jar
-7f69da8d4000-7f69da8d5000 r-xs 00002000 fd:05 115477675                  /home/tdiesler/.m2/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
-7f69da8d5000-7f69da8d8000 r-xs 00027000 fd:05 115475167                  /home/tdiesler/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.5/plexus-utils-1.0.5.jar
-7f69da8d8000-7f69da8da000 r-xs 00003000 fd:05 117047583                  /home/tdiesler/.m2/repository/org/codehaus/mojo/jboss-packaging-maven-plugin/2.0-beta-1/jboss-packaging-maven-plugin-2.0-beta-1.jar
-7f69da8da000-7f69da8db000 r-xp 00000000 00:00 0 
-7f69da8db000-7f69da8dd000 r-xs 00008000 fd:03 262150                     /usr/java/apache-maven-2.2.1/boot/classworlds-1.1.jar
-7f69da8dd000-7f69da8e5000 rwxs 00000000 fd:03 404012                     /tmp/hsperfdata_tdiesler/11887
-7f69da8e5000-7f69da8e6000 rwxp 00000000 00:00 0 
-7f69da8e6000-7f69da8e7000 ---p 00000000 00:00 0 
-7f69da8e7000-7f69da8e8000 rwxp 00000000 00:00 0 
-7fffa1bad000-7fffa1bc2000 rwxp 00000000 00:00 0                          [stack]
-7fffa1bff000-7fffa1c00000 r-xp 00000000 00:00 0                          [vdso]
-ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
-
-VM Arguments:
-jvm_args: -Dclassworlds.conf=/usr/java/apache-maven/bin/m2.conf -Dmaven.home=/usr/java/apache-maven 
-java_command: org.codehaus.classworlds.Launcher "install"
-Launcher Type: SUN_STANDARD
-
-Environment Variables:
-JAVA_HOME=/usr/java/jdk1.6
-PATH=/home/tdiesler/bin:/usr/java/jdk1.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
-USERNAME=tdiesler
-LD_LIBRARY_PATH=/usr/java/jdk1.6.0_20/jre/lib/amd64/server:/usr/java/jdk1.6.0_20/jre/lib/amd64:/usr/java/jdk1.6.0_20/jre/../lib/amd64:/usr/java/yjp/bin/linux-x86-64
-SHELL=/bin/bash
-DISPLAY=:0.0
-
-Signal Handlers:
-SIGSEGV: [libjvm.so+0x70ffd0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGBUS: [libjvm.so+0x70ffd0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGFPE: [libjvm.so+0x5d8cf0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGPIPE: [libjvm.so+0x5d8cf0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGXFSZ: [libjvm.so+0x5d8cf0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGILL: [libjvm.so+0x5d8cf0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
-SIGUSR2: [libjvm.so+0x5db510], sa_mask[0]=0x00000000, sa_flags=0x10000004
-SIGHUP: [libjvm.so+0x5db260], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGINT: [libjvm.so+0x5db260], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGTERM: [libjvm.so+0x5db260], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-SIGQUIT: [libjvm.so+0x5db260], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
-
-
----------------  S Y S T E M  ---------------
-
-OS:Fedora release 13 (Goddard)
-
-uname:Linux 2.6.33.5-124.fc13.x86_64 #1 SMP Fri Jun 11 09:38:12 UTC 2010 x86_64
-libc:glibc 2.12 NPTL 2.12 
-rlimit: STACK 10240k, CORE 0k, NPROC 1024, NOFILE 1024, AS infinity
-load average:0.89 0.42 0.21
-
-CPU:total 4 (4 cores per cpu, 1 threads per core) family 16 model 4 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, popcnt, mmxext, 3dnow, 3dnowext, lzcnt, sse4a
-
-Memory: 4k page, physical 4058112k(691548k free), swap 6160376k(6159132k free)
-
-vm_info: Java HotSpot(TM) 64-Bit Server VM (16.3-b01) for linux-amd64 JRE (1.6.0_20-b02), built on Apr 12 2010 13:57:11 by "java_re" with gcc 3.2.2 (SuSE Linux)
-
-time: Wed Jun 23 15:07:01 2010
-elapsed time: 10 seconds
-

Modified: arquillian/trunk/containers/osgi-embedded/pom.xml
===================================================================
--- arquillian/trunk/containers/osgi-embedded/pom.xml	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/containers/osgi-embedded/pom.xml	2010-06-24 08:55:49 UTC (rev 4550)
@@ -108,12 +108,6 @@
 
     <!-- Test dependencies -->
     <dependency>
-      <groupId>org.jboss.arquillian.testenricher</groupId>
-      <artifactId>arquillian-testenricher-osgi</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.jboss.arquillian</groupId>
       <artifactId>arquillian-junit</artifactId>
       <version>${project.version}</version>

Deleted: arquillian/trunk/containers/osgi-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/containers/osgi-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/containers/osgi-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher	2010-06-24 08:55:49 UTC (rev 4550)
@@ -1 +0,0 @@
-org.jboss.arquillian.testenricher.osgi.OSGiTestEnricher
\ No newline at end of file

Modified: arquillian/trunk/containers/osgi-embedded/src/test/java/org/jboss/arquillian/osgi/OSGiEmbeddedFrameworkTestCase.java
===================================================================
--- arquillian/trunk/containers/osgi-embedded/src/test/java/org/jboss/arquillian/osgi/OSGiEmbeddedFrameworkTestCase.java	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/containers/osgi-embedded/src/test/java/org/jboss/arquillian/osgi/OSGiEmbeddedFrameworkTestCase.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -64,7 +64,8 @@
             builder.addBundleActivator(SimpleActivator.class.getName());
             // [TODO] generate a separate bundle the contains the test case
             builder.addExportPackages(OSGiEmbeddedFrameworkTestCase.class);
-            builder.addImportPackages("org.jboss.shrinkwrap.api", "org.jboss.shrinkwrap.api.spec", "javax.inject", "org.junit");
+            builder.addImportPackages("org.jboss.arquillian.junit", "org.jboss.shrinkwrap.api", "org.jboss.shrinkwrap.api.spec");
+            builder.addImportPackages("javax.inject", "org.junit", "org.junit.runner");
             return builder.openStream();
          }
       });
@@ -74,7 +75,7 @@
    }
 
    @Inject
-   public static BundleContext context;
+   public BundleContext context;
    
    @Test
    public void testBundleContextInjection() throws Exception
@@ -84,7 +85,7 @@
    }
 
    @Inject
-   public static Bundle bundle;
+   public Bundle bundle;
    
    @Test
    public void testBundleInjection() throws Exception

Modified: arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/JUnitTestRunner.java
===================================================================
--- arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/JUnitTestRunner.java	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/JUnitTestRunner.java	2010-06-24 08:55:49 UTC (rev 4550)
@@ -50,9 +50,14 @@
       return Collections.emptyList();
    }
 
+   protected ContainerProfile getProfile()
+   {
+      return ContainerProfile.CONTAINER;
+   }
+
    public TestResult execute(Class<?> testClass, String methodName)
    {
-      DeployableTestBuilder.setProfile(ContainerProfile.CONTAINER);
+      DeployableTestBuilder.setProfile(getProfile());
       JUnitCore runner = new JUnitCore();
 
       ExpectedExceptionHolder exceptionHolder = new ExpectedExceptionHolder();

Modified: arquillian/trunk/testenrichers/pom.xml
===================================================================
--- arquillian/trunk/testenrichers/pom.xml	2010-06-24 08:54:00 UTC (rev 4549)
+++ arquillian/trunk/testenrichers/pom.xml	2010-06-24 08:55:49 UTC (rev 4550)
@@ -28,7 +28,6 @@
     
     <module>cdi</module>
     <module>ejb</module>
-    <module>osgi</module>
     <module>resource</module>
 
   </modules>



More information about the jboss-svn-commits mailing list