DominikSuess closed pull request #10: SLING-8113 - defining file in 
registryhome to capture executionplan s…
URL: 
https://github.com/apache/sling-org-apache-sling-feature-extension-content/pull/10
 
 
   

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/main/java/org/apache/sling/feature/extension/content/ContentHandler.java 
b/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java
index dd94747..8d4c494 100644
--- 
a/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java
+++ 
b/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java
@@ -122,6 +122,7 @@ public boolean handle(Extension extension, 
LauncherPrepareContext prepareContext
             // Workaround for too bold relocation mechanism - corresponding 
details at https://issues.apache.org/jira/browse/MSHADE-156 
             final Configuration initcfg = new 
Configuration("org.UNSHADE.apache.sling.jcr.packageinit.impl.ExecutionPlanRepoInitializer");
             initcfg.getProperties().put("executionplans", 
executionPlans.toArray(new String[executionPlans.size()]));
+            initcfg.getProperties().put("statusfilepath", 
registryHome.getAbsolutePath() + "/executedplans.file");
             installationContext.addConfiguration(initcfg.getPid(), 
initcfg.getFactoryPid(), initcfg.getProperties());
          // Workaround for too bold relocation mechanism - corresponding 
details at https://issues.apache.org/jira/browse/MSHADE-156 
             final Configuration registrycfg = new 
Configuration("org.UNSHADE.apache.jackrabbit.vault.packaging.registry.impl.FSPackageRegistry");
diff --git 
a/src/test/java/org/apache/sling/feature/extension/content/ContentHandlerTest.java
 
b/src/test/java/org/apache/sling/feature/extension/content/ContentHandlerTest.java
index 06b7cff..a78457a 100644
--- 
a/src/test/java/org/apache/sling/feature/extension/content/ContentHandlerTest.java
+++ 
b/src/test/java/org/apache/sling/feature/extension/content/ContentHandlerTest.java
@@ -108,7 +108,11 @@ public void testMultipleStartOrders() throws Exception {
         
verify(installationContext).addConfiguration(eq("org.UNSHADE.apache.sling.jcr.packageinit.impl.ExecutionPlanRepoInitializer"),
 any(), executionPlanCaptor.capture());
         
verify(installationContext).addConfiguration(eq("org.UNSHADE.apache.jackrabbit.vault.packaging.registry.impl.FSPackageRegistry"),
 any(), any());
         Iterator<Dictionary<String, Object>> dictIt = 
executionPlanCaptor.getAllValues().iterator();
-        final String[] executionplans = (String[]) 
dictIt.next().get("executionplans");
+        Dictionary<String, Object> dict = dictIt.next();
+        final String[] executionplans = (String[]) dict.get("executionplans");
+        final String statusFileHome = (String)dict.get("statusfilepath");
+        File executedPlansFile = new File(testFolder.getRoot(), 
"executedplans.file");
+        assertEquals(executedPlansFile.getAbsolutePath(), statusFileHome);
         final String expected_0 =
                 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                         "<executionPlan version=\"1.0\">\n" +


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to