Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-09-21 10:34:13 -0400
committerGlyn Normington2012-09-21 10:34:13 -0400
commit48109d3c0e6ecd29d9e9ec1dbf13e3cc5433869f (patch)
treee06674643c42e41480b177a4bae3e090db4462e9
parentc3e3078282bd77d626466c450c87bd2b9b8eebc1 (diff)
parentb0f0adf9993d458148ed90da8ed88ed473b67ae7 (diff)
downloadorg.eclipse.virgo.kernel-48109d3c0e6ecd29d9e9ec1dbf13e3cc5433869f.tar.gz
org.eclipse.virgo.kernel-48109d3c0e6ecd29d9e9ec1dbf13e3cc5433869f.tar.xz
org.eclipse.virgo.kernel-48109d3c0e6ecd29d9e9ec1dbf13e3cc5433869f.zip
Merge branch 'master' of ssh://git.eclipse.org/gitroot/virgo/org.eclipse.virgo.kernel
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundle.java13
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackage.java46
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java16
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackage.java8
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundle.java6
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundleTests.java24
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackageTests.java8
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackageTests.java5
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundleTests.java18
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StubStateHelper.java118
-rw-r--r--org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/internal/AdminHttpContext.java2
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/web.xml2
12 files changed, 48 insertions, 218 deletions
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundle.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundle.java
index b5fe0ca6..ed0744df 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundle.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundle.java
@@ -62,8 +62,6 @@ final class StandardQuasiBundle implements QuasiBundle {
private Version bv;
- private final StateHelper stateHelper;
-
private final Region region;
private volatile Provisioning provisioning = Provisioning.AUTO;
@@ -73,15 +71,14 @@ final class StandardQuasiBundle implements QuasiBundle {
*
* @param bundleDescription the <code>BundleDescription</code> for this <code>QuasiBundle</code>
* @param bundleManifest
- * @param stateHelper a {@link StateHelper} for analysing wiring
+ * @param region the <code>Region</code> this bundle belongs to
*/
- public StandardQuasiBundle(BundleDescription bundleDescription, BundleManifest bundleManifest, Region region, StateHelper stateHelper) {
+ public StandardQuasiBundle(BundleDescription bundleDescription, BundleManifest bundleManifest, Region region) {
this.bundleDescription = bundleDescription;
this.bundleManifest = bundleManifest;
this.region = region;
this.bsn = bundleDescription.getSymbolicName();
this.bv = bundleDescription.getVersion();
- this.stateHelper = stateHelper;
}
BundleDescription getBundleDescription() {
@@ -225,7 +222,7 @@ final class StandardQuasiBundle implements QuasiBundle {
List<QuasiBundle> quasiBundles = new ArrayList<QuasiBundle>();
for (BundleDescription bundleDescription : bundleDescriptions) {
Region bundleRegion = this.region.getRegionDigraph().getRegion(bundleDescription.getBundleId());
- quasiBundles.add(new StandardQuasiBundle(bundleDescription, null, bundleRegion, this.stateHelper));
+ quasiBundles.add(new StandardQuasiBundle(bundleDescription, null, bundleRegion));
}
return Collections.unmodifiableList(quasiBundles);
}
@@ -318,10 +315,6 @@ final class StandardQuasiBundle implements QuasiBundle {
return true;
}
- public StateHelper getStateHelper() {
- return this.stateHelper;
- }
-
public File getBundleFile() {
if (bundle instanceof BundleHost) {
BundleHost bh = (BundleHost) bundle;
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackage.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackage.java
index dcbcf617..e42bf22e 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackage.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackage.java
@@ -18,12 +18,11 @@ import org.eclipse.equinox.region.Region;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.ExportPackageDescription;
import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
-import org.eclipse.osgi.service.resolver.StateHelper;
-import org.osgi.framework.Version;
-
import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiExportPackage;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiImportPackage;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
+import org.osgi.framework.Version;
/**
* {@link StandardQuasiExportPackage} is the default implementation of {@link QuasiExportPackage}.
@@ -46,10 +45,6 @@ public class StandardQuasiExportPackage extends StandardQuasiParameterised imple
this.exporter = exporter;
}
- private StateHelper getStateHelper() {
- return ((StandardQuasiBundle) exporter).getStateHelper();
- }
-
/**
* {@inheritDoc}
*/
@@ -76,43 +71,30 @@ public class StandardQuasiExportPackage extends StandardQuasiParameterised imple
*/
public List<QuasiImportPackage> getConsumers() {
List<QuasiImportPackage> consumers = new ArrayList<QuasiImportPackage>();
- StateHelper stateHelper = getStateHelper();
- for (BundleDescription dependentBundle : getDependentBundles(stateHelper)) {
- if (isConsumer(dependentBundle)) {
- addConsumer(dependentBundle, consumers, stateHelper);
+ BundleDescription[] dependents = this.exportPackageDescription.getExporter().getDependents();
+ for (BundleDescription dependentBundle : dependents) {
+ ImportPackageSpecification importPackageSpecification = findImportingPackageSpecification(dependentBundle);
+ if(importPackageSpecification != null){
+ addConsumer(dependentBundle, importPackageSpecification, consumers);
}
}
return consumers;
}
- private BundleDescription[] getDependentBundles(StateHelper stateHelper) {
- return stateHelper.getDependentBundles(new BundleDescription[] { this.exportPackageDescription.getExporter() });
- }
-
- private boolean isConsumer(BundleDescription dependentBundle) {
+ private ImportPackageSpecification findImportingPackageSpecification(BundleDescription dependentBundle) {
ImportPackageSpecification[] importedPackages = dependentBundle.getImportPackages();
-
for (ImportPackageSpecification importedPackage : importedPackages) {
if (this.exportPackageDescription.equals(importedPackage.getSupplier())) {
- return true;
- }
- }
- return false;
- }
-
- private void addConsumer(BundleDescription dependentBundle, List<QuasiImportPackage> consumers, StateHelper stateHelper) {
- ImportPackageSpecification[] dependentImportPackages = dependentBundle.getImportPackages();
- for (ImportPackageSpecification dependentImportPackage : dependentImportPackages) {
- if (matches(dependentImportPackage, this.exportPackageDescription)) {
- Region region = this.exporter.getRegion().getRegionDigraph().getRegion(dependentBundle.getBundleId());
- consumers.add(new StandardQuasiImportPackage(dependentImportPackage, new StandardQuasiBundle(dependentBundle, null, region, stateHelper)));
- break;
+ return importedPackage;
}
}
+ return null;
}
- private boolean matches(ImportPackageSpecification i, ExportPackageDescription e) {
- return i.isSatisfiedBy(e);
+ private void addConsumer(BundleDescription dependentBundle, ImportPackageSpecification dependentImportPackage, List<QuasiImportPackage> consumers) {
+ Region region = this.exporter.getRegion().getRegionDigraph().getRegion(dependentBundle.getBundleId());
+ StandardQuasiBundle importingBundle = new StandardQuasiBundle(dependentBundle, null, region);
+ consumers.add(new StandardQuasiImportPackage(dependentImportPackage, importingBundle));
}
/**
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java
index d7b4e24c..d10d1c6d 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java
@@ -32,11 +32,9 @@ import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.eclipse.osgi.service.resolver.ResolverError;
import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.osgi.service.resolver.StateHelper;
import org.eclipse.osgi.service.resolver.StateObjectFactory;
import org.eclipse.osgi.service.resolver.VersionConstraint;
import org.eclipse.virgo.kernel.artifact.plan.PlanDescriptor.Provisioning;
-import org.eclipse.virgo.nano.core.FatalKernelException;
import org.eclipse.virgo.kernel.osgi.framework.ManifestTransformer;
import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyDependenciesException;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
@@ -44,10 +42,11 @@ import org.eclipse.virgo.kernel.osgi.quasi.QuasiFramework;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiResolutionFailure;
import org.eclipse.virgo.kernel.userregion.internal.equinox.TransformedManifestProvidingBundleFileWrapper;
import org.eclipse.virgo.kernel.userregion.internal.quasi.ResolutionFailureDetective.ResolverErrorsHolder;
+import org.eclipse.virgo.nano.core.FatalKernelException;
import org.eclipse.virgo.repository.Repository;
import org.eclipse.virgo.util.common.StringUtils;
-import org.eclipse.virgo.util.osgi.manifest.VersionRange;
import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
+import org.eclipse.virgo.util.osgi.manifest.VersionRange;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -100,8 +99,6 @@ final class StandardQuasiFramework implements QuasiFramework {
private final DependencyCalculator dependencyCalculator;
- private final StateHelper stateHelper;
-
private final TransformedManifestProvidingBundleFileWrapper bundleTransformationHandler;
private final RegionDigraph regionDigraph;
@@ -117,7 +114,6 @@ final class StandardQuasiFramework implements QuasiFramework {
this.state = state;
this.stateObjectFactory = platformAdmin.getFactory();
this.detective = detective;
- this.stateHelper = platformAdmin.getStateHelper();
this.bundleTransformationHandler = bundleTransformationHandler;
this.regionDigraph = regionDigraph;
this.userRegion = regionDigraph.getRegion("org.eclipse.virgo.region.user");
@@ -171,7 +167,7 @@ final class StandardQuasiFramework implements QuasiFramework {
BundleDescription bundleDescription = this.stateObjectFactory.createBundleDescription(this.state, manifest, this.coregion.getName() + REGION_LOCATION_DELIMITER + installLocation, nextBundleId());
this.state.addBundle(bundleDescription);
this.coregion.addBundle(bundleDescription.getBundleId());
- return new StandardQuasiBundle(bundleDescription, bundleManifest, this.regionDigraph.getRegion(bundleDescription.getBundleId()), this.stateHelper);
+ return new StandardQuasiBundle(bundleDescription, bundleManifest, this.regionDigraph.getRegion(bundleDescription.getBundleId()));
} catch (RuntimeException e) {
throw new BundleException("Unable to read bundle at '" + location + "'", e);
}
@@ -192,7 +188,7 @@ final class StandardQuasiFramework implements QuasiFramework {
List<QuasiBundle> result = new ArrayList<QuasiBundle>();
QuasiBundle quasiBundle;
for (BundleDescription bundleDescription : bundleDescriptions) {
- quasiBundle = new StandardQuasiBundle(bundleDescription, null, this.regionDigraph.getRegion(bundleDescription.getBundleId()), this.stateHelper);
+ quasiBundle = new StandardQuasiBundle(bundleDescription, null, this.regionDigraph.getRegion(bundleDescription.getBundleId()));
result.add(quasiBundle);
}
return Collections.unmodifiableList(result);
@@ -205,7 +201,7 @@ final class StandardQuasiFramework implements QuasiFramework {
QuasiBundle quasiBundle = null;
BundleDescription bundleDescription = this.state.getBundle(bundleId);
if (bundleDescription != null) {
- quasiBundle = new StandardQuasiBundle(bundleDescription, null, this.regionDigraph.getRegion(bundleId), this.stateHelper);
+ quasiBundle = new StandardQuasiBundle(bundleDescription, null, this.regionDigraph.getRegion(bundleId));
}
return quasiBundle;
}
@@ -244,7 +240,7 @@ final class StandardQuasiFramework implements QuasiFramework {
BundleDescription bundleDescription = this.state.getBundle(bundleId);
ResolverErrorsHolder reh = new ResolverErrorsHolder();
String failureDescription = this.detective.generateFailureDescription(this.state, bundleDescription, reh);
- return this.processResolverErrors(reh.getResolverErrors(), new StandardQuasiBundle(bundleDescription, null, this.regionDigraph.getRegion(bundleId), this.stateHelper), failureDescription);
+ return this.processResolverErrors(reh.getResolverErrors(), new StandardQuasiBundle(bundleDescription, null, this.regionDigraph.getRegion(bundleId)), failureDescription);
}
private BundleDescription[] getDependencies(BundleDescription[] bundles, BundleDescription[] disabledProvisioningBundles) {
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackage.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackage.java
index 1bfb7a62..1db57f46 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackage.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackage.java
@@ -19,8 +19,6 @@ import org.eclipse.osgi.service.resolver.BaseDescription;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.ExportPackageDescription;
import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
-import org.eclipse.osgi.service.resolver.StateHelper;
-
import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiExportPackage;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiImportPackage;
@@ -47,10 +45,6 @@ public class StandardQuasiImportPackage extends StandardQuasiParameterised imple
this.importingBundle = importingBundle;
}
- private StateHelper getStateHelper() {
- return ((StandardQuasiBundle) importingBundle).getStateHelper();
- }
-
/**
* {@inheritDoc}
*/
@@ -103,7 +97,7 @@ public class StandardQuasiImportPackage extends StandardQuasiParameterised imple
private QuasiExportPackage constructProvider(ExportPackageDescription providerDescription) {
BundleDescription exporter = providerDescription.getExporter();
- StandardQuasiBundle quasiExporter = new StandardQuasiBundle(exporter, null, this.importingBundle.getRegion().getRegionDigraph().getRegion(exporter.getBundleId()), getStateHelper());
+ StandardQuasiBundle quasiExporter = new StandardQuasiBundle(exporter, null, this.importingBundle.getRegion().getRegionDigraph().getRegion(exporter.getBundleId()));
return new StandardQuasiExportPackage(providerDescription, quasiExporter);
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundle.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundle.java
index 1d831559..66fed50d 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundle.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundle.java
@@ -42,10 +42,6 @@ final class StandardQuasiRequiredBundle implements QuasiRequiredBundle {
this.bundleSpecification = bundleSpecification;
this.requiringBundle = requiringBundle;
}
-
- private StateHelper getStateHelper() {
- return ((StandardQuasiBundle) requiringBundle).getStateHelper();
- }
/**
* {@inheritDoc}
@@ -81,7 +77,7 @@ final class StandardQuasiRequiredBundle implements QuasiRequiredBundle {
public QuasiBundle getProvider() {
if (isResolved()) {
BundleDescription supplier = this.bundleSpecification.getSupplier().getSupplier();
- return new StandardQuasiBundle(supplier, null, this.requiringBundle.getRegion().getRegionDigraph().getRegion(supplier.getBundleId()), getStateHelper());
+ return new StandardQuasiBundle(supplier, null, this.requiringBundle.getRegion().getRegionDigraph().getRegion(supplier.getBundleId()));
} else {
return null;
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundleTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundleTests.java
index 88d96e1f..8db4edc9 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundleTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiBundleTests.java
@@ -48,28 +48,28 @@ public class StandardQuasiBundleTests {
@Test
public void testSymbolicName() {
bundleDescription.setBundleSymbolicName(BSN);
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
Assert.assertEquals(BSN, qb.getSymbolicName());
}
@Test
public void testVersion() {
bundleDescription.setVersion(BV);
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
Assert.assertEquals(BV, qb.getVersion());
}
@Test
public void testIsResolved() {
bundleDescription.setResolved(true);
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
Assert.assertEquals(true, qb.isResolved());
}
@Test
public void testBundleId() {
bundleDescription.setBundleId(BID);
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
Assert.assertEquals(BID, qb.getBundleId());
}
@@ -77,7 +77,7 @@ public class StandardQuasiBundleTests {
public void testFragments() {
bundleDescription.addFragment(new StubBundleDescription("f1"));
bundleDescription.addFragment(new StubBundleDescription("f2"));
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, this.stubRegion, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, this.stubRegion);
List<QuasiBundle> fragments = qb.getFragments();
Assert.assertEquals(2, fragments.size());
Assert.assertEquals("f1", fragments.get(0).getSymbolicName());
@@ -86,7 +86,7 @@ public class StandardQuasiBundleTests {
@Test
public void testNoFragments() {
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
List<QuasiBundle> fragments = qb.getFragments();
Assert.assertEquals(0, fragments.size());
}
@@ -95,7 +95,7 @@ public class StandardQuasiBundleTests {
public void testHosts() {
bundleDescription.addHost(new StubBundleDescription("h1"));
bundleDescription.addHost(new StubBundleDescription("h2"));
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, this.stubRegion, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, this.stubRegion);
List<QuasiBundle> hosts = qb.getHosts();
Assert.assertEquals(2, hosts.size());
Assert.assertEquals("h1", hosts.get(0).getSymbolicName());
@@ -104,7 +104,7 @@ public class StandardQuasiBundleTests {
@Test
public void testNoHosts() {
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
List<QuasiBundle> hosts = qb.getHosts();
Assert.assertNull(hosts);
}
@@ -113,7 +113,7 @@ public class StandardQuasiBundleTests {
public void testExportPackages() {
bundleDescription.addExportPackage(new StubExportPackageDescription("e1"));
bundleDescription.addExportPackage(new StubExportPackageDescription("e2"));
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
List<QuasiExportPackage> exportPackages = qb.getExportPackages();
Assert.assertEquals(2, exportPackages.size());
Assert.assertEquals("e1", exportPackages.get(0).getPackageName());
@@ -124,7 +124,7 @@ public class StandardQuasiBundleTests {
public void testImportPackages() {
bundleDescription.addImportPackage(new StubImportPackageSpecification("i1"));
bundleDescription.addImportPackage(new StubImportPackageSpecification("i2"));
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
List<QuasiImportPackage> importPackages = qb.getImportPackages();
Assert.assertEquals(2, importPackages.size());
Assert.assertEquals("i1", importPackages.get(0).getPackageName());
@@ -135,7 +135,7 @@ public class StandardQuasiBundleTests {
public void testRequiredBundles() {
bundleDescription.addRequiredBundle(new StubBundleSpecification("b1"));
bundleDescription.addRequiredBundle(new StubBundleSpecification("b2"));
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, null);
List<QuasiRequiredBundle> requiredBundles = qb.getRequiredBundles();
Assert.assertEquals(2, requiredBundles.size());
Assert.assertEquals("b1", requiredBundles.get(0).getRequiredBundleName());
@@ -146,7 +146,7 @@ public class StandardQuasiBundleTests {
public void testDependents() {
bundleDescription.addDependent(new StubBundleDescription("b1"));
bundleDescription.addDependent(new StubBundleDescription("b2"));
- QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, this.stubRegion, null);
+ QuasiBundle qb = new StandardQuasiBundle(bundleDescription, null, this.stubRegion);
List<QuasiBundle> requiredBundles = qb.getDependents();
Assert.assertEquals(2, requiredBundles.size());
Assert.assertEquals("b1", requiredBundles.get(0).getSymbolicName());
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackageTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackageTests.java
index 21ffb431..aae1d871 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackageTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiExportPackageTests.java
@@ -14,7 +14,6 @@ package org.eclipse.virgo.kernel.userregion.internal.quasi;
import java.util.List;
import org.eclipse.equinox.region.Region;
-import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiExportPackage;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiImportPackage;
@@ -41,17 +40,14 @@ public class StandardQuasiExportPackageTests {
private QuasiBundle qb;
- private StubStateHelper stateHelper;
-
private Region stubRegion;
@Before
public void setUp() throws BundleException {
this.bundleDescription = new StubBundleDescription();
this.bundleDescription.setBundleSymbolicName(BSN);
- this.stateHelper = new StubStateHelper();
this.stubRegion = new StubRegionDigraph().createRegion("testRegion");
- this.qb = new StandardQuasiBundle(this.bundleDescription, null, this.stubRegion, this.stateHelper);
+ this.qb = new StandardQuasiBundle(this.bundleDescription, null, this.stubRegion);
this.exportPackage = new StubExportPackageDescription(PN);
}
@@ -80,7 +76,7 @@ public class StandardQuasiExportPackageTests {
StubImportPackageSpecification ips = new StubImportPackageSpecification(PN);
dependentBundle.addImportPackage(ips);
ips.setSupplier(this.exportPackage);
- this.stateHelper.setDependentBundles(new BundleDescription[] { dependentBundle });
+ this.bundleDescription.addDependent(dependentBundle);
this.exportPackage.setExporter(this.bundleDescription);
QuasiExportPackage qep = new StandardQuasiExportPackage(this.exportPackage, this.qb);
List<QuasiImportPackage> consumers = qep.getConsumers();
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackageTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackageTests.java
index a50a771c..dd5b7cd0 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackageTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiImportPackageTests.java
@@ -45,8 +45,6 @@ public class StandardQuasiImportPackageTests {
private QuasiBundle qb;
- private StubStateHelper stateHelper;
-
private StubExportPackageDescription exportPackage;
private Region stubRegion;
@@ -56,8 +54,7 @@ public class StandardQuasiImportPackageTests {
this.bundleDescription = new StubBundleDescription();
this.bundleDescription.setBundleSymbolicName(BSN);
this.stubRegion = new StubRegionDigraph().createRegion("testRegion");
- this.stateHelper = new StubStateHelper();
- this.qb = new StandardQuasiBundle(this.bundleDescription, null, this.stubRegion, this.stateHelper);
+ this.qb = new StandardQuasiBundle(this.bundleDescription, null, this.stubRegion);
this.importPackage = new StubImportPackageSpecification(PN);
this.exportPackage = new StubExportPackageDescription(PN);
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundleTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundleTests.java
index cae0a28b..47da70df 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundleTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiRequiredBundleTests.java
@@ -11,18 +11,15 @@
package org.eclipse.virgo.kernel.userregion.internal.quasi;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.BundleException;
-
import org.eclipse.equinox.region.Region;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
import org.eclipse.virgo.kernel.osgi.quasi.QuasiRequiredBundle;
-import org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiBundle;
-import org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiRequiredBundle;
import org.eclipse.virgo.test.stubs.region.StubRegionDigraph;
import org.eclipse.virgo.util.osgi.manifest.VersionRange;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
/**
*/
@@ -42,8 +39,6 @@ public class StandardQuasiRequiredBundleTests {
private QuasiBundle qb;
- private StubStateHelper stateHelper;
-
private StubBundleSpecification bundleSpecification;
private Region stubRegion;
@@ -53,9 +48,8 @@ public class StandardQuasiRequiredBundleTests {
this.bundleDescription = new StubBundleDescription();
this.bundleDescription.setBundleSymbolicName(BSN);
this.bundleSpecification = new StubBundleSpecification(REQUIRED_BSN);
- this.stateHelper = new StubStateHelper();
this.stubRegion = new StubRegionDigraph().createRegion("testRegion");
- this.qb = new StandardQuasiBundle(this.bundleDescription, null, this.stubRegion, this.stateHelper);
+ this.qb = new StandardQuasiBundle(this.bundleDescription, null, this.stubRegion);
}
@Test
@@ -94,7 +88,7 @@ public class StandardQuasiRequiredBundleTests {
public void testResolvedProvider() {
StubBundleDescription requiredBundleDescription = new StubBundleDescription();
requiredBundleDescription.setBundleSymbolicName(REQUIRED_BSN);
- QuasiBundle rqb = new StandardQuasiBundle(requiredBundleDescription, null, null, this.stateHelper);
+ QuasiBundle rqb = new StandardQuasiBundle(requiredBundleDescription, null, null);
QuasiRequiredBundle qrb = new StandardQuasiRequiredBundle(this.bundleSpecification, this.qb);
this.bundleSpecification.setResolved(true);
StubBaseDescription supplier = new StubBaseDescription();
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StubStateHelper.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StubStateHelper.java
deleted file mode 100644
index 9b4fdae5..00000000
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StubStateHelper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package org.eclipse.virgo.kernel.userregion.internal.quasi;
-
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
-import org.eclipse.osgi.service.resolver.StateHelper;
-import org.eclipse.osgi.service.resolver.VersionConstraint;
-
-/**
- */
-public class StubStateHelper implements StateHelper {
-
- private BundleDescription[] dependentBundles;
-
- private ExportPackageDescription[] visiblePackages;
-
- /**
- * {@inheritDoc}
- */
- public int getAccessCode(BundleDescription bundle, ExportPackageDescription export) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- */
- public BundleDescription[] getDependentBundles(BundleDescription[] bundles) {
- return this.dependentBundles;
-
- }
-
- /**
- * {@inheritDoc}
- */
- public BundleDescription[] getPrerequisites(BundleDescription[] bundles) {
- throw new UnsupportedOperationException();
-
- }
-
- /**
- * {@inheritDoc}
- */
- public VersionConstraint[] getUnsatisfiedConstraints(BundleDescription bundle) {
- throw new UnsupportedOperationException();
-
- }
-
- /**
- * {@inheritDoc}
- */
- public VersionConstraint[] getUnsatisfiedLeaves(BundleDescription[] bundles) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- */
- public ExportPackageDescription[] getVisiblePackages(BundleDescription bundle) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- */
- public ExportPackageDescription[] getVisiblePackages(BundleDescription bundle, int options) {
- return this.visiblePackages;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isResolvable(ImportPackageSpecification specification) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isResolvable(BundleSpecification specification) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isResolvable(HostSpecification specification) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[][] sortBundles(BundleDescription[] toSort) {
- throw new UnsupportedOperationException();
- }
-
- public void setDependentBundles(BundleDescription[] dependentBundles) {
- this.dependentBundles = dependentBundles;
- }
-
- public void setVisiblePackages(ExportPackageDescription[] visiblePackages) {
- this.visiblePackages = visiblePackages;
- }
-
-}
diff --git a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/internal/AdminHttpContext.java b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/internal/AdminHttpContext.java
index 9054289d..ab662578 100644
--- a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/internal/AdminHttpContext.java
+++ b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/internal/AdminHttpContext.java
@@ -36,7 +36,7 @@ import org.osgi.service.http.HttpContext;
*/
public class AdminHttpContext implements HttpContext {
- private static final String REALM = "Virgo Server Admin Console";
+ private static final String REALM = "Virgo Admin Console";
private final Bundle bundle;
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/web.xml b/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/web.xml
index 2db5c3ad..9eeaf1cc 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/web.xml
+++ b/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/web.xml
@@ -81,7 +81,7 @@
<login-config>
<auth-method>BASIC</auth-method>
- <realm-name>Virgo Server Admin Console</realm-name>
+ <realm-name>Virgo Admin Console</realm-name>
</login-config>
<security-role>

Back to the top