Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build-kernel/config/org.eclipse.virgo.kernel.userregion.properties2
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties5
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifact.java4
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/BundleArtifact.java6
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/AbstractArtifact.java2
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleDependencyDeterminer.java2
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListener.java8
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListenerInitializer.java2
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/NativeBundleArtifact.java (renamed from org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifact.java)21
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerArtifact.java2
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerBundleArtifact.java14
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/ManageableBundleArtifact.java6
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java10
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableBundleArtifact.java7
-rw-r--r--org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifactTests.java8
-rw-r--r--org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifactTests.java9
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties2
17 files changed, 67 insertions, 43 deletions
diff --git a/build-kernel/config/org.eclipse.virgo.kernel.userregion.properties b/build-kernel/config/org.eclipse.virgo.kernel.userregion.properties
index 502a9c5d..ae2d0cf6 100644
--- a/build-kernel/config/org.eclipse.virgo.kernel.userregion.properties
+++ b/build-kernel/config/org.eclipse.virgo.kernel.userregion.properties
@@ -30,7 +30,9 @@ packageImports =\
org.osgi.service.cm;version="0",\
org.osgi.service.event;version="0",\
org.eclipse.equinox.region;version="1",\
+ ch.qos.logback.*;version="[0.9.24,1.0.0)",\
org.slf4j;version="[1.6.1,2)",\
+ org.slf4j.helpers;version="[1.6.1,2)",\
org.slf4j.spi;version="[1.6.1,2)"
serviceImports =\
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
index c211e3c0..58ab6711 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
@@ -50,7 +50,10 @@ packageImports =\
org.osgi.service.cm;version="0",\
org.osgi.service.event;version="0",\
org.eclipse.equinox.region;version="1",\
- org.slf4j;version="[1.6.1,2)"
+ ch.qos.logback.*;version="[0.9.24,1.0.0)",\
+ org.slf4j;version="[1.6.1,2)",\
+ org.slf4j.helpers;version="[1.6.1,2)",\
+ org.slf4j.spi;version="[1.6.1,2)"
serviceImports =\
org.eclipse.equinox.region.Region,\
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifact.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifact.java
index 1a57c902..582a18e3 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifact.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifact.java
@@ -69,6 +69,8 @@ final class StandardBundleInstallArtifact extends AbstractInstallArtifact implem
private static final String EQUINOX_SYSTEM_BUNDLE_NAME = "org.eclipse.osgi";
+ private static final String RESERVED_SYSTEM_BUNDLE_NAME = "system.bundle";
+
private static final long REFRESH_RESTART_WAIT_PERIOD = 60;
private final Object monitor = new Object();
@@ -239,7 +241,7 @@ final class StandardBundleInstallArtifact extends AbstractInstallArtifact implem
private boolean isFragmentOnSystemBundle() {
String fragmentHost = this.bundleManifest.getFragmentHost().getBundleSymbolicName();
if (fragmentHost != null) {
- return fragmentHost.equals(EQUINOX_SYSTEM_BUNDLE_NAME);
+ return fragmentHost.equals(EQUINOX_SYSTEM_BUNDLE_NAME) || fragmentHost.equals(RESERVED_SYSTEM_BUNDLE_NAME);
}
return false;
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/BundleArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/BundleArtifact.java
index 6c373cd2..3dac3538 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/BundleArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/BundleArtifact.java
@@ -40,11 +40,5 @@ public interface BundleArtifact extends Artifact {
*/
void deleteEntry(String targetPath);
- /**
- * Gets the id of this bundle
- *
- * @return long id of this bundle
- */
- long getBundleId();
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/AbstractArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/AbstractArtifact.java
index c9be1c91..fc391d03 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/AbstractArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/AbstractArtifact.java
@@ -97,7 +97,7 @@ public abstract class AbstractArtifact implements Artifact {
* {@inheritDoc}
*/
@Override
- public Region getRegion() {
+ public final Region getRegion() {
return this.region;
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleDependencyDeterminer.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleDependencyDeterminer.java
index de2a1526..98a618a5 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleDependencyDeterminer.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleDependencyDeterminer.java
@@ -68,7 +68,7 @@ public final class BundleDependencyDeterminer implements DependencyDeterminer {
QuasiExportPackage provider = importPackage.getProvider();
if (provider != null) {
QuasiBundle bundle = provider.getExportingBundle();
- Artifact artifact = artifactRepository.getArtifact(BundleArtifact.TYPE, bundle.getSymbolicName(), bundle.getVersion(), this.regionDigraph.getRegion(bundle.getBundleId()));
+ Artifact artifact = artifactRepository.getArtifact(NativeBundleArtifact.TYPE, bundle.getSymbolicName(), bundle.getVersion(), this.regionDigraph.getRegion(bundle.getBundleId()));
artifacts.add(artifact);
}
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListener.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListener.java
index 0be0e3b0..8e3d1b8e 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListener.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListener.java
@@ -71,17 +71,17 @@ final class ModelBundleListener implements SynchronousBundleListener {
Bundle bundle = event.getBundle();
Region region = this.regionDigraph.getRegion(bundle);
logger.info("Processing installed event for bundle '{}:{}' in region '{}'", new Object[] {bundle.getSymbolicName(), bundle.getVersion().toString(), region.getName()});
- this.artifactRepository.add(new BundleArtifact(bundleContext, packageAdminUtil, bundle, region));
+ this.artifactRepository.add(new NativeBundleArtifact(bundleContext, packageAdminUtil, bundle, region));
}
private void processUninstalled(BundleEvent event) {
Bundle bundle = event.getBundle();
for (Artifact artifact : this.artifactRepository.getArtifacts()) {
- if (artifact.getType().equals(BundleArtifact.TYPE) &&
+ if (artifact.getType().equals(NativeBundleArtifact.TYPE) &&
artifact.getName().equals(bundle.getSymbolicName()) &&
artifact.getVersion().equals(bundle.getVersion()) ){
- if(artifact instanceof BundleArtifact){
- BundleArtifact bundleArtifact = (BundleArtifact) artifact;
+ if(artifact instanceof NativeBundleArtifact){
+ NativeBundleArtifact bundleArtifact = (NativeBundleArtifact) artifact;
if(ArtifactState.UNINSTALLED == bundleArtifact.getState()){
this.artifactRepository.remove(bundleArtifact);
logger.info("Processing uninstalled event for bundle '{}:{}' from region '{}'", new Object[] {bundleArtifact.getName(), bundleArtifact.getVersion().toString(), bundleArtifact.getRegion().getName()});
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListenerInitializer.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListenerInitializer.java
index d40cda1a..012525a5 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListenerInitializer.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/ModelBundleListenerInitializer.java
@@ -69,7 +69,7 @@ public final class ModelBundleListenerInitializer {
// Find bundles that the listener has almost certainly missed.
for (Bundle bundle : systemBundleContext.getBundles()) {
try {
- this.artifactRepository.add(new BundleArtifact(this.kernelBundleContext, this.packageAdminUtil, bundle, this.regionDigraph.getRegion(bundle)));
+ this.artifactRepository.add(new NativeBundleArtifact(this.kernelBundleContext, this.packageAdminUtil, bundle, this.regionDigraph.getRegion(bundle)));
} catch (Exception e) {
this.logger.error(String.format("Exception adding bundle '%s:%s' to the repository", bundle.getSymbolicName(),
bundle.getVersion().toString()), e);
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/NativeBundleArtifact.java
index a5786f18..30f64f3f 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/bundle/NativeBundleArtifact.java
@@ -11,6 +11,10 @@
package org.eclipse.virgo.kernel.model.internal.bundle;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import org.eclipse.equinox.region.Region;
import org.eclipse.virgo.kernel.model.Artifact;
import org.eclipse.virgo.kernel.model.ArtifactState;
@@ -24,7 +28,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Implementation of {@link Artifact} that delegates to an OSGi native bundle
+ * Implementation of {@link Artifact} that delegates to an OSGi native bundle, this is in comparison
+ * to a {@link DeployerBundleArtifact} which delegates to a Kernel {@link InstallArtifact}.
* <p />
*
* <strong>Concurrent Semantics</strong><br />
@@ -32,7 +37,7 @@ import org.slf4j.LoggerFactory;
* Threadsafe
*
*/
-final class BundleArtifact extends AbstractArtifact {
+final class NativeBundleArtifact extends AbstractArtifact {
static final String TYPE = "bundle";
@@ -42,7 +47,7 @@ final class BundleArtifact extends AbstractArtifact {
private final Bundle bundle;
- public BundleArtifact(@NonNull BundleContext bundleContext, @NonNull PackageAdminUtil packageAdminUtil, @NonNull Bundle bundle, @NonNull Region region) {
+ public NativeBundleArtifact(@NonNull BundleContext bundleContext, @NonNull PackageAdminUtil packageAdminUtil, @NonNull Bundle bundle, @NonNull Region region) {
super(bundleContext, TYPE, bundle.getSymbolicName(), bundle.getVersion(), region);
this.packageAdminUtil = packageAdminUtil;
this.bundle = bundle;
@@ -58,6 +63,16 @@ final class BundleArtifact extends AbstractArtifact {
/**
* {@inheritDoc}
*/
+ public Map<String, String> getProperties() {
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put("BundleId", String.valueOf(this.bundle.getBundleId()));
+ properties.put("Location", this.bundle.getLocation());
+ return Collections.unmodifiableMap(properties);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public boolean refresh() {
try {
this.bundle.update();
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerArtifact.java
index b2fcf8ff..1aecd733 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerArtifact.java
@@ -113,7 +113,7 @@ class DeployerArtifact extends AbstractArtifact {
/**
* {@inheritDoc}
*/
- public final Map<String, String> getProperties() {
+ public Map<String, String> getProperties() {
Set<String> propertyNames = this.installArtifact.getPropertyNames();
Map<String, String> result = new HashMap<String, String>(propertyNames.size());
for (String propertyName : propertyNames) {
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerBundleArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerBundleArtifact.java
index c200881c..9cd55072 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerBundleArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerBundleArtifact.java
@@ -12,6 +12,9 @@
package org.eclipse.virgo.kernel.model.internal.deployer;
import java.net.URI;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.equinox.region.Region;
import org.eclipse.virgo.kernel.install.artifact.BundleInstallArtifact;
@@ -45,8 +48,13 @@ final class DeployerBundleArtifact extends DeployerArtifact implements BundleArt
/**
* {@inheritDoc}
*/
- public long getBundleId() {
- return this.installArtifact.getBundle().getBundleId();
+ public final Map<String, String> getProperties() {
+ Map<String, String> parentProperties = super.getProperties();
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.putAll(parentProperties);
+ properties.put("BundleId", String.valueOf(this.installArtifact.getBundle().getBundleId()));
+ properties.put("Location", this.installArtifact.getBundle().getLocation());
+ return Collections.unmodifiableMap(properties);
}
-
+
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/ManageableBundleArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/ManageableBundleArtifact.java
index 68abe39e..5d96905f 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/ManageableBundleArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/ManageableBundleArtifact.java
@@ -43,10 +43,4 @@ public interface ManageableBundleArtifact extends ManageableArtifact {
*/
void deleteEntry(String targetPath);
- /**
- * Gets the id of this bundle
- *
- * @return long id of this bundle
- */
- long getBundleId();
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java
index b89e32ab..edbbae49 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java
@@ -36,6 +36,10 @@ import org.eclipse.virgo.kernel.serviceability.NonNull;
*/
class DelegatingManageableArtifact implements ManageableArtifact {
+ private static final String USER_REGION_NAME = "org.eclipse.virgo.region.user";
+
+ private static final String GLOBAL_REGION_NAME = "global";
+
private final RuntimeArtifactModelObjectNameCreator artifactObjectNameCreator;
private final Artifact artifact;
@@ -131,10 +135,12 @@ class DelegatingManageableArtifact implements ManageableArtifact {
* @param artifacts The {@link Artifact}s to convert
* @return The {@link ObjectName}s converted to
*/
- protected final ObjectName[] convertToObjectNames(Set<Artifact> artifacts) {
+ private final ObjectName[] convertToObjectNames(Set<Artifact> artifacts) {
Set<ObjectName> objectNames = new HashSet<ObjectName>(artifacts.size());
+ String regionName;
for (Artifact artifact : artifacts) {
- if(newModel){
+ regionName = artifact.getRegion().getName();
+ if(newModel || (!USER_REGION_NAME.equals(regionName) && !GLOBAL_REGION_NAME.equals(regionName)) ){
objectNames.add(artifactObjectNameCreator.createArtifactModel(artifact));
} else {
objectNames.add(artifactObjectNameCreator.createModel(artifact));
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableBundleArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableBundleArtifact.java
index fc49bf4a..f06e3652 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableBundleArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableBundleArtifact.java
@@ -51,11 +51,4 @@ final class DelegatingManageableBundleArtifact extends DelegatingManageableArtif
this.bundleArtifact.updateEntry(inputPath, targetPath);
}
- /**
- * {@inheritDoc}
- */
- public long getBundleId() {
- return this.bundleArtifact.getBundleId();
- }
-
}
diff --git a/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifactTests.java b/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifactTests.java
index 445893dc..189570c4 100644
--- a/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifactTests.java
+++ b/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/bundle/BundleArtifactTests.java
@@ -48,21 +48,21 @@ public class BundleArtifactTests {
expect(this.region.getName()).andReturn("test.region").anyTimes();
}
- private final AbstractArtifact artifact = new BundleArtifact(bundleContext, packageAdminUtil, bundle, this.region);
+ private final AbstractArtifact artifact = new NativeBundleArtifact(bundleContext, packageAdminUtil, bundle, this.region);
@Test(expected = FatalAssertionException.class)
public void nullBundleContext() {
- new BundleArtifact(null, packageAdminUtil, bundle, this.region);
+ new NativeBundleArtifact(null, packageAdminUtil, bundle, this.region);
}
@Test(expected = FatalAssertionException.class)
public void nullPackageAdminUtil() {
- new BundleArtifact(bundleContext, null, bundle, this.region);
+ new NativeBundleArtifact(bundleContext, null, bundle, this.region);
}
@Test(expected = FatalAssertionException.class)
public void nullBundle() {
- new BundleArtifact(bundleContext, packageAdminUtil, null, this.region);
+ new NativeBundleArtifact(bundleContext, packageAdminUtil, null, this.region);
}
@Test
diff --git a/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifactTests.java b/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifactTests.java
index 4ee9a4e2..9eb4d92a 100644
--- a/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifactTests.java
+++ b/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifactTests.java
@@ -29,6 +29,7 @@ import javax.management.ObjectName;
import org.eclipse.virgo.kernel.model.Artifact;
import org.eclipse.virgo.kernel.model.ArtifactState;
import org.eclipse.virgo.kernel.model.StubCompositeArtifact;
+import org.eclipse.virgo.kernel.model.StubRegion;
import org.eclipse.virgo.kernel.model.management.RuntimeArtifactModelObjectNameCreator;
import org.eclipse.virgo.kernel.model.management.internal.DelegatingManageableArtifact;
import org.eclipse.virgo.kernel.serviceability.Assert.FatalAssertionException;
@@ -53,14 +54,16 @@ public class DelegatingManageableArtifactTests {
RuntimeArtifactModelObjectNameCreator creator = createMock(RuntimeArtifactModelObjectNameCreator.class);
Artifact artifact = createMock(Artifact.class);
- DelegatingManageableArtifact manageableArtifact = new DelegatingManageableArtifact(creator, artifact, true);
+ DelegatingManageableArtifact manageableArtifact = new DelegatingManageableArtifact(creator, artifact, false);
expect(artifact.getDependents()).andReturn(getArtifacts());
expect(creator.createArtifactModel(isA(Artifact.class))).andReturn(new ObjectName("domain:key=value1"));
expect(creator.createArtifactModel(isA(Artifact.class))).andReturn(new ObjectName("domain:key=value2"));
expect(creator.createArtifactModel(isA(Artifact.class))).andReturn(new ObjectName("domain:key=value3"));
+ expect(creator.createModel(isA(Artifact.class))).andReturn(new ObjectName("domain:key=value3,region=global"));
expect(artifact.getName()).andReturn("test-name");
expect(artifact.getState()).andReturn(ArtifactState.ACTIVE);
+ expect(artifact.getRegion()).andReturn(new StubRegion("test-region"));
expect(artifact.getType()).andReturn("test-type");
expect(artifact.getVersion()).andReturn(Version.emptyVersion);
expect(artifact.getProperties()).andReturn(Collections.<String, String> emptyMap());
@@ -70,9 +73,10 @@ public class DelegatingManageableArtifactTests {
artifact.uninstall();
replay(creator, artifact);
- assertEquals(3, manageableArtifact.getDependents().length);
+ assertEquals(4, manageableArtifact.getDependents().length);
manageableArtifact.getName();
assertEquals("ACTIVE", manageableArtifact.getState());
+ assertEquals("test-region", manageableArtifact.getRegion());
assertEquals("test-type", manageableArtifact.getType());
assertEquals("0.0.0", manageableArtifact.getVersion());
assertEquals(0, manageableArtifact.getProperties().size());
@@ -89,6 +93,7 @@ public class DelegatingManageableArtifactTests {
for (int i = 0; i < 3; i++) {
artifacts.add(new StubCompositeArtifact());
}
+ artifacts.add(new StubCompositeArtifact("foo", "bar", new StubRegion("global")));
return artifacts;
}
}
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
index 12e388be..e4f417a3 100644
--- a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
@@ -45,7 +45,9 @@ packageImports =\
org.osgi.service.cm;version="0",\
org.osgi.service.event;version="0",\
org.eclipse.equinox.region;version="1",\
+ ch.qos.logback.*;version="[0.9.24,1.0.0)",\
org.slf4j;version="[1.6.1,2)",\
+ org.slf4j.helpers;version="[1.6.1,2)",\
org.slf4j.spi;version="[1.6.1,2)"
serviceImports =\

Back to the top