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 2016/07/29 09:39:05 UTC
svn commit: r1754491 -
/sling/trunk/bundles/jcr/repoinit/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
Author: bdelacretaz
Date: Fri Jul 29 09:39:05 2016
New Revision: 1754491
URL: http://svn.apache.org/viewvc?rev=1754491&view=rev
Log:
SLING-5917 - fix 'null section' test
Modified:
sling/trunk/bundles/jcr/repoinit/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
Modified: sling/trunk/bundles/jcr/repoinit/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/repoinit/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java?rev=1754491&r1=1754490&r2=1754491&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/repoinit/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java (original)
+++ sling/trunk/bundles/jcr/repoinit/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java Fri Jul 29 09:39:05 2016
@@ -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());