sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1650522 - in /sling/trunk/installer: core/src/main/java/org/apache/sling/installer/core/impl/ factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ it/src/test/java/org/apache/sling/installer/it/
Date Fri, 09 Jan 2015 13:30:10 GMT
Author: cziegeler
Date: Fri Jan  9 13:30:10 2015
New Revision: 1650522

URL: http://svn.apache.org/r1650522
Log:
SLING-1794 : ConfigInstallTest fails semi-randomly: Configuration is still present

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
    sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ServicesListener.java
    sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java?rev=1650522&r1=1650521&r2=1650522&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
Fri Jan  9 13:30:10 2015
@@ -251,15 +251,17 @@ implements OsgiInstaller, ResourceChange
                 // merge potential new resources
                 this.mergeNewlyRegisteredResources();
 
+                synchronized ( this.resourcesLock ) {
+                    this.retryDuringTaskExecution = false;
+                }
+
                 // invoke transformers
                 this.transformResources();
 
                 // Compute tasks
                 final SortedSet<InstallTask> tasks = this.computeTasks();
+
                 // execute tasks and see if we have to stop processing
-                synchronized ( this.resourcesLock ) {
-                    this.retryDuringTaskExecution = false;
-                }
                 final ACTION action = this.executeTasks(tasks);
                 if ( action == ACTION.SLEEP ) {
                     synchronized ( this.resourcesLock ) {

Modified: sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ServicesListener.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ServicesListener.java?rev=1650522&r1=1650521&r2=1650522&view=diff
==============================================================================
--- sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ServicesListener.java
(original)
+++ sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ServicesListener.java
Fri Jan  9 13:30:10 2015
@@ -164,9 +164,9 @@ public class ServicesListener {
          * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent)
          */
         public void serviceChanged(ServiceEvent event) {
-            if (event.getType() == ServiceEvent.REGISTERED && this.service == null
) {
+            if (event.getType() == ServiceEvent.REGISTERED ) {
                 this.retainService();
-            } else if ( event.getType() == ServiceEvent.UNREGISTERING && this.service
!= null ) {
+            } else if ( event.getType() == ServiceEvent.UNREGISTERING ) {
                 this.releaseService();
             }
         }

Modified: sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java?rev=1650522&r1=1650521&r2=1650522&view=diff
==============================================================================
--- sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java
(original)
+++ sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java
Fri Jan  9 13:30:10 2015
@@ -454,9 +454,7 @@ public class ConfigInstallTest extends O
         final Dictionary<String, Object> cfgData = new Hashtable<String, Object>();
         cfgData.put("foo", "bar");
         final InstallableResource[] rsrc = getInstallableResource(cfgPid, cfgData);
-        installationEvents = 0;
         installer.updateResources(URL_SCHEME, rsrc, null);
-        waitForInstallationEvents(2);
         waitForConfiguration("Config must be installed before stopping ConfigurationAdmin",
                 cfgPid, true);
 
@@ -468,6 +466,7 @@ public class ConfigInstallTest extends O
         installationEvents = 0;
         installer.updateResources(URL_SCHEME, null, new String[] {rsrc[0].getId()});
         waitForInstallationEvents(2);
+
         configAdmin.start();
         waitForConfigAdmin(true);
         waitForConfiguration("Config must be removed once ConfigurationAdmin restarts",



Mime
View raw message