Author: thomas.diesler(a)jboss.com
Date: 2010-03-10 16:38:44 -0500 (Wed, 10 Mar 2010)
New Revision: 102246
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java
Log:
Resurect all ServiceMix tests
Simplify installBundle
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -31,6 +31,7 @@
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.attachments.MutableAttachments;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
@@ -158,6 +159,11 @@
MutableAttachments att =
(MutableAttachments)deployment.getPredeterminedManagedObjects();
att.addAttachment(BeanMetaData.class, bmd);
+ return addDeployment(deployment);
+ }
+
+ protected Deployment addDeployment(Deployment deployment) throws DeploymentException
+ {
getDeployerClient().addDeployment(deployment);
getDeployerClient().process();
return deployment;
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -43,6 +43,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.util.ConstantsHelper;
import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.vfs.VirtualFile;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.osgi.framework.Bundle;
@@ -108,6 +109,11 @@
return ((OSGiFramework)framework).getBundleManager();
}
+ protected Bundle installBundle(VirtualFile archive) throws Exception
+ {
+ return context.installBundle(archive.toURL().toExternalForm());
+
+ }
protected void assertLoadClass(Bundle bundle, String className, Bundle exporter)
{
Class<?> clazz = assertLoadClass(bundle, className);
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -38,7 +38,6 @@
import java.util.Locale;
import java.util.Set;
-import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.AbstractFrameworkTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -62,8 +61,7 @@
@Test
public void testGetBundle() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
BundleContext context1 = null;
try
{
@@ -77,8 +75,7 @@
Set<Bundle> expected = new HashSet<Bundle>(Arrays.asList(framework,
bundle1));
assertEquals(expected, actual);
- VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2"));
BundleContext context2 = null;
try
{
@@ -176,8 +173,7 @@
@Test
public void testProperties() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -258,8 +254,7 @@
@Test
public void testServiceListener() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -351,8 +346,7 @@
@Test
public void testBundleListener() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -409,8 +403,7 @@
@Test
public void testFrameworkListener() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -448,8 +441,7 @@
@Test
public void testGetDataFile() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -469,8 +461,7 @@
@Test
public void testStopedBundleContext() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1"));
try
{
bundle.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -23,7 +23,10 @@
// $Id: $
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
import java.net.URL;
import java.util.Arrays;
@@ -32,7 +35,6 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.AbstractFrameworkTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -51,8 +53,7 @@
@Test
public void testEntriesNotInstalled() throws Exception
{
- VirtualFile assembly = assembleArchive("entries-simple",
"/bundles/entries/entries-simple", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("entries-simple",
"/bundles/entries/entries-simple"));
bundle.uninstall();
try
{
@@ -77,8 +78,7 @@
@Test
public void testFindEntriesNoPath() throws Exception
{
- VirtualFile assembly = assembleArchive("entries-simple",
"/bundles/entries/entries-simple", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("entries-simple",
"/bundles/entries/entries-simple"));
try
{
bundle.findEntries(null, "root.xml", false);
@@ -97,8 +97,7 @@
@Test
public void testEntries() throws Exception
{
- VirtualFile assembly = assembleArchive("entries-simple",
"/bundles/entries/entries-simple", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("entries-simple",
"/bundles/entries/entries-simple"));
try
{
assertEntry(bundle, "");
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -52,7 +52,7 @@
public void testSimpleStart() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service",
"/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleA.getState());
@@ -77,7 +77,7 @@
public void testDependencyNotAvailable() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service",
"/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleA.getState());
@@ -87,7 +87,7 @@
assertNull("Service not available", sref);
VirtualFile assemblyB = assembleArchive("lifecycle-failstart",
"/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
assertBundleState(Bundle.INSTALLED, bundleB.getState());
@@ -119,14 +119,14 @@
public void testDependencyAvailable() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service",
"/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertBundleState(Bundle.ACTIVE, bundleA.getState());
VirtualFile assemblyB = assembleArchive("lifecycle-failstart",
"/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -152,13 +152,13 @@
public void testStartRetry() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service",
"/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleA.getState());
VirtualFile assemblyB = assembleArchive("lifecycle-failstart",
"/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
assertBundleState(Bundle.INSTALLED, bundleB.getState());
@@ -201,7 +201,7 @@
public void testFailToResolve() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-failstart",
"/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleB.getState());
@@ -232,8 +232,7 @@
{
try
{
- VirtualFile assembly = assembleArchive("missing-symbolic-name",
"/bundles/lifecycle/invalid01");
- context.installBundle(assembly.toURL().toExternalForm());
+ installBundle(assembleArchive("missing-symbolic-name",
"/bundles/lifecycle/invalid01"));
fail("BundleException expected");
}
catch (BundleException ex)
@@ -243,8 +242,7 @@
try
{
- VirtualFile assembly = assembleArchive("invalid-export",
"/bundles/lifecycle/invalid02");
- context.installBundle(assembly.toURL().toExternalForm());
+ installBundle(assembleArchive("invalid-export",
"/bundles/lifecycle/invalid02"));
fail("BundleException expected");
}
catch (BundleException ex)
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -58,8 +58,8 @@
public void testBundleId() throws Exception
{
long id1 = -1;
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
id1 = bundle.getBundleId();
@@ -71,7 +71,7 @@
assertEquals(id1, bundle.getBundleId());
long id2 = -1;
- bundle = context.installBundle(assembly.toURL().toExternalForm());
+ bundle = installBundle(assembly);
try
{
id2 = bundle.getBundleId();
@@ -87,8 +87,8 @@
@Test
public void testSymbolicName() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
assertEquals("org.jboss.test.osgi.simple1",
bundle.getSymbolicName());
@@ -103,8 +103,8 @@
@Test
public void testState() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
assertEquals(Bundle.INSTALLED, bundle.getState());
@@ -125,8 +125,8 @@
@Test
public void testGetBundleContext() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
BundleContext bundleContext = bundle.getBundleContext();
@@ -169,7 +169,7 @@
new JarOutputStream(baos, manifest).close();
ByteArrayInputStream updateStream = new ByteArrayInputStream(baos.toByteArray());
- Bundle bundle = context.installBundle(assemble1.toURL().toExternalForm());
+ Bundle bundle = installBundle(assemble1);
try
{
int beforeCount = context.getBundles().length;
@@ -201,11 +201,11 @@
public void testSingleton() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundle10",
"/bundles/singleton/singleton1");
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
VirtualFile assemblyB = assembleArchive("bundle20",
"/bundles/singleton/singleton2");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
bundleB.uninstall();
fail("Should not be here!");
}
@@ -223,11 +223,11 @@
public void testNotSingleton() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundle1",
"/bundles/singleton/singleton1");
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
VirtualFile assemblyB = assembleArchive("not-singleton",
"/bundles/singleton/not-singleton");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
assertEquals(bundleA.getSymbolicName(), bundleB.getSymbolicName());
@@ -247,8 +247,8 @@
@SuppressWarnings({ "rawtypes", "unchecked" })
public void testGetHeaders() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
Dictionary expected = new Hashtable();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -47,13 +47,13 @@
public void testSimpleRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("simplerequirebundleA",
"/bundles/classloader/simplerequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -75,13 +75,13 @@
public void testSimpleRequireBundleFails() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("simplerequirebundlefails",
"/bundles/classloader/simplerequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -106,13 +106,13 @@
public void testVersionRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("versionrequirebundleA",
"/bundles/classloader/versionrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -134,13 +134,13 @@
public void testVersionRequireBundleFails() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("versionrequirebundlefails",
"/bundles/classloader/versionrequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -165,13 +165,13 @@
public void testOptionalRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("optionalrequirebundleA",
"/bundles/classloader/optionalrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -193,13 +193,13 @@
public void testOptionalRequireBundleFails() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("optionalrequirebundlefails",
"/bundles/classloader/optionalrequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -225,7 +225,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleA;test=x
//Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0;test=x
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
@@ -237,7 +237,7 @@
//Require-Bundle: org.jboss.test.osgi.classloader.bundleA;visibility:=reexport
//Export-Package: org.jboss.test.osgi.classloader.support.b
VirtualFile assemblyB = assembleArchive("reexportrequirebundleA",
"/bundles/classloader/reexportrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
@@ -249,7 +249,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleC
//Require-Bundle: org.jboss.test.osgi.classloader.bundleB
VirtualFile assemblyC = assembleArchive("reexportrequirebundleB",
"/bundles/classloader/reexportrequirebundleB");
- Bundle bundleC = context.installBundle(assemblyC.toURL().toExternalForm());
+ Bundle bundleC = installBundle(assemblyC);
try
{
@@ -276,20 +276,20 @@
public void testNoReExportRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("noreexportrequirebundleA",
"/bundles/classloader/noreexportrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
assertLoadClass(bundleB, A.class.getName(), bundleA);
assertLoadClass(bundleB, B.class.getName(), bundleB);
VirtualFile assemblyC = assembleArchive("reexportrequirebundleB",
"/bundles/classloader/reexportrequirebundleB");
- Bundle bundleC = context.installBundle(assemblyC.toURL().toExternalForm());
+ Bundle bundleC = installBundle(assemblyC);
try
{
assertLoadClassFail(bundleC, A.class.getName());
@@ -315,13 +315,13 @@
public void testAttributeRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("attributerequirebundleA",
"/bundles/classloader/attributerequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -346,7 +346,7 @@
// Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0;test=x
// Bundle-Version: 1.0.0
VirtualFile assemblyA = assembleArchive("bundleA",
"/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -355,7 +355,7 @@
// Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleB
// Require-Bundle:
org.jboss.test.osgi.classloader.bundleA;doesnotexist=true;test=y
VirtualFile assemblyB = assembleArchive("attributerequirebundlefails",
"/bundles/classloader/attributerequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -46,7 +46,7 @@
public void testGetBudleFromClass() throws Exception
{
VirtualFile assemblyA = assembleArchive("smoke-assembled",
"/bundles/smoke/smoke-assembled", PA.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -61,7 +61,7 @@
assertNull(notFound);
VirtualFile assemblyB = assembleArchive("simple",
"/bundles/simple/simple-bundle1", Other.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -55,7 +55,7 @@
public void testGetServiceReferences() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1", A.class);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -175,7 +175,7 @@
private void assertGetServiceReferencesNotAssignable(String className) throws
Exception
{
VirtualFile assemblyA = assembleArchive("simple1",
"/bundles/simple/simple-bundle1", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -193,7 +193,7 @@
assertNotNull(reference1);
VirtualFile assemblyB = assembleArchive("simple2",
"/bundles/simple/simple-bundle2", A.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -277,7 +277,7 @@
private void assertGetServiceReferencesAssignable(String className) throws Exception
{
VirtualFile assemblyA = assembleArchive("service2",
"/bundles/service/service-bundle2", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -295,7 +295,7 @@
assertNotNull(reference1);
VirtualFile assemblyB = assembleArchive("service1",
"/bundles/service/service-bundle1");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -370,7 +370,7 @@
String className = A.class.getName();
VirtualFile assemblyA = assembleArchive("service2",
"/bundles/service/service-bundle2", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -391,7 +391,7 @@
assertNotNull(reference1);
VirtualFile assemblyB = assembleArchive("service1",
"/bundles/service/service-bundle1");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -481,7 +481,7 @@
String wrongClassName = B.class.getName();
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1", A.class);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -48,8 +48,8 @@
@Test
public void testGetUnServiceErrors() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -87,8 +87,8 @@
@Test
public void testGetService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -114,8 +114,8 @@
@Test
public void testGetServiceAfterStop() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -148,8 +148,8 @@
@Test
public void testErrorInGetService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -174,8 +174,8 @@
@Test
public void testErrorInUnGetService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -203,8 +203,8 @@
@Test
public void testUnGetServiceResult() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -222,8 +222,8 @@
assertTrue(bundleContext.ungetService(reference));
assertFalse(bundleContext.ungetService(reference));
- VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2");
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -54,8 +54,8 @@
String OBJCLASS = BundleContext.class.getName();
String[] OBJCLASSES = new String[] { OBJCLASS };
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -189,8 +189,8 @@
Dictionary<String, Object> properties = new Hashtable<String,
Object>();
properties.put(Constants.OBJECTCLASS, new String[] { "rubbish" });
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -220,8 +220,8 @@
@Test
public void testRegisterService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -247,8 +247,8 @@
@Test
public void testBundleUninstall() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -260,8 +260,8 @@
Object actual = bundleContext.getService(reference);
assertEquals(bundleContext, actual);
- VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2");
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -288,8 +288,8 @@
@Test
public void testRegisteredServices() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ VirtualFile assembly1 = assembleArchive("simple-bundle1",
"/bundles/simple/simple-bundle1");
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -301,8 +301,8 @@
Object actual = bundleContext.getService(reference);
assertEquals(bundleContext, actual);
- VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ VirtualFile assembly2 = assembleArchive("simple-bundle2",
"/bundles/simple/simple-bundle2");
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -53,7 +53,7 @@
public void testRegisterServiceFactory() throws Exception
{
VirtualFile assemblyA = assembleArchive("simple1",
"/bundles/simple/simple-bundle1", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -78,7 +78,7 @@
assertEquals(1, serviceFactory.getCount);
VirtualFile assemblyB = assembleArchive("simple2",
"/bundles/simple/simple-bundle2");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -109,7 +109,7 @@
String OBJCLASS = BundleContext.class.getName();
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -140,7 +140,7 @@
String OBJCLASS = BundleContext.class.getName();
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -175,7 +175,7 @@
String[] OBJCLASSES = {String.class.getName(), BundleContext.class.getName()};
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -21,8 +21,11 @@
*/
package org.jboss.test.osgi.service;
+// $Id: $
+
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
@@ -37,6 +40,7 @@
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.osgi.framework.deployers.AbstractDeployment;
import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.service.support.LazyBundle;
import org.jboss.test.osgi.service.support.a.A;
@@ -53,6 +57,7 @@
* Test MC's service mixture.
*
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ * @author Thomas.Diesler(a)jboss.com
*/
public class ServiceMixUnitTestCase extends AbstractServiceMixTest
{
@@ -63,7 +68,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple1",
"/bundles/service/service-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -116,7 +121,7 @@
KernelControllerContext kcc = getControllerContext("C", null);
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle3");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -175,7 +180,7 @@
KernelControllerContext kcc = getControllerContext("C", null);
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle3");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -235,7 +240,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle3");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -290,7 +295,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle4");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -358,7 +363,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle4");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -425,7 +430,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -480,14 +485,11 @@
}
}
- /*
@Test
public void testBeansMix() throws Throwable
{
- AssembledDirectory mix = createAssembledDirectory("beans1",
"");
- addPath(mix, "/bundles/service/service-beans1", "");
- addPackage(mix, A.class);
- Deployment deployment = addDeployment(mix);
+ VirtualFile assembly = assembleArchive("beans1",
"/bundles/service/service-beans1", A.class);
+ Deployment deployment =
addDeployment(AbstractDeployment.createDeployment(assembly));
try
{
checkComplete();
@@ -518,7 +520,7 @@
public void testServiceInjection() throws Throwable
{
VirtualFile assembly1 = assembleArchive("simple2",
"/bundles/service/service-bundle2", A.class);
- Bundle bundle = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly1);
try
{
bundle.start();
@@ -532,10 +534,8 @@
ServiceRegistration reg1 = bundleContext1.registerService(A.class.getName(), a,
table);
assertNotNull(reg1);
- AssembledDirectory mix = createAssembledDirectory("beans1",
"");
- addPath(mix, "/bundles/service/service-beans2", "");
- addPackage(mix, C.class);
- Deployment deployment = assertDeploy(mix);
+ VirtualFile assembly = assembleArchive("beans1",
"/bundles/service/service-beans2", C.class);
+ Deployment deployment =
addDeployment(AbstractDeployment.createDeployment(assembly));
try
{
checkComplete();
@@ -556,5 +556,4 @@
bundle.uninstall();
}
}
- */
}
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -57,7 +57,7 @@
Object serviceID = null;
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -156,7 +156,7 @@
ServiceReference reference = null;
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -216,7 +216,7 @@
public void testGetBundle() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -247,7 +247,7 @@
public void testGetBundleAfterStop() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -278,7 +278,7 @@
public void testUsingBundles() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -294,7 +294,7 @@
assertUsingBundles(reference);
VirtualFile assembly2 = assembleArchive("simple2",
"/bundles/simple/simple-bundle2");
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -337,7 +337,7 @@
public void testUsingBundlesAfterStop() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -353,7 +353,7 @@
assertUsingBundles(reference);
VirtualFile assembly2 = assembleArchive("simple2",
"/bundles/simple/simple-bundle2");
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -382,7 +382,7 @@
public void testIsAssignableToErrors() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1", A.class);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -425,7 +425,7 @@
public void testNotAssignableTo() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1",
"/bundles/simple/simple-bundle1", A.class);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -439,7 +439,7 @@
assertNotNull(reference);
VirtualFile assembly2 = assembleArchive("simple2",
"/bundles/simple/simple-bundle2", A.class);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
assertFalse(reference.isAssignableTo(bundle2, A.class.getName()));
@@ -467,7 +467,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.service2
//Export-Package: org.jboss.test.osgi.service.support.a
VirtualFile assembly2 = assembleArchive("service2",
"/bundles/service/service-bundle2", A.class);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
@@ -479,7 +479,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.service1
//Import-Package: org.jboss.test.osgi.service.support.a
VirtualFile assembly1 = assembleArchive("service1",
"/bundles/service/service-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
@@ -516,7 +516,7 @@
public void testCompareTo() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java 2010-03-10
21:07:21 UTC (rev 102245)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java 2010-03-10
21:38:44 UTC (rev 102246)
@@ -54,7 +54,7 @@
public void testGetReference() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -116,7 +116,7 @@
public void testSetProperties() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -225,7 +225,7 @@
public void testSetPropertiesAfterStop() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -258,7 +258,7 @@
public void testUnregister() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -283,7 +283,7 @@
assertArrayEquals(new ServiceReference[] { reference }, inUse);
VirtualFile assembly2 = assembleArchive("simple2",
"/bundles/simple/simple-bundle2");
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -341,7 +341,7 @@
public void testUnregisterAfterStop() throws Exception
{
VirtualFile assembly = assembleArchive("simple1",
"/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();