This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.0.2
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 177001a1421aa0aa22dc773f74ba271085b9f1dc
Author: Bertrand Delacretaz <bdelacre...@apache.org>
AuthorDate: Fri Jul 29 09:39:05 2016 +0000

    SLING-5917 - fix 'null section' test
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1754491 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jcr/repoinit/RepositoryInitializerTest.java      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java 
b/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
index 8350af6..60615e9 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
@@ -28,8 +28,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import javax.jcr.Session;
-
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl;
 import org.apache.sling.jcr.repoinit.impl.RepositoryInitializer;
@@ -70,7 +68,7 @@ public class RepositoryInitializerTest {
         result.add(new Object[] { "All empty, just setup + parsing", "", false 
});
         result.add(new Object[] { "Using provisioning model", "SECTION_" + 
UUID.randomUUID(), true }); 
         result.add(new Object[] { "Raw repoinit/empty section", "", true}); 
-        result.add(new Object[] { "Raw repoinit/null section", "", true}); 
+        result.add(new Object[] { "Default value of model section config", 
null, true}); 
         return result;
     }
     
@@ -78,8 +76,10 @@ public class RepositoryInitializerTest {
         serviceUser = getClass().getSimpleName() + "-" + UUID.randomUUID();
         
         String txt = "create service user " + serviceUser; 
-        if(modelSection != null && modelSection.length() > 0) {
-            txt = "[feature name=foo]\n[:" + modelSection + "]\n" + txt; 
+        if(modelSection == null) {
+            txt = "[feature name=foo]\n[:repoinit]\n" + txt; 
+        } else if(modelSection.length() > 0) {
+            txt = "[feature name=bar]\n[:" + modelSection + "]\n" + txt; 
         }
         this.repoInitText = txt + "\n";
         this.url = getTestUrl(repoInitText);
@@ -94,7 +94,9 @@ public class RepositoryInitializerTest {
         initializer = new RepositoryInitializer();
         config = new HashMap<String, Object>();
         config.put(RepositoryInitializer.PROP_TEXT_URL, url);
-        config.put(RepositoryInitializer.PROP_MODEL_SECTION_NAME, 
modelSection);
+        if(modelSection != null) {
+            config.put(RepositoryInitializer.PROP_MODEL_SECTION_NAME, 
modelSection);
+        }
         initializer.activate(config);
         
         context.registerInjectActivateService(new RepoInitParserService());

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Reply via email to