SLING-5943 - support multiple model/raw references in RepositoryInitializer configuration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756518 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/provisioning/repoinit.txt b/src/main/provisioning/repoinit.txt
index c515fb8..56392c8 100644
--- a/src/main/provisioning/repoinit.txt
+++ b/src/main/provisioning/repoinit.txt
@@ -30,6 +30,10 @@
[settings]
org.apache.sling.commons.log.julenabled=true
+[configurations]
+ org.apache.sling.jcr.repoinit.impl.RepositoryInitializer
+ references=["model:context:/resources/provisioning/model.txt","model@repoinitTwo:context:/resources/provisioning/model.txt"]
+
[:repoinit]
# Test the RepositoryInitializer which reads such sections
create path /repoinit/fromProvisioningModel
@@ -47,4 +51,8 @@
<<===
<< <slingtest='http://sling.apache.org/ns/test/repoinit-it/v1.0'>
<< [slingtest:unstructured] > nt:unstructured
-===>>
\ No newline at end of file
+===>>
+
+# second section to test multiple configured URLs
+[:repoinitTwo]
+create service user secondUserFromProvisioningModel
diff --git a/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java b/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
index 7e270ab..e5c1776 100644
--- a/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
+++ b/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
@@ -38,6 +38,7 @@
private Session session;
private static final String TEST_PATH = "/repoinit/fromProvisioningModel";
private static final String TEST_USER = "userFromProvisioningModel";
+ private static final String SECOND_TEST_USER = "secondUserFromProvisioningModel";
private final String uniqueID = UUID.randomUUID().toString();
@Rule
@@ -57,8 +58,9 @@
}
@Test
- public void userCreated() throws Exception {
+ public void usersCreated() throws Exception {
assertTrue("Expecting user " + TEST_USER, U.userExists(session, TEST_USER));
+ assertTrue("Expecting user " + SECOND_TEST_USER, U.userExists(session, SECOND_TEST_USER));
}
@Test