Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2020-05-21 16:03:12 +0000
committerThomas Watson2020-05-21 16:03:12 +0000
commit3171fc3fd4c427273526616f17f5724eb6bfee52 (patch)
treed4b0790f8dd4790013b79433ececb308dd9700f2
parentb744056353e7d54dba04b35b7855f253685df288 (diff)
downloadrt.equinox.framework-3171fc3fd4c427273526616f17f5724eb6bfee52.tar.gz
rt.equinox.framework-3171fc3fd4c427273526616f17f5724eb6bfee52.tar.xz
rt.equinox.framework-3171fc3fd4c427273526616f17f5724eb6bfee52.zip
Change-Id: I96f1ef0e85ab873f56c612ff6e0d509bfd50a640 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java12
-rwxr-xr-xbundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java6
2 files changed, 15 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java
index 2d278ee44..ab849d154 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java
@@ -311,8 +311,7 @@ public class AbstractBundleTests extends CoreTest {
static public FrameworkEvent stop(Framework equinox, boolean quietly, long timeout) {
if (equinox == null)
return null;
- BundleContext bc = equinox.getBundleContext();
- final String uuid = bc == null ? null : bc.getProperty(Constants.FRAMEWORK_UUID);
+ final String uuid = getUUID(equinox);
try {
equinox.stop();
} catch (BundleException e) {
@@ -320,6 +319,10 @@ public class AbstractBundleTests extends CoreTest {
fail("Unexpected erorr stopping framework", e); //$NON-NLS-1$
}
}
+ return waitForStop(equinox, uuid, quietly, timeout);
+ }
+
+ static public FrameworkEvent waitForStop(Framework equinox, String uuid, boolean quietly, long timeout) {
try {
FrameworkEvent stopEvent = equinox.waitForStop(timeout);
if (stopEvent.getType() == FrameworkEvent.WAIT_TIMEDOUT) {
@@ -342,6 +345,11 @@ public class AbstractBundleTests extends CoreTest {
return null;
}
+ public static String getUUID(Framework equinox) {
+ BundleContext bc = equinox.getBundleContext();
+ return bc == null ? null : bc.getProperty(Constants.FRAMEWORK_UUID);
+ }
+
static private String getState(Framework framework) {
int state = framework.getState();
switch (state) {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java
index 61aa581ff..83b9f3429 100755
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java
@@ -1623,13 +1623,17 @@ public class SystemBundleTests extends AbstractBundleTests {
equinox.start();
assertEquals("Unexpected state", Bundle.ACTIVE, testTCCL.getState()); //$NON-NLS-1$
+ String uuid = getUUID(equinox);
// test that the correct tccl is used for framework update
try {
equinox.update();
- checkActive(testTCCL);
} catch (Exception e) {
fail("Unexpected exception", e); //$NON-NLS-1$
}
+ waitForStop(equinox, uuid, false, 10000);
+
+ checkActive(testTCCL);
+
systemContext = equinox.getBundleContext();
assertEquals("Unexpected state", Bundle.ACTIVE, testTCCL.getState()); //$NON-NLS-1$

Back to the top