sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r1783387 - in /sling/trunk/installer/it: ./ src/test/java/org/apache/sling/installer/it/
Date Fri, 17 Feb 2017 12:32:40 GMT
Author: pauls
Date: Fri Feb 17 12:32:40 2017
New Revision: 1783387

URL: http://svn.apache.org/viewvc?rev=1783387&view=rev
Log:
Revert to previous version undoing SLING-6392 as there are some issues with it.

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

Modified: sling/trunk/installer/it/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/pom.xml?rev=1783387&r1=1783386&r2=1783387&view=diff
==============================================================================
--- sling/trunk/installer/it/pom.xml (original)
+++ sling/trunk/installer/it/pom.xml Fri Feb 17 12:32:40 2017
@@ -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>

Modified: sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java?rev=1783387&r1=1783386&r2=1783387&view=diff
==============================================================================
--- sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
(original)
+++ sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/BundleInstallUpgradeDowngradeTest.java
Fri Feb 17 12:32:40 2017
@@ -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 BundleInstallUpgradeDowngra
         }
 
     }
-
-    /**
-     * 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

Modified: sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java?rev=1783387&r1=1783386&r2=1783387&view=diff
==============================================================================
--- sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
(original)
+++ sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/MockInstallableResource.java
Fri Feb 17 12:32:40 2017
@@ -45,8 +45,8 @@ public class MockInstallableResource ext
                 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);
     }

Modified: sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java?rev=1783387&r1=1783386&r2=1783387&view=diff
==============================================================================
--- sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java
(original)
+++ sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java
Fri Feb 17 12:32:40 2017
@@ -408,17 +408,14 @@ public class OsgiInstallerTestBase imple
     }
 
     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);
     }



Mime
View raw message