Revert to previous version undoing SLING-6392 as there are some issues with it.
authorKarl Pauls <pauls@apache.org>
Fri, 17 Feb 2017 12:32:40 +0000 (12:32 +0000)
committerKarl Pauls <pauls@apache.org>
Fri, 17 Feb 2017 12:32:40 +0000 (12:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1783387 13f79535-47bb-0310-9956-ffa450edef68

pom.xml
src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java

diff --git a/pom.xml b/pom.xml
index 81008b2..7dc05c2 100644 (file)
--- 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>
index 70d93c9..ef3b894 100644 (file)
@@ -19,8 +19,6 @@ package org.apache.sling.installer.it;
 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 @@ public class BundleInstallUpgradeDowngradeTest extends OsgiInstallerTestBase {
         }
 
     }
-
-    /**
-     * 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
index 1593d89..434382d 100644 (file)
@@ -45,8 +45,8 @@ public class MockInstallableResource extends InstallableResource {
                 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);
     }
index a4fcf34..5768a09 100644 (file)
@@ -408,17 +408,14 @@ public class OsgiInstallerTestBase implements FrameworkListener {
     }
 
     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);
     }