Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-04-01 15:59:47 -0400
committerGlyn Normington2011-04-01 15:59:47 -0400
commita3bc4a553bb9935ea9d1cfacdd6675e464396db3 (patch)
treec6788c88269220479045c45ab0cbc2297aac0bcc /org.eclipse.virgo.kernel.shell
parent816cc7a9a7790a667cbe36abbcef6e208744ec0e (diff)
downloadorg.eclipse.virgo.kernel-a3bc4a553bb9935ea9d1cfacdd6675e464396db3.tar.gz
org.eclipse.virgo.kernel-a3bc4a553bb9935ea9d1cfacdd6675e464396db3.tar.xz
org.eclipse.virgo.kernel-a3bc4a553bb9935ea9d1cfacdd6675e464396db3.zip
add regions to RAM
Diffstat (limited to 'org.eclipse.virgo.kernel.shell')
-rw-r--r--org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/internal/commands/StubRuntimeArtifactModelObjectNameCreator.java12
-rw-r--r--org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java7
2 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/internal/commands/StubRuntimeArtifactModelObjectNameCreator.java b/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/internal/commands/StubRuntimeArtifactModelObjectNameCreator.java
index 306830d2..1eb79a31 100644
--- a/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/internal/commands/StubRuntimeArtifactModelObjectNameCreator.java
+++ b/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/internal/commands/StubRuntimeArtifactModelObjectNameCreator.java
@@ -18,6 +18,7 @@ import org.osgi.framework.Version;
import org.eclipse.virgo.kernel.model.Artifact;
import org.eclipse.virgo.kernel.model.management.RuntimeArtifactModelObjectNameCreator;
+import org.eclipse.virgo.kernel.osgi.region.Region;
public final class StubRuntimeArtifactModelObjectNameCreator implements RuntimeArtifactModelObjectNameCreator {
@@ -34,6 +35,17 @@ public final class StubRuntimeArtifactModelObjectNameCreator implements RuntimeA
return null;
}
+ @Override
+ public ObjectName create(String type, String name, Version version, Region region) {
+ try {
+ return new ObjectName("test:type=RegionModel,artifact-type=" + type + ",name=" + name + ",version=" + version + "region="
+ + region.getName());
+ } catch (MalformedObjectNameException e) {
+ } catch (NullPointerException e) {
+ }
+ return null;
+ }
+
public ObjectName createArtifactsOfTypeQuery(String type) {
try {
return new ObjectName("test:artifact-type=" + type + ",*");
diff --git a/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java b/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java
index e49f14e0..c9a19a21 100644
--- a/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java
+++ b/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java
@@ -13,6 +13,7 @@ package org.eclipse.virgo.kernel.shell.model.helper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.lang.management.ManagementFactory;
@@ -193,11 +194,7 @@ public class StandardRamAccessorHelperTests {
@Test
public void testGetArtifactNotExist() {
ArtifactAccessor artifact = this.ramAccessorHelper.getArtifact(TYPE, NAME, VERSION);
- assertNotNull(artifact);
- // This accommodates the workaround to bug 337211.
- assertEquals("Region", artifact.getType());
- assertEquals(NAME, artifact.getName());
- assertEquals(VERSION, artifact.getVersion());
+ assertNull(artifact);
}
}

Back to the top