You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2007/06/04 21:52:08 UTC
svn commit: r544222 -
/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
Author: jukka
Date: Mon Jun 4 12:52:05 2007
New Revision: 544222
URL: http://svn.apache.org/viewvc?view=rev&rev=544222
Log:
1.3: Merged revision 530810 (JCR-856)
Modified:
jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java?view=diff&rev=544222&r1=544221&r2=544222
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java (original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java Mon Jun 4 12:52:05 2007
@@ -27,6 +27,7 @@
import javax.jcr.Value;
import javax.jcr.Repository;
import javax.jcr.ValueFormatException;
+import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NodeType;
import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -226,9 +227,17 @@
// get session an create default node
Node node = testRootNode.addNode(nodeName1, testNodeType);
- node.addMixin(mixReferenceable);
+ try {
+ node.addMixin(mixReferenceable);
+ }
+ catch (ConstraintViolationException ex) {
+ // can occur if the node type already inherits mix:referenceable
+ }
// implementation specific: mixin may take effect only upon save
testRootNode.save();
+
+ // check that it did
+ assertTrue(node.isNodeType(mixReferenceable));
// test if jcr:uuid is not null, empty or throws a exception
// (format of value is not defined so we can only test if not empty)