jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1342694 - in /jackrabbit/commons/ocm/trunk/src: main/java/org/apache/jackrabbit/ocm/manager/impl/ test/java/org/apache/jackrabbit/ocm/manager/basic/
Date Fri, 25 May 2012 15:43:43 GMT
Author: ard
Date: Fri May 25 15:43:42 2012
New Revision: 1342694

URL: http://svn.apache.org/viewvc?rev=1342694&view=rev
Log:
OCM-49 replace workspace move with session move. Still need to replace the ocm.copy with a
session copy instead of a workspace copy

Modified:
    jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AnnotationCopyMoveTest.java
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/DigesterCopyMoveTest.java

Modified: jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java?rev=1342694&r1=1342693&r2=1342694&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
Fri May 25 15:43:42 2012
@@ -1116,11 +1116,8 @@ public class ObjectContentManagerImpl im
      *      java.lang.String)
      */
     public void move(String srcPath, String destPath) {
-        Workspace workspace = session.getWorkspace();
         try {
-
-            workspace.move(srcPath, destPath);
-
+            session.move(srcPath, destPath);
         } catch (javax.jcr.nodetype.ConstraintViolationException cve) {
             throw new ObjectContentManagerException("Cannot move the object from " + srcPath
+ " to " + destPath + "."
                     + " Violation of a nodetype or attempt to move under a property detected",
cve);
@@ -1155,7 +1152,6 @@ public class ObjectContentManagerImpl im
         Workspace workspace = session.getWorkspace();
         try {
             workspace.copy(srcPath, destPath);
-
         } catch (javax.jcr.nodetype.ConstraintViolationException cve) {
             throw new ObjectContentManagerException("Cannot copy the object from " + srcPath
+ " to " + destPath + "."
                     + "Violation of a nodetype or attempt to copy under property detected
", cve);

Modified: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AnnotationCopyMoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AnnotationCopyMoveTest.java?rev=1342694&r1=1342693&r2=1342694&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AnnotationCopyMoveTest.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AnnotationCopyMoveTest.java
Fri May 25 15:43:42 2012
@@ -169,6 +169,7 @@ public class AnnotationCopyMoveTest exte
 			// Copy the object
 			// --------------------------------------------------------------------------------
         	ocm.move("/source", "/result");
+            ocm.save();
 
 			// --------------------------------------------------------------------------------
 			// Get the object
@@ -257,6 +258,7 @@ public class AnnotationCopyMoveTest exte
 			// Copy the object
 			// --------------------------------------------------------------------------------		

         	ocm.move("/source", "/result");
+            ocm.save();
         	// --------------------------------------------------------------------------------
 			// Get the object
 			// --------------------------------------------------------------------------------

Modified: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/DigesterCopyMoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/DigesterCopyMoveTest.java?rev=1342694&r1=1342693&r2=1342694&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/DigesterCopyMoveTest.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/manager/basic/DigesterCopyMoveTest.java
Fri May 25 15:43:42 2012
@@ -19,6 +19,9 @@ package org.apache.jackrabbit.ocm.manage
 import java.util.ArrayList;
 import java.util.Collection;
 
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -26,6 +29,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.ocm.DigesterTestBase;
 import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
+import org.apache.jackrabbit.ocm.repository.RepositoryUtil;
 import org.apache.jackrabbit.ocm.testmodel.A;
 import org.apache.jackrabbit.ocm.testmodel.Atomic;
 import org.apache.jackrabbit.ocm.testmodel.B;
@@ -169,6 +173,7 @@ public class DigesterCopyMoveTest extend
 			// Copy the object
 			// --------------------------------------------------------------------------------
         	ocm.move("/source", "/result");
+            ocm.save();
 
 			// --------------------------------------------------------------------------------
 			// Get the object
@@ -184,7 +189,7 @@ public class DigesterCopyMoveTest extend
 			// --------------------------------------------------------------------------------
 			try
 			{
-				ocm.move("/incorrectpath", "/test2");			
+				ocm.move("/incorrectpath", "/test2");
 				fail("the copy method accepts an incorrect source path");
 			} catch (ObjectContentManagerException e)
 			{
@@ -193,7 +198,8 @@ public class DigesterCopyMoveTest extend
 
 			try
 			{
-				ocm.move("/test", "incorrectpath");			
+				ocm.move("/test", "incorrectpath");
+
 				fail("the copy method accepts an incorrect destination path");
 			} catch (ObjectContentManagerException e)
 			{
@@ -252,11 +258,14 @@ public class DigesterCopyMoveTest extend
 			
 			ocm.insert(a);
         	ocm.save();
-			
+
 			// --------------------------------------------------------------------------------
-			// Copy the object
+			// Move the object
 			// --------------------------------------------------------------------------------		

         	ocm.move("/source", "/result");
+            //session = RepositoryUtil.login(repository, "superuser", "superuser");
+            ocm.save();
+
         	// --------------------------------------------------------------------------------
 			// Get the object
 			// --------------------------------------------------------------------------------
@@ -280,6 +289,5 @@ public class DigesterCopyMoveTest extend
         	fail();
 		}
 	}
-	
-	
+
 }
\ No newline at end of file



Mime
View raw message