jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r820674 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api: NodeAddMixinTest.java NodeRemoveMixinTest.java
Date Thu, 01 Oct 2009 14:51:06 GMT
Author: mduerig
Date: Thu Oct  1 14:51:05 2009
New Revision: 820674

URL: http://svn.apache.org/viewvc?rev=820674&view=rev
Log:
JCR-2338: Tests not executable for already present mixins

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java?rev=820674&r1=820673&r2=820674&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
Thu Oct  1 14:51:05 2009
@@ -16,19 +16,19 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-
-import javax.jcr.version.VersionException;
-import javax.jcr.lock.LockException;
+import javax.jcr.Node;
+import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.Node;
 import javax.jcr.Value;
-import javax.jcr.Repository;
 import javax.jcr.ValueFormatException;
-import javax.jcr.nodetype.NodeType;
+import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.version.VersionException;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 /**
  * <code>NodeAddMixinTest</code> contains the test cases for the method
@@ -105,7 +105,7 @@
 
     /**
      * Test if adding the same mixin twice works as expected.
-     * 
+     *
      * @throws RepositoryException
      * @throws NotExecutableException
      * @since JCR 2.0
@@ -124,14 +124,14 @@
         node.addMixin(mixinName);
 
         session.save();
-        
+
         node.addMixin(mixinName);
         assertFalse(node.isModified());
     }
 
     /**
      * Test if adding an inherited mixin type has no effect.
-     * 
+     *
      * @throws RepositoryException
      * @since JCR 2.0
      */
@@ -238,7 +238,7 @@
         testRootNode.save();
 
         String mixinName = NodeMixinUtil.getAddableMixinName(session, node);
-        if (mixinName == null) {
+        if (mixinName == null || node.isNodeType(mixinName)) {
             throw new NotExecutableException("No testable mixin node type found");
         }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java?rev=820674&r1=820673&r2=820674&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
Thu Oct  1 14:51:05 2009
@@ -16,19 +16,19 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-
-import javax.jcr.version.VersionException;
-import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 import javax.jcr.Node;
-import javax.jcr.Property;
 import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
 import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.version.VersionException;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 /**
  * <code>NodeRemoveMixinTest</code> contains the test cases for the method
@@ -211,7 +211,7 @@
         testRootNode.save();
 
         String mixinName = NodeMixinUtil.getAddableMixinName(session, node);
-        if (mixinName == null) {
+        if (mixinName == null || node.isNodeType(mixinName)) {
             throw new NotExecutableException("No testable mixin node type found");
         }
 



Mime
View raw message