Revert to previous version undoing SLING-6392 as there are some issues with it.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1783387 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 81008b2..7dc05c2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>org.apache.sling.installer.it</artifactId>
- <version>3.8.5-SNAPSHOT</version>
+ <version>3.8.3-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Apache Sling Installer Integration Tests</name>
diff --git a/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java b/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
index 70d93c9..ef3b894 100644
--- a/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
+++ b/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
@@ -19,8 +19,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import org.apache.sling.installer.api.InstallableResource;
-import org.apache.sling.installer.it.OsgiInstallerTestBase.BundleEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -209,44 +207,4 @@
}
}
-
- /**
- * This test class assures that whenever a new bundle is
- * provided with the same url as an already installed bundle,
- * the already installed bundle is uninstalled and the new one installed.
- * @see <a href="https://issues.apache.org/jira/browse/SLING-6392">SLING-6392</a>
- */
- @Test
- public void testReplaceBundleWithSameUrlButDifferentSymbolicName() throws Exception {
- final String symbolicName = "osgi-installer-testbundle";
- final String symbolicName2 = "osgi-installer-testA";
- final String installableResourceId = "stable-id";
-
- assertNull("Test bundle must not be present before test", findBundle(symbolicName));
- assertNull("Test A bundle must not be present before test", findBundle(symbolicName2));
- {
- //assertNull("Test bundle must be absent before installing", findBundle(symbolicName));
- final Object listener = this.startObservingBundleEvents();
- installer.updateResources(URL_SCHEME, getInstallableResource(
- getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar"), installableResourceId, "1", InstallableResource.DEFAULT_PRIORITY), null);
- this.waitForBundleEvents(symbolicName + " must be installed", listener,
- new BundleEvent(symbolicName, "1.0", org.osgi.framework.BundleEvent.INSTALLED),
- new BundleEvent(symbolicName, "1.0", org.osgi.framework.BundleEvent.STARTED));
- assertBundle("After installing", symbolicName, "1.0", Bundle.ACTIVE);
- }
-
- // now modify the bundle (having the same url but a different symbolic name and different digest)
- {
- final Object listener = this.startObservingBundleEvents();
- installer.updateResources(URL_SCHEME, getInstallableResource(
- getTestBundle(BUNDLE_BASE_NAME + "-testA-1.0.jar"), installableResourceId, "2", InstallableResource.DEFAULT_PRIORITY), null);
- this.waitForBundleEvents(symbolicName2 + " must be installed and " + symbolicName + " uninstalled", listener,
- new BundleEvent(symbolicName, "1.0", org.osgi.framework.BundleEvent.STOPPED),
- new BundleEvent(symbolicName, "1.0", org.osgi.framework.BundleEvent.UNINSTALLED),
- new BundleEvent(symbolicName2, "1.0", org.osgi.framework.BundleEvent.INSTALLED),
- new BundleEvent(symbolicName2, "1.0", org.osgi.framework.BundleEvent.STARTED));
- assertBundle("After installing a different bundle with same id " + installableResourceId, symbolicName2, "1.0", Bundle.ACTIVE);
- assertNull("Test bundle must not be present after removing it", findBundle(symbolicName));
- }
- }
}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java b/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
index 1593d89..434382d 100644
--- a/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
+++ b/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
@@ -45,8 +45,8 @@
InstallableResource.TYPE_BUNDLE, null);
}
- public MockInstallableResource(String id, InputStream is, String digest, String type, Integer priority) {
- super(id, is,
+ public MockInstallableResource(String uri, InputStream is, String digest, String type, Integer priority) {
+ super(uri, is,
null, digest,
type != null ? type : InstallableResource.TYPE_BUNDLE, priority);
}
diff --git a/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java b/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java
index a4fcf34..5768a09 100644
--- a/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java
+++ b/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java
@@ -408,17 +408,14 @@
}
protected InstallableResource[] getInstallableResource(File testBundle, String digest, int priority) throws IOException {
- return getInstallableResource(testBundle, testBundle.getAbsolutePath(), digest, priority);
- }
-
- protected InstallableResource[] getInstallableResource(File testBundle, String id, String digest, int priority) throws IOException {
+ final String url = testBundle.getAbsolutePath();
if (digest == null) {
digest = String.valueOf(testBundle.lastModified());
}
- final InstallableResource result = new MockInstallableResource(id, new FileInputStream(testBundle), digest, null, priority);
+ final InstallableResource result = new MockInstallableResource(url, new FileInputStream(testBundle), digest, null, priority);
return new InstallableResource[] {result};
}
-
+
protected InstallableResource[] getInstallableResource(String configPid, Dictionary<String, Object> data) {
return getInstallableResource(configPid, copy(data), InstallableResource.DEFAULT_PRIORITY);
}