[ 
https://issues.apache.org/jira/browse/SLING-7496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16369279#comment-16369279
 ] 

ASF GitHub Bot commented on SLING-7496:
---------------------------------------

cziegeler closed pull request #1: SLING-7496 - Fix two failures in 
ConfigInstallTest
URL: https://github.com/apache/sling-org-apache-sling-installer-it/pull/1
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java 
b/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java
index 6a56db0..f27c16f 100644
--- a/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java
+++ b/src/test/java/org/apache/sling/installer/it/ConfigInstallTest.java
@@ -16,10 +16,6 @@
  */
 package org.apache.sling.installer.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.Hashtable;
@@ -48,6 +44,10 @@
 import org.osgi.util.tracker.ServiceTracker;
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 @RunWith(PaxExam.class)
 
 public class ConfigInstallTest extends OsgiInstallerTestBase implements 
ConfigurationListener {
@@ -359,6 +359,8 @@ public void testInstallUpdateRemoveConfigFactory() throws 
Exception {
                 null, cfgData, null, InstallableResource.TYPE_PROPERTIES, 10);
         installer.updateResources(URL_SCHEME, new InstallableResource[] 
{rsrc}, null);
 
+        waitForResource(URL_SCHEME + ":/configA/" + cfgFactoryPid + "-" + 
alias, ResourceState.INSTALLED);
+
         // get factory config
         final Configuration cfg = waitForFactoryConfigValue("After 
installing", cfgFactoryPid, "foo", "bar");
 
@@ -392,6 +394,8 @@ public void testInstallUpdateRemoveTemplateConfigFactory() 
throws Exception {
                 null, cfgData, null, InstallableResource.TYPE_PROPERTIES, 10);
         installer.updateResources(URL_SCHEME, new InstallableResource[] 
{rsrc}, null);
 
+        waitForResource(URL_SCHEME + ":/configA/" + cfgFactoryPid + "-" + 
alias, ResourceState.INSTALLED);
+
         // get factory config
         final Configuration cfg = waitForFactoryConfigValue("After 
installing", cfgFactoryPid, "foo", "bar");
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Factory config deleted with ConfigAdmin immediately after creation
> ------------------------------------------------------------------
>
>                 Key: SLING-7496
>                 URL: https://issues.apache.org/jira/browse/SLING-7496
>             Project: Sling
>          Issue Type: Bug
>          Components: Installer
>    Affects Versions: Installer Configuration Factory 1.1.2
>            Reporter: David Bosschaert
>            Assignee: Carsten Ziegeler
>            Priority: Major
>             Fix For: Installer Configuration Factory 1.2.0
>
>
> In some cases when a factory configuration is created using the OSGi 
> ConfigAdmin API, the configuration gets a call to {{delete()}} immediately 
> when {{update()}} on the configuration is called.
>  
> The issue comes down to the fact that the factory prefix is prepended twice 
> to the configuration at some point in the installer, which is then assigned 
> to the resource {{entityId}}. This mismatch causes the initial configuration 
> to receive a delete callback as the system thinks it's no longer there.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to