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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Jul 17 18:51:37 EDT 2010


Author: aslak
Date: 2010-07-17 18:51:37 -0400 (Sat, 17 Jul 2010)
New Revision: 4756

Removed:
   arquillian/trunk/bundle/pom.xml
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java
   arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java
   arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestRunner
Log:
ARQ-188 Moved Bundle to protocol/jmx-osgi-bundle

Deleted: arquillian/trunk/bundle/pom.xml
===================================================================
--- arquillian/trunk/bundle/pom.xml	2010-07-17 22:51:03 UTC (rev 4755)
+++ arquillian/trunk/bundle/pom.xml	2010-07-17 22:51:37 UTC (rev 4756)
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-  <!-- Parent -->
-  <parent>
-    <groupId>org.jboss.arquillian</groupId>
-    <artifactId>arquillian-build</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <relativePath>../build/pom.xml</relativePath>
-  </parent>
-
-  <!-- Model Version -->
-  <modelVersion>4.0.0</modelVersion>
-
-  <!-- Artifact Configuration -->
-  <artifactId>arquillian-bundle</artifactId>
-  <name>Arquillian OSGi Bundle</name>
-  <description>Arquillian OSGi Bundle</description>
-  <packaging>bundle</packaging>
-
-  <!-- Properties -->
-  <properties>
-    <!-- Versioning -->
-  </properties>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-            <Bundle-Activator>org.jboss.arquillian.osgi.ArquillianBundleActivator</Bundle-Activator>
-            <Export-Package></Export-Package>
-            <Import-Package>
-              javax.management*,
-              javax.naming,
-              javax.xml.parsers,
-              org.w3c.dom,
-
-              org.jboss.logging;version="[2.1,3.0)",
-
-              org.osgi.framework;version="[1.5,2.0)",
-              org.osgi.util.tracker;version="[1.4,2.0)",
-            </Import-Package>
-            <Private-Package>
-              org.jboss.arquillian.osgi,
-            </Private-Package>
-            <DynamicImport-Package>*</DynamicImport-Package>
-            <Embed-Transitive>true</Embed-Transitive>
-            <Embed-Dependency>
-              arquillian-api;inline=false,
-              arquillian-impl-base;inline=false,
-              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,
-              javax.inject;inline=false,
-              junit;inline=false,
-            </Embed-Dependency>
-            <_exportcontents>
-              javax.inject;version=${version.javax.inject_javax.inject},
-              org.jboss.arquillian.junit;version=${project.version},
-              org.jboss.shrinkwrap.api;version=${version.shrinkwrap_shrinkwrap},
-              org.jboss.shrinkwrap.api.asset;version=${version.shrinkwrap_shrinkwrap},
-              org.jboss.shrinkwrap.api.container;version=${version.shrinkwrap_shrinkwrap},
-              org.jboss.shrinkwrap.api.exporter;version=${version.shrinkwrap_shrinkwrap},
-              org.jboss.shrinkwrap.api.formatter;version=${version.shrinkwrap_shrinkwrap},
-              org.jboss.shrinkwrap.api.importer;version=${version.shrinkwrap_shrinkwrap},
-              org.jboss.shrinkwrap.api.serialization;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>
-        </configuration>
-      </plugin>
-    </plugins>
-
-    <!-- PluginManagement -->
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-bundle-plugin</artifactId>
-          <version>2.1.0</version>
-          <extensions>true</extensions>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-
-
-  <!-- Dependencies -->
-  <dependencies>
-    <dependency>
-      <groupId>org.jboss.arquillian.protocol</groupId>
-      <artifactId>arquillian-protocol-jmx</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.arquillian.testenricher</groupId>
-      <artifactId>arquillian-testenricher-osgi</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.arquillian</groupId>
-      <artifactId>arquillian-junit</artifactId>
-      <version>${project.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>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-</project>
-

Deleted: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java	2010-07-17 22:51:03 UTC (rev 4755)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/ArquillianBundleActivator.java	2010-07-17 22:51:37 UTC (rev 4756)
@@ -1,107 +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.osgi;
-
-// $Id$
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.StandardMBean;
-
-import org.jboss.arquillian.protocol.jmx.JMXTestRunner;
-import org.jboss.arquillian.protocol.jmx.JMXTestRunner.TestClassLoader;
-import org.jboss.arquillian.testenricher.osgi.BundleContextHolder;
-import org.jboss.arquillian.testenricher.osgi.OSGiTestEnricher;
-import org.jboss.logging.Logger;
-import org.osgi.framework.Bundle;
-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);
-
-   private  JMXTestRunner testRunner;
-   
-   public void start(final BundleContext context) throws Exception
-   {
-      TestClassLoader loader = new TestClassLoader()
-      {
-         public Class<?> loadTestClass(String className) throws ClassNotFoundException
-         {
-            Bundle bundle = context.getBundle();
-            return bundle.loadClass(className);
-         }
-      };
-      
-      // Register the JMXTestRunner
-      MBeanServer mbeanServer = getMBeanServer(context);
-      testRunner = new JMXTestRunner(loader);
-      testRunner.registerMBean(mbeanServer);
-
-      // Register the BundleContextHolder
-      BundleContextHolder holder = new BundleContextHolder()
-      {
-         public BundleContext getBundleContext()
-         {
-            return context;
-         }
-      };
-      StandardMBean holderMBean = new StandardMBean(holder, BundleContextHolder.class);
-      mbeanServer.registerMBean(holderMBean, new ObjectName(BundleContextHolder.OBJECT_NAME));
-   }
-
-   public void stop(BundleContext context) throws Exception
-   {
-      // Unregister the JMXTestRunner
-      MBeanServer mbeanServer = getMBeanServer(context);
-      testRunner.unregisterMBean(mbeanServer);
-
-      // Unregister the BundleContextHolder
-      mbeanServer.unregisterMBean(new ObjectName(BundleContextHolder.OBJECT_NAME));
-   }
-
-   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 OSGiTestEnricher.findOrCreateMBeanServer();
-   }
-}
\ No newline at end of file

Deleted: arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java
===================================================================
--- arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java	2010-07-17 22:51:03 UTC (rev 4755)
+++ arquillian/trunk/bundle/src/main/java/org/jboss/arquillian/osgi/JUnitBundleTestRunner.java	2010-07-17 22:51:37 UTC (rev 4756)
@@ -1,45 +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.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);
-      }
-   }
-}

Deleted: 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-07-17 22:51:03 UTC (rev 4755)
+++ arquillian/trunk/bundle/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestRunner	2010-07-17 22:51:37 UTC (rev 4756)
@@ -1 +0,0 @@
-org.jboss.arquillian.osgi.JUnitBundleTestRunner



More information about the jboss-svn-commits mailing list