jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r527261 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test: AbstractJCRTest.java RepositoryStub.java api/NodeTest.java api/WorkspaceCopyTest.java api/WorkspaceMoveTest.java
Date Tue, 10 Apr 2007 19:36:49 GMT
Author: reschke
Date: Tue Apr 10 12:36:48 2007
New Revision: 527261

URL: http://svn.apache.org/viewvc?view=rev&rev=527261
Log:
JCR-826: add new config variable for node type that does not allow child nodes to be added;
use it in Workspace{Copy|Move}Test.java and NodeTest.java

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java?view=diff&rev=527261&r1=527260&r2=527261
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
Tue Apr 10 12:36:48 2007
@@ -202,6 +202,11 @@
     protected String testNodeType;
 
     /**
+     * A node type that does not allow any child nodes, such as nt:base.
+     */
+    protected String testNodeTypeNoChildren;
+
+    /**
      * Name of a node that will be created during a test case.
      */
     protected String nodeName1;
@@ -262,6 +267,7 @@
         // cut off '/' to build testPath
         testPath = testRoot.substring(1);
         testNodeType = getProperty(RepositoryStub.PROP_NODETYPE);
+        testNodeTypeNoChildren = getProperty(RepositoryStub.PROP_NODETYPENOCHILDREN);
         // setup node names
         nodeName1 = getProperty(RepositoryStub.PROP_NODE_NAME1);
         if (nodeName1 == null) {

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java?view=diff&rev=527261&r1=527260&r2=527261
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
Tue Apr 10 12:36:48 2007
@@ -59,6 +59,8 @@
 
     public static final String PROP_NODETYPE = "nodetype";
 
+    public static final String PROP_NODETYPENOCHILDREN = "nodetypenochildren";
+
     public static final String PROP_TESTROOT = "testroot";
 
     public static final String PROP_NODE_NAME1 = "nodename1";

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java?view=diff&rev=527261&r1=527260&r2=527261
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
Tue Apr 10 12:36:48 2007
@@ -310,8 +310,8 @@
     public void testAddNodeConstraintViolationExceptionUndefinedNodeType() throws RepositoryException
{
         // get default workspace test root node using superuser session
         Node defaultRootNode = (Node) superuser.getItem(testRootNode.getPath());
-
-        Node defaultTestNode = defaultRootNode.addNode(nodeName1, ntBase);
+        String nodetype = testNodeTypeNoChildren == null ? ntBase : testNodeTypeNoChildren;
+        Node defaultTestNode = defaultRootNode.addNode(nodeName1, nodetype);
 
         try {
             defaultTestNode.addNode(nodeName2);

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyTest.java?view=diff&rev=527261&r1=527260&r2=527261
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceCopyTest.java
Tue Apr 10 12:36:48 2007
@@ -73,7 +73,8 @@
      */
     public void testCopyNodesConstraintViolationException() throws RepositoryException {
         // if parent node is nt:base then no sub nodes can be created
-        Node subNodesNotAllowedNode = testRootNode.addNode(nodeName3, ntBase);
+        String nodetype = testNodeTypeNoChildren == null ? ntBase : testNodeTypeNoChildren;
+        Node subNodesNotAllowedNode = testRootNode.addNode(nodeName3, nodetype);
         testRootNode.save();
         try {
             String dstAbsPath = subNodesNotAllowedNode.getPath() + "/" + node2.getName();

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveTest.java?view=diff&rev=527261&r1=527260&r2=527261
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/WorkspaceMoveTest.java
Tue Apr 10 12:36:48 2007
@@ -72,7 +72,8 @@
      */
     public void testMoveNodesConstraintViolationException() throws RepositoryException {
         // if parent node is nt:base then no sub nodes can be created
-        Node subNodesNotAllowedNode = testRootNode.addNode(nodeName3, ntBase);
+        String nodetype = testNodeTypeNoChildren == null ? ntBase : testNodeTypeNoChildren;
+        Node subNodesNotAllowedNode = testRootNode.addNode(nodeName3, nodetype);
         testRootNode.save();
         try {
             String dstAbsPath = subNodesNotAllowedNode.getPath() + "/" + node2.getName();



Mime
View raw message