You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2009/08/21 10:22:10 UTC

svn commit: r806448 - /sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java

Author: bdelacretaz
Date: Fri Aug 21 08:22:09 2009
New Revision: 806448

URL: http://svn.apache.org/viewvc?rev=806448&view=rev
Log:
SLING-1078 - RegisterResourcesTest verifies that URL scheme is taken into account in registerResources()

Modified:
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java?rev=806448&r1=806447&r2=806448&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java Fri Aug 21 08:22:09 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.sling.osgi.installer.it;
 
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -98,6 +99,17 @@
         }
         
         {
+            // Add a bundle with different URL scheme - must not be removed by registerResources
+            resetCounters();
+            installer.addResource(new InstallableResource(
+                    "anotherscheme:testA.jar", 
+                    new FileInputStream(getTestBundle(BUNDLE_BASE_NAME + "-testA-1.0.jar")), 
+                    "digest1"));
+            waitForInstallerAction(OsgiInstaller.OSGI_TASKS_COUNTER, 2);
+            assertBundle("testA bundle added", "osgi-installer-testA", "1.0", Bundle.ACTIVE);
+        }
+        
+        {
             // Simulate later registration where some bundles have disappeared
             // the installer must mark them "not installable" and act accordingly
             final List<InstallableResource> r = new ArrayList<InstallableResource>();
@@ -117,6 +129,7 @@
             assertFalse("Bundle needsB must be stopped as testB is gone (" + state + ")", Bundle.ACTIVE == state);
             assertBundle("Testbundle must be back to 1.0 as 1.1 and 1.2 is gone", 
                     "osgi-installer-testbundle", "1.0", Bundle.ACTIVE);
+            assertBundle("testA bundle should still be present", "osgi-installer-testA", "1.0", Bundle.ACTIVE);
         }
         
         {
@@ -135,6 +148,7 @@
             b.start();
             assertBundle("After reinstalling testB, needsB must be startable, ",
             		"osgi-installer-needsB", "1.0", Bundle.ACTIVE);
+            assertBundle("testA bundle should still be present", "osgi-installer-testA", "1.0", Bundle.ACTIVE);
         }
     }
 }