[jboss-osgi-commits] JBoss-OSGI SVN: r88421 - in projects/jboss-osgi/trunk: bundle/remotelog and 19 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Fri May 8 07:30:06 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-05-08 07:30:04 -0400 (Fri, 08 May 2009)
New Revision: 88421
Added:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/
Removed:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/
Modified:
projects/jboss-osgi/trunk/bundle/blueprint/.classpath
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/SomeInternal.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/FooMBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/jbosgi36/jbosgi36.bnd
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
All fuctional tests migrated and ok in embedded and jbossas
Modified: projects/jboss-osgi/trunk/bundle/blueprint/.classpath
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/.classpath 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/bundle/blueprint/.classpath 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-05-08 11:30:04 UTC (rev 88421)
@@ -96,6 +96,7 @@
org.apache.log4j,
org.jboss.logging,
org.jboss.mx.util;resolution:=optional,
+ org.jboss.osgi.spi,
org.jboss.osgi.spi.logging,
org.jboss.remoting;resolution:=optional,
org.jboss.remoting.*;resolution:=optional,
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-08 11:30:04 UTC (rev 88421)
@@ -64,6 +64,7 @@
<!-- The Framework Management -->
<bean name="jboss.osgi:service=ManagedFramework" class="org.jboss.osgi.spi.management.ManagedFramework">
+ <property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
</bean>
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -23,6 +23,9 @@
//$Id$
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import javax.management.MBeanServer;
@@ -31,6 +34,10 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.Constants;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
/**
* The managed view of an OSGi Framework
@@ -44,12 +51,18 @@
final Logger log = Logger.getLogger(ManagedFramework.class);
private MBeanServer mbeanServer;
+ private BundleContext systemContext;
public void setMbeanServer(MBeanServer server)
{
this.mbeanServer = server;
}
+ public void setSystemContext(BundleContext systemContext)
+ {
+ this.systemContext = systemContext;
+ }
+
@SuppressWarnings("unchecked")
public ObjectName getBundle(String symbolicName)
{
@@ -77,19 +90,25 @@
return names;
}
- // Accept names like "jboss.osgi:bundle=*"
- static class IsBundleQueryExp implements QueryExp
+ public void refreshPackages(String[] symbolicNames)
{
- private static final long serialVersionUID = 1L;
-
- public boolean apply(ObjectName name)
+ ServiceReference sref = systemContext.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin service = (PackageAdmin)systemContext.getService(sref);
+
+ Bundle[] bundles = null;
+ if (symbolicNames != null)
{
- return name.getKeyProperty("bundle") != null;
+ List<String> nameList = Arrays.asList(symbolicNames);
+ Set<Bundle> bundleSet = new HashSet<Bundle>();
+ for (Bundle bundle : systemContext.getBundles())
+ {
+ if (nameList.contains(bundle.getSymbolicName()))
+ bundleSet.add(bundle);
+ }
+ bundles = new Bundle[bundleSet.size()];
+ bundleSet.toArray(bundles);
}
-
- public void setMBeanServer(MBeanServer server)
- {
- }
+ service.refreshPackages(bundles);
}
public void start()
@@ -104,4 +123,19 @@
log.warn("Cannot register: " + ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
}
}
+
+ // Accept names like "jboss.osgi:bundle=*"
+ static class IsBundleQueryExp implements QueryExp
+ {
+ private static final long serialVersionUID = 1L;
+
+ public boolean apply(ObjectName name)
+ {
+ return name.getKeyProperty("bundle") != null;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ }
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -47,4 +47,9 @@
* Get the installed bundle
*/
ObjectName getBundle(String symbolicName);
+
+ /**
+ * Refresh packages through the PackageAdmin service
+ */
+ void refreshPackages(String[] symbolicNames);
}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -0,0 +1,64 @@
+/*
+ * 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.osgi.spi.testing;
+
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemotePackageAdmin extends AbstractPackageAdmin
+{
+ private RemoteRuntime runtime;
+
+ public RemotePackageAdmin(RemoteRuntime runtime)
+ {
+ this.runtime = runtime;
+ }
+
+ @Override
+ public void refreshPackages(AbstractBundle[] bundles)
+ {
+ String[] bundleArr = null;
+ if (bundles != null)
+ {
+ bundleArr = new String[bundles.length];
+ for (int i=0; i < bundles.length; i++)
+ {
+ bundleArr[i] = bundles[i].getSymbolicName();
+ }
+ }
+ try
+ {
+ ManagedFrameworkMBean mbeanProxy = runtime.getMBeanProxy(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ mbeanProxy.refreshPackages(bundleArr);
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new IllegalStateException("Cannot refresh packages", ex);
+ }
+ }
+}
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -37,7 +37,6 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.framework.RemoteFramework;
import org.jboss.osgi.spi.framework.RemoteFrameworkException;
@@ -227,7 +226,7 @@
public AbstractPackageAdmin getPackageAdmin()
{
- throw new NotImplementedException();
+ return new RemotePackageAdmin(this);
}
private RemoteFramework getRemoteFramework() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-05-08 11:30:04 UTC (rev 88421)
@@ -18,6 +18,14 @@
<properties>
</properties>
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ </dependency>
+ </dependencies>
+
<!-- Build -->
<build>
<plugins>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-05-08 11:30:04 UTC (rev 88421)
@@ -44,14 +44,14 @@
<!-- Please add alphabetically -->
- <!-- jbosgi36 -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/deployer/jbosgi36/jbosgi36.bnd" />
+ <!-- jbossas/jbosgi36 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/jbossas/jbosgi36/jbosgi36.bnd" />
<jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
<fileset dir="${tests.classes.dir}">
- <include name="org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.class" />
- <include name="org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.class" />
+ <include name="org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.class" />
+ <include name="org/jboss/test/osgi/jbossas/jbosgi36/mbean/FooMBean.class" />
</fileset>
- <fileset dir="${tests.resources.dir}/deployer/jbosgi36">
+ <fileset dir="${tests.resources.dir}/jbossas/jbosgi36">
<include name="META-INF/jbosgi36-jboss-beans.xml" />
</fileset>
</jar>
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36RemoteTestCase.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36RemoteTestCase.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,116 +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.test.osgi.deployer.jbosgi36;
-
-//$Id: OSGI36TestCase.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
-import org.jboss.test.osgi.deployer.jbosgi36.mbean.FooMBean;
-
-/**
- * [JBOSGI-36] Bundle classes leak into system classloader
- *
- * https://jira.jboss.org/jira/browse/JBOSGI-36
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Feb-2009
- */
-public class OSGI36RemoteTestCase extends OSGiTest
-{
- static OSGiRuntime runtime;
-
- public static Test suite()
- {
- TestSetup setup = new OSGiTestSetup(OSGI36RemoteTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
- runtime.addCapability(new MicrocontainerCapability());
-
- runtime.deploy("jbosgi36-bundle.jar");
- runtime.deploy("jbosgi36-mbean.jar");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- runtime.undeploy("jbosgi36-mbean.jar");
- runtime.undeploy("jbosgi36-bundle.jar");
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
- }
-
- public void testAccessMBean() throws Exception
- {
- assertEquals("hello", getFooMBean().echo("hello"));
- }
-
- public void testAccessSomeService() throws Exception
- {
- try
- {
- String loaderName = getFooMBean().accessSomeService();
- fail("Unexpected classloader: " + loaderName);
- }
- catch (ClassNotFoundException ex)
- {
- // expected
- }
- }
-
- public void testAccessSomeInternal() throws Exception
- {
- try
- {
- String loaderName = getFooMBean().accessSomeInternal();
- fail("Unexpected classloader: " + loaderName);
- }
- catch (ClassNotFoundException ex)
- {
- // expected
- }
- }
-
- private FooMBean getFooMBean() throws MBeanProxyException
- {
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, runtime.getMBeanServer());
- return foo;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,34 +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.test.osgi.deployer.jbosgi36.bundle;
-
-import org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal;
-
-//$Id: SomeService.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
-
-public class SomeService
-{
- public String doStuff()
- {
- return SomeInternal.class.getName();
- }
-}
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,46 +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.test.osgi.deployer.jbosgi36.bundle;
-
-//$Id: SomeServiceActivator.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * A Service Activator
- *
- * @author thomas.diesler at jboss.com
- * @since 04-Feb-2009
- */
-public class SomeServiceActivator implements BundleActivator
-{
- public void start(BundleContext context)
- {
- SomeService service = new SomeService();
- context.registerService(SomeService.class.getName(), service, null);
- }
-
- public void stop(BundleContext context)
- {
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -49,7 +49,7 @@
*/
public void testInstallStartX() throws Exception
{
- OSGiRuntime runtime = getDefaultRuntime();
+ OSGiRuntime runtime = getEmbeddedRuntime();
try
{
AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
@@ -57,6 +57,8 @@
bundleX.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+
+ bundleX.uninstall();
}
finally
{
@@ -69,7 +71,7 @@
*/
public void testInstallXBeforeB() throws Exception
{
- OSGiRuntime runtime = getDefaultRuntime();
+ OSGiRuntime runtime = getEmbeddedRuntime();
try
{
AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
@@ -80,6 +82,9 @@
bundleB.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleB.uninstall();
+ bundleX.uninstall();
}
finally
{
@@ -92,7 +97,7 @@
*/
public void testInstallBBeforeA() throws Exception
{
- OSGiRuntime runtime = getDefaultRuntime();
+ OSGiRuntime runtime = getEmbeddedRuntime();
try
{
AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
@@ -106,6 +111,10 @@
bundleA.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ bundleA.uninstall();
+ bundleB.uninstall();
+ bundleX.uninstall();
}
finally
{
@@ -118,7 +127,7 @@
*/
public void testInstallBBeforeX() throws Exception
{
- OSGiRuntime runtime = getDefaultRuntime();
+ OSGiRuntime runtime = getEmbeddedRuntime();
try
{
AbstractBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
@@ -139,6 +148,9 @@
bundleB.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleB.uninstall();
+ bundleX.uninstall();
}
finally
{
@@ -151,7 +163,7 @@
*/
public void testInstallABeforeB() throws Exception
{
- OSGiRuntime runtime = getDefaultRuntime();
+ OSGiRuntime runtime = getEmbeddedRuntime();
try
{
AbstractBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
@@ -178,6 +190,10 @@
bundleA.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ bundleA.uninstall();
+ bundleB.uninstall();
+ bundleX.uninstall();
}
finally
{
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -66,8 +66,11 @@
bundleB.start();
- assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertTrue("Bundle resolved", + Bundle.RESOLVED == bundleX.getState() || Bundle.ACTIVE == bundleX.getState());
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleB.uninstall();
+ bundleX.uninstall();
}
finally
{
@@ -96,7 +99,7 @@
bundleB.start();
- assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertTrue("Bundle resolved", + Bundle.RESOLVED == bundleX.getState() || Bundle.ACTIVE == bundleX.getState());
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
// Uninstall X before B
@@ -128,7 +131,7 @@
bundleB.start();
- assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertTrue("Bundle resolved", + Bundle.RESOLVED == bundleX.getState() || Bundle.ACTIVE == bundleX.getState());
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
// Uninstall X before B
@@ -156,7 +159,7 @@
bundleB.start();
- assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertTrue("Bundle resolved", + Bundle.RESOLVED == bundleX.getState() || Bundle.ACTIVE == bundleX.getState());
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
bundleB.uninstall();
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java (from rev 88418, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36RemoteTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -0,0 +1,116 @@
+/*
+ * 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.jbossas.jbosgi36;
+
+//$Id: OSGI36TestCase.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.osgi.spi.testing.JMXCapability;
+import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.MicrocontainerCapability;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.jboss.osgi.spi.testing.RemoteRuntime;
+import org.jboss.test.osgi.jbossas.jbosgi36.mbean.FooMBean;
+
+/**
+ * [JBOSGI-36] Bundle classes leak into system classloader
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-36
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 25-Feb-2009
+ */
+public class OSGI36TestCase extends OSGiTest
+{
+ static RemoteRuntime runtime;
+
+ public static Test suite()
+ {
+ TestSetup setup = new OSGiTestSetup(OSGI36TestCase.class)
+ {
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ runtime = getRemoteRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new JMXCapability());
+ runtime.addCapability(new MicrocontainerCapability());
+
+ runtime.deploy("jbosgi36-bundle.jar");
+ runtime.deploy("jbosgi36-mbean.jar");
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ runtime.undeploy("jbosgi36-mbean.jar");
+ runtime.undeploy("jbosgi36-bundle.jar");
+ runtime.shutdown();
+ super.tearDown();
+ }
+ };
+ return setup;
+ }
+
+ public void testAccessMBean() throws Exception
+ {
+ assertEquals("hello", getFooMBean().echo("hello"));
+ }
+
+ public void testAccessSomeService() throws Exception
+ {
+ try
+ {
+ String loaderName = getFooMBean().accessSomeService();
+ fail("Unexpected classloader: " + loaderName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ // expected
+ }
+ }
+
+ public void testAccessSomeInternal() throws Exception
+ {
+ try
+ {
+ String loaderName = getFooMBean().accessSomeInternal();
+ fail("Unexpected classloader: " + loaderName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ // expected
+ }
+ }
+
+ private FooMBean getFooMBean() throws MBeanProxyException
+ {
+ FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, runtime.getMBeanServer());
+ return foo;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/SomeService.java (from rev 88418, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/SomeService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/SomeService.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -0,0 +1,34 @@
+/*
+ * 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.jbossas.jbosgi36.bundle;
+
+import org.jboss.test.osgi.jbossas.jbosgi36.bundle.internal.SomeInternal;
+
+//$Id: SomeService.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+public class SomeService
+{
+ public String doStuff()
+ {
+ return SomeInternal.class.getName();
+ }
+}
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal (from rev 88418, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal)
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/ServiceActivator.java (from rev 88418, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/ServiceActivator.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbossas.jbosgi36.bundle.internal;
+
+//$Id: SomeServiceActivator.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+import org.jboss.test.osgi.jbossas.jbosgi36.bundle.SomeService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ SomeService service = new SomeService();
+ context.registerService(SomeService.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/SomeInternal.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/bundle/internal/SomeInternal.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -19,7 +19,7 @@
* 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.deployer.jbosgi36.bundle.internal;
+package org.jboss.test.osgi.jbossas.jbosgi36.bundle.internal;
//$Id: SomeInternal.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean (from rev 88418, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean)
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,49 +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.test.osgi.deployer.jbosgi36.mbean;
-
-//$Id: Foo.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
-
-import org.jboss.aop.microcontainer.aspects.jmx.JMX;
-
- at JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
-public class Foo implements FooMBean
-{
- public String echo(String msg)
- {
- return msg;
- }
-
- public String accessSomeService() throws ClassNotFoundException
- {
- ClassLoader loader = getClass().getClassLoader();
- loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeService");
- return loader.toString();
- }
-
- public String accessSomeInternal() throws ClassNotFoundException
- {
- ClassLoader loader = getClass().getClassLoader();
- loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal");
- return loader.toString();
- }
-}
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java (from rev 88419, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -0,0 +1,49 @@
+/*
+ * 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.jbossas.jbosgi36.mbean;
+
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
+
+//$Id: Foo.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+ at JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
+public class Foo implements FooMBean
+{
+ public String echo(String msg)
+ {
+ return msg;
+ }
+
+ public String accessSomeService() throws ClassNotFoundException
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeService");
+ return loader.toString();
+ }
+
+ public String accessSomeInternal() throws ClassNotFoundException
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal");
+ return loader.toString();
+ }
+}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/mbean/FooMBean.java 2009-05-08 11:30:04 UTC (rev 88421)
@@ -19,7 +19,7 @@
* 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.deployer.jbosgi36.mbean;
+package org.jboss.test.osgi.jbossas.jbosgi36.mbean;
// $Id: FooMBean.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-08 11:30:04 UTC (rev 88421)
@@ -16,18 +16,34 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
+ org.apache.log4j, \
org.jboss.logging, \
+ org.jboss.net.protocol, \
org.jboss.osgi.spi, \
+ org.jboss.osgi.spi.logging, \
org.jboss.osgi.spi.management, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.net.protocol, \
- org.jboss.virtual.protocol
+ org.jboss.virtual.protocol, \
+ org.osgi.framework;version\=1.4, \
+ org.apache.log4j, \
+ org.jboss.util, \
+ org.jboss.util.id, \
+ org.jboss.util.threadpool, \
+ org.jboss.util.propertyeditor
+# These are needed by jboss-remoting
+# org.apache.log4j, \
+# org.jboss.util, \
+# org.jboss.util.id, \
+# org.jboss.util.threadpool, \
+# org.jboss.util.propertyeditor
+
# Bundles that need to be installed with the Framework automatically
-# org.jboss.osgi.spi.framework.autoInstall=
+org.jboss.osgi.spi.framework.autoInstall=\
+ file://${test.archive.directory}/bundles/org.osgi.compendium.jar
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas (from rev 88418, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer)
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/jbosgi36/META-INF/jbosgi36-jboss-beans.xml 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,6 +1,6 @@
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="Foo" class="org.jboss.test.osgi.deployer.jbosgi36.mbean.Foo"/>
+ <bean name="Foo" class="org.jboss.test.osgi.jbossas.jbosgi36.mbean.Foo"/>
</deployment>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/jbosgi36/jbosgi36.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbossas/jbosgi36/jbosgi36.bnd 2009-05-08 11:30:04 UTC (rev 88421)
@@ -1,7 +1,7 @@
# bnd build -classpath target/test-classes -output target/test-libs/jbosgi36-bundle.jar src/test/resources/jbosgi36/jbosgi36.bnd
Bundle-SymbolicName: jbosgi36
-Bundle-Activator: org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeServiceActivator
-Export-Package: org.jboss.test.osgi.deployer.jbosgi36.bundle
-Private-Package: org.jboss.test.osgi.deployer.jbosgi36.bundle.internal
+Bundle-Activator: org.jboss.test.osgi.jbossas.jbosgi36.bundle.internal.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbossas.jbosgi36.bundle
+Private-Package: org.jboss.test.osgi.jbossas.jbosgi36.bundle.internal
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-08 11:27:33 UTC (rev 88420)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-08 11:30:04 UTC (rev 88421)
@@ -325,8 +325,7 @@
<configuration>
<excludes>
<!-- Exclude tests that require remote access -->
- <exclude>org/jboss/test/osgi/deployer/**</exclude>
- <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
+ <exclude>org/jboss/test/osgi/jbossas/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -335,6 +334,33 @@
</profile>
<!--
+ Name: runtime-tesing
+ Descr: Setup for runtime integration testing
+ -->
+ <profile>
+ <id>runtime-tesing</id>
+ <activation>
+ <property>
+ <name>target.container</name>
+ <value>runtime</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- Exclude tests that require jboss access -->
+ <exclude>org/jboss/test/osgi/jbossas/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
Name: remote-testing
Descr: Setup for remote integration testing
-->
More information about the jboss-osgi-commits
mailing list