Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2011-12-28 11:21:13 +0000
committerFlorian Waibel2011-12-28 11:21:13 +0000
commit53b6c5396d1cd86e91cb56b79aebfabc9fce355d (patch)
tree76de7904950932885380d2555c556a93d29c4c58 /org.eclipse.virgo.kernel.deployer.test/src/test
parent91544c81e1375344d1ec3dc16f6bae5a42511d22 (diff)
downloadorg.eclipse.virgo.kernel-53b6c5396d1cd86e91cb56b79aebfabc9fce355d.tar.gz
org.eclipse.virgo.kernel-53b6c5396d1cd86e91cb56b79aebfabc9fce355d.tar.xz
org.eclipse.virgo.kernel-53b6c5396d1cd86e91cb56b79aebfabc9fce355d.zip
#365034 - Shared test code between PlanDeploymentTests and PlanDeploymentWithDAGTests
Diffstat (limited to 'org.eclipse.virgo.kernel.deployer.test/src/test')
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java41
2 files changed, 5 insertions, 42 deletions
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java
index 29fb7476..c6d7b891 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java
@@ -228,7 +228,7 @@ public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
assertTrue("More than one STARTING event received for the atomic plan.", actualEventSetList.indexOf(planStartingEvent) == actualEventSetList.lastIndexOf(planStartingEvent));
}
- private void assertBundlesNotInstalled(Bundle[] bundles, String... candidateBsns) {
+ static void assertBundlesNotInstalled(Bundle[] bundles, String... candidateBsns) {
List<String> installedBsns = getInstalledBsns(bundles);
for (String candidateBsn : candidateBsns) {
for (String installedBsn : installedBsns) {
@@ -261,7 +261,7 @@ public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
Assert.assertNull(configuration.getProperties());
}
- private void assertBundlesInstalled(Bundle[] bundles, String... candidateBsns) {
+ static void assertBundlesInstalled(Bundle[] bundles, String... candidateBsns) {
List<String> installedBsns = getInstalledBsns(bundles);
for (String candidateBsn : candidateBsns) {
boolean found = false;
@@ -274,7 +274,7 @@ public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
}
}
- private List<String> getInstalledBsns(Bundle[] bundles) {
+ private static List<String> getInstalledBsns(Bundle[] bundles) {
List<String> installedBsns = new ArrayList<String>(bundles.length);
for (Bundle bundle : bundles) {
installedBsns.add(bundle.getSymbolicName());
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java
index a5206a16..18d88980 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java
@@ -11,16 +11,13 @@
package org.eclipse.virgo.kernel.deployer.test;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.eclipse.virgo.kernel.deployer.test.PlanDeploymentTests.assertBundlesInstalled;
+import static org.eclipse.virgo.kernel.deployer.test.PlanDeploymentTests.assertBundlesNotInstalled;
import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
import org.eclipse.virgo.kernel.deployer.core.DeploymentIdentity;
import org.junit.Test;
-import org.osgi.framework.Bundle;
// TODO 1c. (transitive dependencies) (@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365034)
public class PlanDeploymentWithDAGTests extends AbstractDeployerIntegrationTest {
@@ -81,38 +78,4 @@ public class PlanDeploymentWithDAGTests extends AbstractDeployerIntegrationTest
assertBundlesNotInstalled(this.context.getBundles(), BUNDLE_ONE_SYMBOLIC_NAME);
}
- // TODO - copy from PlanDeploymentTests
- private void assertBundlesNotInstalled(Bundle[] bundles, String... candidateBsns) {
- List<String> installedBsns = getInstalledBsns(bundles);
- for (String candidateBsn : candidateBsns) {
- for (String installedBsn : installedBsns) {
- if (installedBsn.contains(candidateBsn)) {
- fail(candidateBsn + " was installed");
- }
- }
- }
- }
-
- private void assertBundlesInstalled(Bundle[] bundles, String... candidateBsns) {
- List<String> installedBsns = getInstalledBsns(bundles);
- for (String candidateBsn : candidateBsns) {
- boolean found = false;
- for (String installedBsn : installedBsns) {
- if (installedBsn.contains(candidateBsn)) {
- found = true;
- }
- }
- assertTrue(candidateBsn + " was not installed", found);
- }
- }
-
- private List<String> getInstalledBsns(Bundle[] bundles) {
- List<String> installedBsns = new ArrayList<String>(bundles.length);
- for (Bundle bundle : bundles) {
- installedBsns.add(bundle.getSymbolicName());
- }
-
- return installedBsns;
- }
-
}

Back to the top