jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r209740 - /incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/SerializationTest.java
Date Fri, 08 Jul 2005 11:55:01 GMT
Author: mreutegg
Date: Fri Jul  8 04:55:00 2005
New Revision: 209740

URL: http://svn.apache.org/viewcvs?rev=209740&view=rev
Log:
JCR-156: Review test cases and cross check with 1.0 specification
- setUp() should try to make the node versionable if possible

Modified:
    incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/SerializationTest.java

Modified: incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/SerializationTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/SerializationTest.java?rev=209740&r1=209739&r2=209740&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/SerializationTest.java
(original)
+++ incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/SerializationTest.java
Fri Jul  8 04:55:00 2005
@@ -25,13 +25,26 @@
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
 
-import javax.jcr.*;
 import javax.jcr.version.VersionException;
 import javax.jcr.lock.Lock;
 import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.*;
-import java.io.*;
-import java.util.ArrayList;
+import javax.jcr.Workspace;
+import javax.jcr.Session;
+import javax.jcr.RepositoryException;
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.InvalidSerializedDataException;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.ItemExistsException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.Reader;
+import java.io.ByteArrayInputStream;
+import java.io.FileOutputStream;
+import java.io.FileNotFoundException;
 
 /**
  * <code>SerializationTest</code> contains the test cases for the method
@@ -89,7 +102,11 @@
     protected Node initVersioningException(boolean returnParent) throws RepositoryException,
NotExecutableException, IOException {
         Node vNode = testRootNode.addNode(nodeName1, testNodeType);
         if (!vNode.isNodeType(mixVersionable)) {
-            throw new NotExecutableException("NodeType: " + testNodeType + " is not versionable");
+            if (vNode.canAddMixin(mixVersionable)) {
+                vNode.addMixin(mixVersionable);
+            } else {
+                throw new NotExecutableException("NodeType: " + testNodeType + " is not versionable");
+            }
         }
         Node vChild = vNode.addNode(nodeName2, testNodeType);
         session.save();



Mime
View raw message