jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r821778 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api: NodeSetPrimaryTypeTest.java SetPropertyConstraintViolationExceptionTest.java SetValueConstraintViolationExceptionTest.java
Date Mon, 05 Oct 2009 12:42:17 GMT
Author: mduerig
Date: Mon Oct  5 12:42:17 2009
New Revision: 821778

URL: http://svn.apache.org/viewvc?rev=821778&view=rev
Log:
JCR-2346: Dont use nt:frozenNode to create nodes

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeSetPrimaryTypeTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeSetPrimaryTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeSetPrimaryTypeTest.java?rev=821778&r1=821777&r2=821778&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeSetPrimaryTypeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeSetPrimaryTypeTest.java
Mon Oct  5 12:42:17 2009
@@ -16,9 +16,6 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-
 import javax.jcr.Node;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
@@ -26,11 +23,14 @@
 import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.nodetype.NodeType;
 import javax.jcr.version.VersionException;
 
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
 /**
  * <code>SetPrimaryType</code>...
  */
@@ -58,7 +58,7 @@
         while (nts.hasNext()) {
             NodeType nt = nts.nextNodeType();
             String ntName = nt.getName();
-            if (!nt.isAbstract()) {
+            if (!nt.isAbstract() && !ntFrozenNode.equals(ntName)) {
                 try {
                     node.setPrimaryType(ntName);
                     // property value must be adjusted immediately
@@ -93,7 +93,7 @@
     /**
      * Passing the current primary type to {@link Node#setPrimaryType(String)}
      * must always succeed.
-     * 
+     *
      * @throws RepositoryException
      */
     public void testSetCurrentType() throws RepositoryException {
@@ -114,7 +114,7 @@
      */
     public void testSetCurrentTypeOnNew() throws RepositoryException {
         Session session = testRootNode.getSession();
-        
+
         Node node = testRootNode.addNode(nodeName1, testNodeType);
         node.setPrimaryType(testNodeType);
         superuser.save();

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java?rev=821778&r1=821777&r2=821778&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyConstraintViolationExceptionTest.java
Mon Oct  5 12:42:17 2009
@@ -16,21 +16,22 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-import org.apache.jackrabbit.test.api.nodetype.NodeTypeUtil;
+import java.io.IOException;
+import java.io.InputStream;
 
-import javax.jcr.RepositoryException;
+import javax.jcr.Node;
 import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import javax.jcr.Node;
-import javax.jcr.nodetype.PropertyDefinition;
 import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeType;
-import java.io.InputStream;
-import java.io.IOException;
+import javax.jcr.nodetype.NodeTypeIterator;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.PropertyDefinition;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.test.api.nodetype.NodeTypeUtil;
 
 /**
  * <code>SetPropertyConstraintViolationExceptionTest</code> tests if
@@ -375,7 +376,7 @@
                 NodeType type = types.nextNodeType();
                 String name = type.getName();
                 for (int i = 0; i < constraints.length; i++) {
-                    if (name.equals(constraints[i])) {
+                    if (name.equals(constraints[i]) || ntFrozenNode.equals(name)) {
                         continue findNodeTypeNotSatisfied;
                     }
                     nodeTypeNotSatisfied = name;

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java?rev=821778&r1=821777&r2=821778&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueConstraintViolationExceptionTest.java
Mon Oct  5 12:42:17 2009
@@ -16,22 +16,23 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-import org.apache.jackrabbit.test.api.nodetype.NodeTypeUtil;
+import java.io.IOException;
+import java.io.InputStream;
 
-import javax.jcr.RepositoryException;
-import javax.jcr.PropertyType;
-import javax.jcr.Value;
 import javax.jcr.Node;
 import javax.jcr.Property;
-import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
 import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeType;
-import java.io.InputStream;
-import java.io.IOException;
+import javax.jcr.nodetype.NodeTypeIterator;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.PropertyDefinition;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.test.api.nodetype.NodeTypeUtil;
 
 /**
  * <code>SetValueConstraintViolationExceptionTest</code> tests if setValue()
@@ -417,7 +418,7 @@
                 NodeType type = types.nextNodeType();
                 String name = type.getName();
                 for (int i = 0; i < constraints.length; i++) {
-                    if (name.equals(constraints[i])) {
+                    if (name.equals(constraints[i]) || ntFrozenNode.equals(name)) {
                         continue findNodeTypeNotSatisfied;
                     }
                     nodeTypeNotSatisfied = name;
@@ -789,7 +790,7 @@
                 NodeType type = types.nextNodeType();
                 String name = type.getName();
                 for (int i = 0; i < constraints.length; i++) {
-                    if (name.equals(constraints[i])) {
+                    if (name.equals(constraints[i]) || ntFrozenNode.equals(name)) {
                         continue findNodeTypeNotSatisfied;
                     }
                     nodeTypeNotSatisfied = name;



Mime
View raw message