SLING-5842, SLING-5843 - implement the register namespace and nodetype operations in the jcr.repoinit module
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1753399 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/provisioning/repoinit.txt b/src/main/provisioning/repoinit.txt
index a78e73d..c515fb8 100644
--- a/src/main/provisioning/repoinit.txt
+++ b/src/main/provisioning/repoinit.txt
@@ -40,3 +40,11 @@
allow jcr:read on /repoinit/fromProvisioningModel
deny jcr:write on /repoinit/fromProvisioningModel
end
+
+register namespace (slingtest) http://sling.apache.org/ns/test/repoinit-it/v1.0
+
+register nodetypes
+<<===
+<< <slingtest='http://sling.apache.org/ns/test/repoinit-it/v1.0'>
+<< [slingtest:unstructured] > nt:unstructured
+===>>
\ No newline at end of file
diff --git a/src/main/provisioning/sling.txt b/src/main/provisioning/sling.txt
index 8af59d8..9263516 100644
--- a/src/main/provisioning/sling.txt
+++ b/src/main/provisioning/sling.txt
@@ -45,7 +45,6 @@
org.apache.sling/org.apache.sling.commons.threads/3.2.4
org.apache.sling/org.apache.sling.engine/2.4.6
org.apache.sling/org.apache.sling.event/4.0.0
- org.apache.sling/org.apache.sling.event.dea/1.0.4
org.apache.sling/org.apache.sling.jcr.resource/2.7.4
org.apache.sling/org.apache.sling.resourceresolver/1.4.12
org.apache.sling/org.apache.sling.scripting.api/2.1.8
@@ -55,7 +54,6 @@
org.apache.sling/org.apache.sling.servlets.post/2.3.12
org.apache.sling/org.apache.sling.servlets.resolver/2.4.2
javax.mail/mail/1.4.7
- org.apache.geronimo.bundles/jstl/1.2_1
org.apache.felix/org.apache.felix.http.whiteboard/3.0.0
[artifacts startLevel=5]
@@ -63,9 +61,6 @@
org.apache.felix/org.apache.felix.webconsole/4.2.14
org.apache.geronimo.bundles/json/20090211_1
org.apache.sling/org.apache.sling.commons.json/2.0.16
- org.apache.aries.jmx/org.apache.aries.jmx.api/1.1.0
- org.apache.aries.jmx/org.apache.aries.jmx.core/1.1.1
- org.apache.aries.jmx/org.apache.aries.jmx.whiteboard/1.0.0
commons-io/commons-io/2.4
commons-fileupload/commons-fileupload/1.3.1
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 31f80b9..7e270ab 100644
--- a/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
+++ b/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
@@ -19,6 +19,9 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import java.util.UUID;
+
+import javax.jcr.Node;
import javax.jcr.Session;
import org.apache.sling.jcr.api.SlingRepository;
@@ -26,7 +29,6 @@
import org.apache.sling.repoinit.parser.RepoInitParser;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -36,6 +38,7 @@
private Session session;
private static final String TEST_PATH = "/repoinit/fromProvisioningModel";
private static final String TEST_USER = "userFromProvisioningModel";
+ private final String uniqueID = UUID.randomUUID().toString();
@Rule
public TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "IT");
@@ -54,13 +57,20 @@
}
@Test
- public void provisioningModelUserExists() throws Exception {
+ public void userCreated() throws Exception {
assertTrue("Expecting user " + TEST_USER, U.userExists(session, TEST_USER));
}
@Test
- public void provisioningModelUserAcl() throws Exception {
+ public void userAclSet() throws Exception {
assertTrue("Expecting read access", U.canRead(session, TEST_USER, TEST_PATH));
assertFalse("Expecting no write access", U.canWrite(session, TEST_USER, TEST_PATH));
}
+
+ @Test
+ public void namespaceAndCndRegistered() throws Exception {
+ final String nodeName = "ns-" + uniqueID;
+ session.getRootNode().addNode(nodeName, "slingtest:unstructured");
+ session.save();
+ }
}