Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/PlatformAdminImpl.java4
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java23
2 files changed, 24 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/PlatformAdminImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/PlatformAdminImpl.java
index 77113e4f9..3f35cd719 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/PlatformAdminImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/PlatformAdminImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2016 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2012, 2017 IBM Corporation and others. 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
@@ -72,7 +72,7 @@ public class PlatformAdminImpl implements PlatformAdmin {
long getTimeStamp() {
synchronized (this.monitor) {
- return equinoxContainer.getStorage().getModuleDatabase().getTimestamp();
+ return equinoxContainer.getStorage().getModuleDatabase().getRevisionsTimestamp();
}
}
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java
index c7f4dde32..5bb8d5852 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2016 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 IBM Corporation and others.
* 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
@@ -19,6 +19,7 @@ import junit.framework.TestSuite;
import org.eclipse.osgi.service.resolver.*;
import org.eclipse.osgi.tests.OSGiTestsActivator;
import org.osgi.framework.*;
+import org.osgi.framework.startlevel.BundleStartLevel;
import org.osgi.framework.wiring.FrameworkWiring;
public class PlatformAdminBundleTests extends AbstractBundleTests {
@@ -163,4 +164,24 @@ public class PlatformAdminBundleTests extends AbstractBundleTests {
getContext().removeFrameworkListener(errorListener);
}
}
+
+ public void testTimestamp() throws BundleException {
+ PlatformAdmin pa = installer.getPlatformAdmin();
+ // get system state first to ensure it does not have the test bundle
+ State systemState = pa.getState(false);
+
+ long initialTimeStamp = systemState.getTimeStamp();
+ Bundle test = installer.installBundle("test");
+
+ assertTrue("Timestamp has not changed.", initialTimeStamp != systemState.getTimeStamp());
+
+ initialTimeStamp = systemState.getTimeStamp();
+ test.adapt(BundleStartLevel.class).setStartLevel(1000);
+
+ assertTrue("Timestamp has not changed.", initialTimeStamp == systemState.getTimeStamp());
+
+ initialTimeStamp = systemState.getTimeStamp();
+ test.uninstall();
+ assertTrue("Timestamp has not changed.", initialTimeStamp != systemState.getTimeStamp());
+ }
}

Back to the top