Author: thomas.diesler(a)jboss.com
Date: 2010-03-23 00:19:34 -0400 (Tue, 23 Mar 2010)
New Revision: 102752
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractImportExportTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/BasicResolverTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverMetadataTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
Log:
REmove dependency on OSGiRuntimeTest
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTestCase.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTestCase.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -24,14 +24,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiFrameworkTest;
import org.jboss.test.osgi.classloader.support.a.A;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.launch.Framework;
/**
* BundleClassPathTest.
@@ -39,15 +36,11 @@
* @author thomas.diesler(a)jboss.com
* @since 07-Oct-2009
*/
-public class BundleClassPathTestCase extends OSGiRuntimeTest
+public class BundleClassPathTestCase extends OSGiFrameworkTest
{
@Test
public void testBundleClassPath() throws Exception
{
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- Framework framework = bootProvider.getFramework();
- framework.start();
-
BundleContext sysContext = framework.getBundleContext();
Bundle bundle =
sysContext.installBundle(getTestArchivePath("bundle-classpath.war"));
@@ -59,7 +52,5 @@
bundle.uninstall();
assertEquals("Bundle state", Bundle.UNINSTALLED, bundle.getState());
-
- framework.stop();
}
}
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -27,17 +27,12 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
-import org.jboss.osgi.spi.util.ServiceLoader;
-import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiFrameworkTest;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
/**
* A test that deployes a bundle and verifies its state
@@ -45,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Aug-2009
*/
-public class SimpleLogServiceTestCase extends OSGiRuntimeTest
+public class SimpleLogServiceTestCase extends OSGiFrameworkTest
{
@Before
public void setUp()
@@ -56,13 +51,7 @@
@Test
public void testNoLogService() throws Exception
{
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- Framework framework = factory.newFramework(null);
- framework.start();
-
- BundleContext sysContext = framework.getBundleContext();
- Bundle bundle =
sysContext.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
-
+ Bundle bundle =
context.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
try
{
bundle.start();
@@ -72,89 +61,111 @@
{
// expected
}
-
- framework.stop();
+ finally
+ {
+ bundle.uninstall();
+ }
}
@Test
public void testLogServiceFromThirdParty() throws Exception
{
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- Framework framework = factory.newFramework(null);
- framework.start();
-
- BundleContext sysContext = framework.getBundleContext();
-
sysContext.installBundle(getTestArchivePath("bundles/org.apache.felix.log.jar")).start();
-
- Bundle bundle =
sysContext.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
+ Bundle logBundle =
context.installBundle(getTestArchivePath("bundles/org.apache.felix.log.jar"));
try
{
- bundle.start();
+ logBundle.start();
+
+ Bundle bundle =
context.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
+ try
+ {
+ try
+ {
+ bundle.start();
+ fail("Expected UNRESOLVED
OSGiPackageRequirement{org.osgi.util.tracker [0.0.0,?)}");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+ }
+ finally
+ {
+ bundle.uninstall();
+ }
}
- catch (BundleException ex)
+ finally
{
- // Expected UNRESOLVED OSGiPackageRequirement{org.osgi.util.tracker [0.0.0,?)}
with MC Framework
+ logBundle.uninstall();
}
-
- assumeTrue(bundle.getState() == Bundle.ACTIVE);
-
- // The bundle activator is expected to set this property
- String result = System.getProperty(bundle.getSymbolicName());
- assertNotNull("Result property not null", result);
-
- assertTrue("BundleActivator start",
result.indexOf("startBundleActivator") > 0);
- assertFalse("getService", result.indexOf("getService") >
0);
- assertFalse("addingService", result.indexOf("addingService")
> 0);
-
- framework.stop();
}
@Test
public void testLogServiceFromCompendium() throws Exception
{
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- Framework framework = factory.newFramework(null);
- framework.start();
+ Bundle cmpnBundle =
context.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
+ try
+ {
+ Bundle bundle =
context.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
+ try
+ {
+ bundle.start();
- BundleContext sysContext = framework.getBundleContext();
-
sysContext.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
+ // The bundle activator is expected to set this property
+ String result = System.getProperty(bundle.getSymbolicName());
+ assertNotNull("Result property not null", result);
- Bundle bundle =
sysContext.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
- bundle.start();
-
- // The bundle activator is expected to set this property
- String result = System.getProperty(bundle.getSymbolicName());
- assertNotNull("Result property not null", result);
-
- assertTrue("BundleActivator start",
result.indexOf("startBundleActivator") > 0);
- assertFalse("getService", result.indexOf("getService") >
0);
- assertFalse("addingService", result.indexOf("addingService")
> 0);
-
- framework.stop();
+ assertTrue("BundleActivator start",
result.indexOf("startBundleActivator") > 0);
+ assertFalse("getService", result.indexOf("getService")
> 0);
+ assertFalse("addingService",
result.indexOf("addingService") > 0);
+ }
+ finally
+ {
+ bundle.uninstall();
+ }
+ }
+ finally
+ {
+ cmpnBundle.uninstall();
+ }
}
@Test
public void testLogServiceFromTwoExporters() throws Exception
{
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- Framework framework = factory.newFramework(null);
- framework.start();
+ Bundle cmpnBundle =
context.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
+ try
+ {
+ Bundle logBundle =
context.installBundle(getTestArchivePath("bundles/org.apache.felix.log.jar"));
+ try
+ {
+ logBundle.start();
- BundleContext sysContext = framework.getBundleContext();
-
sysContext.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar")).start();
-
sysContext.installBundle(getTestArchivePath("bundles/org.apache.felix.log.jar")).start();
+ Bundle bundle =
context.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
+ try
+ {
+ bundle.start();
- Bundle bundle =
sysContext.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
- bundle.start();
+ // The bundle activator is expected to set this property
+ String result = System.getProperty(bundle.getSymbolicName());
+ assertNotNull("Result property not null", result);
- // The bundle activator is expected to set this property
- String result = System.getProperty(bundle.getSymbolicName());
- assertNotNull("Result property not null", result);
-
- assertTrue("BundleActivator start",
result.indexOf("startBundleActivator") > 0);
- assertTrue("getService", result.indexOf("getService") > 0);
- assertTrue("addingService", result.indexOf("addingService")
> 0);
-
- framework.stop();
+ assertTrue("BundleActivator start",
result.indexOf("startBundleActivator") > 0);
+ assertTrue("getService", result.indexOf("getService")
> 0);
+ assertTrue("addingService",
result.indexOf("addingService") > 0);
+ }
+ finally
+ {
+ bundle.uninstall();
+ }
+ }
+ finally
+ {
+ logBundle.uninstall();
+ }
+ }
+ finally
+ {
+ cmpnBundle.uninstall();
+ }
}
}
\ No newline at end of file
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -23,15 +23,10 @@
//$Id: FragmentTestCase.java 99648 2010-01-20 09:27:43Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiRuntimeTest;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.jboss.osgi.testing.OSGiFrameworkTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.launch.Framework;
/**
* Test NativeCode-Library functionality
@@ -39,28 +34,8 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jan-2010
*/
-public class NativeCodeTestCase extends OSGiRuntimeTest
+public class NativeCodeTestCase extends OSGiFrameworkTest
{
- private static Framework framework;
-
- @BeforeClass
- public static void beforeClass() throws Exception
- {
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- framework = bootProvider.getFramework();
- framework.start();
- }
-
- @AfterClass
- public static void afterClass() throws Exception
- {
- if (framework != null)
- {
- framework.stop();
- framework = null;
- }
- }
-
@Test
public void testNativeCode() throws Exception
{
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractImportExportTest.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractImportExportTest.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractImportExportTest.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -47,13 +47,13 @@
// Bundle-SymbolicName: simpleimport
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -86,7 +86,7 @@
// Bundle-SymbolicName: simpleimport
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -112,13 +112,13 @@
// Bundle-SymbolicName: simpleimport
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Only resolve BundleB
@@ -155,7 +155,7 @@
// Export-Package: org.jboss.test.osgi.classloader.support.a
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/selfimport", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -181,13 +181,13 @@
//Bundle-SymbolicName: packageimportversion
//Import-Package:
org.jboss.test.osgi.classloader.support.a;version="[0.0.0,1.0.0]"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageimportversion");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: packageexportversion100
//Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/packageexportversion100", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -220,13 +220,13 @@
//Bundle-SymbolicName: packageimportversionfails
//Import-Package:
org.jboss.test.osgi.classloader.support.a;version="[3.0,4.0)"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageimportversionfails");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: packageexportversion100
//Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/packageexportversion100", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -259,7 +259,7 @@
//Bundle-SymbolicName: packageimportoptional
//Import-Package: org.jboss.test.osgi.classloader.support.a;resolution:=optional
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageimportoptional");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -285,13 +285,13 @@
//Bundle-SymbolicName: packageimportoptional
//Import-Package: org.jboss.test.osgi.classloader.support.a;resolution:=optional
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageimportoptional");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -324,7 +324,7 @@
//Bundle-SymbolicName: packageimportoptional
//Import-Package: org.jboss.test.osgi.classloader.support.a;resolution:=optional
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageimportoptional");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -335,7 +335,7 @@
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -368,13 +368,13 @@
//Bundle-SymbolicName: bundlenameimport
//Import-Package:
org.jboss.test.osgi.classloader.support.a;bundle-symbolic-name=simpleexport
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/bundlenameimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: simpleexport
//Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -407,13 +407,13 @@
//Bundle-SymbolicName: bundlenameimport
//Import-Package:
org.jboss.test.osgi.classloader.support.a;bundle-symbolic-name=simpleexport
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/bundlenameimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: sigleton;singleton:=true
//Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/singleton", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -446,13 +446,13 @@
//Bundle-SymbolicName: bundleversionimport
//Import-Package:
org.jboss.test.osgi.classloader.support.a;bundle-version="[0.0.0,1.0.0)"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/bundleversionimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -485,13 +485,13 @@
//Bundle-SymbolicName: bundleversionimportfails
//Import-Package:
org.jboss.test.osgi.classloader.support.a;bundle-version="[1.0.0,2.0.0)"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/bundleversionimportfails");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -526,13 +526,13 @@
//Bundle-SymbolicName: requirebundle
//Require-Bundle: simpleexport
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundle");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -565,7 +565,7 @@
//Bundle-SymbolicName: requirebundle
//Require-Bundle: simpleexport
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundle");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -591,7 +591,7 @@
//Bundle-SymbolicName: requirebundleoptional
//Require-Bundle: simpleexport;resolution:=optional
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundleoptional");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -614,13 +614,13 @@
//Bundle-SymbolicName: requirebundleversion
//Require-Bundle: simpleexport;bundle-version="[0.0.0,1.0.0]"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundleversion");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -653,13 +653,13 @@
//Bundle-SymbolicName: versionrequirebundlefails
//Require-Bundle: simpleexport;bundle-version="[1.0.0,2.0.0)"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundleversionfails");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -701,7 +701,7 @@
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileC = assembleArchive("bundleC",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
@@ -712,10 +712,10 @@
// Verify bundle states
assertEquals("BundleA RESOLVED", Bundle.RESOLVED,
bundleA.getState());
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
- Bundle bundleC = framework.installBundle(fileC);
+ Bundle bundleC = installBundle(fileC);
try
{
allResolved = packageAdmin.resolveBundles(null);
@@ -761,7 +761,7 @@
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileC = assembleArchive("bundleC",
"/bundles/resolver/simpleimport");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -772,10 +772,10 @@
// Verify bundle states
assertEquals("BundleB RESOLVED", Bundle.RESOLVED,
bundleB.getState());
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
- Bundle bundleC = framework.installBundle(fileC);
+ Bundle bundleC = installBundle(fileC);
try
{
allResolved = packageAdmin.resolveBundles(null);
@@ -821,13 +821,13 @@
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileC = assembleArchive("bundleC",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
- Bundle bundleC = framework.installBundle(fileC);
+ Bundle bundleC = installBundle(fileC);
try
{
// Resolve the installed bundles
@@ -876,13 +876,13 @@
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileC = assembleArchive("bundleC",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
- Bundle bundleC = framework.installBundle(fileC);
+ Bundle bundleC = installBundle(fileC);
try
{
// Resolve the installed bundles
@@ -931,10 +931,10 @@
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileC = assembleArchive("bundleC",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -946,7 +946,7 @@
assertEquals("BundleA RESOLVED", Bundle.RESOLVED,
bundleA.getState());
assertEquals("BundleB RESOLVED", Bundle.RESOLVED,
bundleB.getState());
- Bundle bundleC = framework.installBundle(fileC);
+ Bundle bundleC = installBundle(fileC);
try
{
allResolved = packageAdmin.resolveBundles(null);
@@ -991,10 +991,10 @@
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileC = assembleArchive("bundleC",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -1006,7 +1006,7 @@
assertEquals("BundleA RESOLVED", Bundle.RESOLVED,
bundleA.getState());
assertEquals("BundleB RESOLVED", Bundle.RESOLVED,
bundleB.getState());
- Bundle bundleC = framework.installBundle(fileC);
+ Bundle bundleC = installBundle(fileC);
try
{
allResolved = packageAdmin.resolveBundles(null);
@@ -1042,13 +1042,13 @@
//Bundle-SymbolicName: packageexportattribute
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattribute", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: simpleimport
//Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleimport");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -1072,7 +1072,7 @@
//Bundle-SymbolicName: packageimportattribute
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=x
fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattribute");
- bundleB = framework.installBundle(fileB);
+ bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -1105,13 +1105,13 @@
//Bundle-SymbolicName: packageexportattribute
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattribute", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: packageimportattributefails
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=y
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattributefails");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -1144,13 +1144,13 @@
//Bundle-SymbolicName: packageexportattributemandatory
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x;mandatory:=test
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattributemandatory", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: packageimportattribute
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=x
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattribute");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -1183,13 +1183,13 @@
//Bundle-SymbolicName: packageexportattributemandatory
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x;mandatory:=test
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattributemandatory", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
//Bundle-SymbolicName: simpleimport
//Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleimport");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
// Resolve the installed bundles
@@ -1222,7 +1222,7 @@
//Bundle-SymbolicName: systempackageimport
//Import-Package: org.osgi.framework;version=1.4
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/systempackageimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
// Resolve the installed bundles
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -27,20 +27,13 @@
import static org.junit.Assert.fail;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
-import org.jboss.osgi.framework.launch.OSGiFramework;
import org.jboss.osgi.framework.plugins.PackageAdminPlugin;
import org.jboss.osgi.framework.plugins.Plugin;
import org.jboss.osgi.framework.plugins.ResolverPlugin;
import org.jboss.osgi.framework.resolver.Resolver;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiRuntimeTest;
-import org.junit.AfterClass;
+import org.jboss.test.osgi.AbstractFrameworkTest;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
import org.osgi.service.packageadmin.PackageAdmin;
/**
@@ -49,28 +42,8 @@
* @author thomas.diesler(a)jboss.com
* @since 09-Nov-2009
*/
-public abstract class AbstractResolverTest extends OSGiRuntimeTest
+public abstract class AbstractResolverTest extends AbstractFrameworkTest
{
- protected static OSGiFramework framework;
-
- @BeforeClass
- public static void beforeClass() throws BundleException
- {
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- framework = (OSGiFramework)bootProvider.getFramework();
- framework.start();
- }
-
- @AfterClass
- public static void afterClass() throws BundleException
- {
- if (framework != null)
- {
- framework.stop();
- framework = null;
- }
- }
-
@Before
public void setUp() throws Exception
{
@@ -78,7 +51,7 @@
Resolver testResolver = getTestResolver();
if (installedResolver != testResolver)
{
- OSGiBundleManager bundleManager = framework.getBundleManager();
+ OSGiBundleManager bundleManager = getBundleManager();
if (installedResolver != null)
bundleManager.removePlugin((Plugin)installedResolver);
if (testResolver != null)
@@ -94,22 +67,16 @@
protected Resolver getInstalledResolver()
{
- OSGiBundleManager bundleManager = framework.getBundleManager();
+ OSGiBundleManager bundleManager = getBundleManager();
return bundleManager.getOptionalPlugin(ResolverPlugin.class);
}
protected PackageAdmin getPackageAdmin()
{
- OSGiBundleManager bundleManager = framework.getBundleManager();
+ OSGiBundleManager bundleManager = getBundleManager();
return bundleManager.getPlugin(PackageAdminPlugin.class);
}
- protected BundleContext getSystemContext()
- {
- BundleContext sysContext = framework.getBundleContext();
- return sysContext;
- }
-
protected void assertLoaderBundle(Bundle expLoader, Bundle srcLoader, Class<?>
clazz) throws ClassNotFoundException
{
Class<?> classA = srcLoader.loadClass(clazz.getName());
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/BasicResolverTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/BasicResolverTestCase.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/BasicResolverTestCase.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -42,7 +42,7 @@
Resolver resolver = getInstalledResolver();
if (resolver == null || resolver.getClass() != BasicResolverImpl.class)
{
- OSGiBundleManager bundleManager = framework.getBundleManager();
+ OSGiBundleManager bundleManager = getBundleManager();
resolver = new BasicResolverImpl(bundleManager);
resolver.addBundle(bundleManager.getSystemBundle());
}
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverMetadataTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverMetadataTestCase.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverMetadataTestCase.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -61,7 +61,7 @@
// Bundle-SymbolicName: simpleexport
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/simpleexport", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
assertEquals(1, resolver.getBundles().size());
@@ -116,7 +116,7 @@
// Bundle-SymbolicName: simpleimport
// Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/simpleimport");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -149,7 +149,7 @@
// Bundle-SymbolicName: singleton;singleton:=true
// Export-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/singleton", A.class);
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -171,7 +171,7 @@
//Bundle-SymbolicName: requirebundle
//Require-Bundle: simpleexport
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundle");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -198,7 +198,7 @@
//Bundle-SymbolicName: requirebundle
//Require-Bundle: simpleexport;resolution:=optional
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundleoptional");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -225,7 +225,7 @@
//Bundle-SymbolicName: requirebundle
//Require-Bundle: simpleexport;bundle-version="[0.0.0,1.0.0]"
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/requirebundleversion");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -252,7 +252,7 @@
//Bundle-SymbolicName: packageexportattribute
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattribute");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -264,7 +264,7 @@
//Bundle-SymbolicName: simpleimport
//Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleimport");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
ResolverBundle resBundleB = resolver.getBundle(bundleB);
@@ -279,7 +279,7 @@
//Bundle-SymbolicName: packageimportattribute
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=x
fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattribute");
- bundleB = framework.installBundle(fileB);
+ bundleB = installBundle(fileB);
try
{
ResolverBundle resBundleB = resolver.getBundle(bundleB);
@@ -310,7 +310,7 @@
//Bundle-SymbolicName: packageexportattribute
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattribute");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -322,7 +322,7 @@
//Bundle-SymbolicName: packageimportattributefails
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=y
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattributefails");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
ResolverBundle resBundleB = resolver.getBundle(bundleB);
@@ -353,7 +353,7 @@
//Bundle-SymbolicName: packageexportattributemandatory
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x;mandatory:=test
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattributemandatory");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -367,7 +367,7 @@
//Bundle-SymbolicName: packageimportattribute
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=x
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattribute");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
ResolverBundle resBundleB = resolver.getBundle(bundleB);
@@ -398,7 +398,7 @@
//Bundle-SymbolicName: packageexportattributemandatory
//Export-Package: org.jboss.test.osgi.classloader.support.a;test=x;mandatory:=test
VirtualFile fileA = assembleArchive("bundleA",
"/bundles/resolver/packageexportattributemandatory");
- Bundle bundleA = framework.installBundle(fileA);
+ Bundle bundleA = installBundle(fileA);
try
{
ResolverBundle resBundleA = resolver.getBundle(bundleA);
@@ -412,7 +412,7 @@
//Bundle-SymbolicName: simpleimport
//Import-Package: org.jboss.test.osgi.classloader.support.a
VirtualFile fileB = assembleArchive("bundleB",
"/bundles/resolver/simpleimport");
- Bundle bundleB = framework.installBundle(fileB);
+ Bundle bundleB = installBundle(fileB);
try
{
ResolverBundle resBundleB = resolver.getBundle(bundleB);
@@ -427,7 +427,7 @@
//Bundle-SymbolicName: packageimportattributefails
//Import-Package: org.jboss.test.osgi.classloader.support.a;test=y
fileB = assembleArchive("bundleB",
"/bundles/resolver/packageimportattributefails");
- bundleB = framework.installBundle(fileB);
+ bundleB = installBundle(fileB);
try
{
ResolverBundle resBundleB = resolver.getBundle(bundleB);
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTestCase.java 2010-03-23
03:55:01 UTC (rev 102751)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTestCase.java 2010-03-23
04:19:34 UTC (rev 102752)
@@ -30,16 +30,12 @@
import java.util.List;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
-import org.jboss.osgi.framework.launch.OSGiFramework;
import org.jboss.osgi.framework.plugins.ResolverPlugin;
import org.jboss.osgi.framework.resolver.Resolver;
import org.jboss.osgi.framework.resolver.ResolverBundle;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.test.osgi.AbstractFrameworkTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
/**
@@ -48,62 +44,50 @@
* @author thomas.diesler(a)jboss.com
* @since 27-Jul-2009
*/
-public class ResolverSmokeTestCase extends OSGiRuntimeTest
+public class ResolverSmokeTestCase extends AbstractFrameworkTest
{
@Test
public void testRandomBundleResolution() throws BundleException
{
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- OSGiFramework framework = (OSGiFramework)bootProvider.getFramework();
- framework.start();
+ List<String> bundlePaths = new ArrayList<String>();
+ bundlePaths.add("bundles/jboss-osgi-apache-xerces.jar");
+ bundlePaths.add("bundles/jboss-osgi-common.jar");
+ bundlePaths.add("bundles/jboss-osgi-common-core.jar");
+ bundlePaths.add("bundles/jboss-osgi-husky.jar");
+ bundlePaths.add("bundles/jboss-osgi-jaxb.jar");
+ bundlePaths.add("bundles/jboss-osgi-jmx.jar");
+ bundlePaths.add("bundles/jboss-osgi-jndi.jar");
+ bundlePaths.add("bundles/jboss-osgi-reflect.jar");
+ bundlePaths.add("bundles/jboss-osgi-xml-binding.jar");
+ bundlePaths.add("bundles/org.apache.felix.configadmin.jar");
+ bundlePaths.add("bundles/org.apache.felix.log.jar");
+ bundlePaths.add("bundles/org.apache.felix.metatype.jar");
+ bundlePaths.add("bundles/org.osgi.compendium.jar");
+ bundlePaths.add("bundles/pax-web-jetty-bundle.jar");
- try
+ Collections.shuffle(bundlePaths);
+
+ List<Bundle> unresolved = new ArrayList<Bundle>();
+ for (String path : bundlePaths)
{
- List<String> bundlePaths = new ArrayList<String>();
- bundlePaths.add("bundles/jboss-osgi-apache-xerces.jar");
- bundlePaths.add("bundles/jboss-osgi-common.jar");
- bundlePaths.add("bundles/jboss-osgi-common-core.jar");
- bundlePaths.add("bundles/jboss-osgi-husky.jar");
- bundlePaths.add("bundles/jboss-osgi-jaxb.jar");
- bundlePaths.add("bundles/jboss-osgi-jmx.jar");
- bundlePaths.add("bundles/jboss-osgi-jndi.jar");
- bundlePaths.add("bundles/jboss-osgi-reflect.jar");
- bundlePaths.add("bundles/jboss-osgi-xml-binding.jar");
- bundlePaths.add("bundles/org.apache.felix.configadmin.jar");
- bundlePaths.add("bundles/org.apache.felix.log.jar");
- bundlePaths.add("bundles/org.apache.felix.metatype.jar");
- bundlePaths.add("bundles/org.osgi.compendium.jar");
- bundlePaths.add("bundles/pax-web-jetty-bundle.jar");
+ Bundle bundle = context.installBundle(getTestArchivePath(path));
+ unresolved.add(bundle);
+ }
- Collections.shuffle(bundlePaths);
+ OSGiBundleManager bundleManager = getBundleManager();
+ Resolver resolver = bundleManager.getOptionalPlugin(ResolverPlugin.class);
+ if (resolver != null)
+ {
+ List<ResolverBundle> installedBundles = resolver.getBundles();
+ assertEquals("All bundles installed", bundlePaths.size(),
installedBundles.size());
- List<Bundle> unresolved = new ArrayList<Bundle>();
- BundleContext sysContext = framework.getBundleContext();
- for (String path : bundlePaths)
- {
- Bundle bundle = sysContext.installBundle(getTestArchivePath(path));
- unresolved.add(bundle);
- }
-
- OSGiBundleManager bundleManager = framework.getBundleManager();
- Resolver resolver = bundleManager.getOptionalPlugin(ResolverPlugin.class);
- if (resolver != null)
- {
- List<ResolverBundle> installedBundles = resolver.getBundles();
- assertEquals("All bundles installed", bundlePaths.size(),
installedBundles.size());
-
- List<ResolverBundle> resolved = resolver.resolve(unresolved);
- assertEquals("All bundles resolved", unresolved.size(),
resolved.size());
- }
-
- System.out.println("FIXME [JBKERNEL-54] Cannot resolve circular
dependencies");
- //PackageAdminPlugin packageAdmin =
bundleManager.getPlugin(PackageAdminPlugin.class);
- //boolean allResolved = packageAdmin.resolveBundles(null);
- //assertTrue("All bundles resolved", allResolved);
+ List<ResolverBundle> resolved = resolver.resolve(unresolved);
+ assertEquals("All bundles resolved", unresolved.size(),
resolved.size());
}
- finally
- {
- framework.stop();
- }
+
+ System.out.println("FIXME [JBKERNEL-54] Cannot resolve circular
dependencies");
+ //PackageAdminPlugin packageAdmin =
bundleManager.getPlugin(PackageAdminPlugin.class);
+ //boolean allResolved = packageAdmin.resolveBundles(null);
+ //assertTrue("All bundles resolved", allResolved);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-03-23 03:55:01 UTC
(rev 102751)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-03-23 04:19:34 UTC
(rev 102752)
@@ -44,11 +44,9 @@
<!-- Modules -->
<modules>
<module>core</module>
- <!--
<module>metadata</module>
<module>vfs21</module>
<module>vfs30</module>
- -->
<module>bundle</module>
</modules>