jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r548496 [2/5] - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src: dtd/ main/java/org/apache/jackrabbit/ocm/exception/ main/java/org/apache/jackrabbit/ocm/manager/ main/java/org/apache/jackrabbit/ocm/manager/beanconverter/...
Date Mon, 18 Jun 2007 21:46:48 GMT
Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/PersistenceManagerImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/PersistenceManagerImpl.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/PersistenceManagerImpl.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java Mon Jun 18 14:46:42 2007
@@ -44,7 +44,7 @@
 import org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException;
 import org.apache.jackrabbit.ocm.exception.JcrMappingException;
 import org.apache.jackrabbit.ocm.exception.LockedException;
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.exception.VersionException;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.DefaultAtomicTypeConverterProvider;
@@ -71,11 +71,11 @@
  * @author Martin Koci
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
  */
-public class PersistenceManagerImpl implements ObjectContentManager {
+public class ObjectContentManagerImpl implements ObjectContentManager {
     /**
      * Logger.
      */
-    private final static Log log = LogFactory.getLog(PersistenceManagerImpl.class);
+    private final static Log log = LogFactory.getLog(ObjectContentManagerImpl.class);
 
     /**
      * JCR session.
@@ -100,7 +100,7 @@
     protected ObjectCache requestObjectCache; 
 
     /**
-     * Creates a new <code>PersistenceManager</code> that uses the passed in
+     * Creates a new <code>ObjectContentManager</code> that uses the passed in
      * <code>Mapper</code>, <code>QueryManager</code> and a default 
      * <code>ObjectConverter</code>
      *
@@ -108,7 +108,7 @@
      * @param queryManager the query manager to used
      * @param session The JCR session
      */
-    public PersistenceManagerImpl(Mapper mapper,
+    public ObjectContentManagerImpl(Mapper mapper,
                                   QueryManager queryManager,
                                   Session session) {
         this.mapper = mapper;
@@ -120,12 +120,12 @@
     }
 
     /**
-     * Creates a new <code>PersistenceManager</code> based on a JCR session and some xml mapping files. 
+     * Creates a new <code>ObjectContentManager</code> based on a JCR session and some xml mapping files. 
      *
      * @param session The JCR session
      * @param xmlMappingFiles the JCR mapping files used mainly to create the <code>Mapper</code> component
      */
-    public PersistenceManagerImpl(Session session,String[] xmlMappingFiles ) 
+    public ObjectContentManagerImpl(Session session,String[] xmlMappingFiles ) 
     {
         try 
         {
@@ -140,7 +140,7 @@
         catch (RepositoryException e) 
         {
             throw new org.apache.jackrabbit.ocm.exception.RepositoryException(
-                    "Impossible to instantiate the persistence manager", e);
+                    "Impossible to instantiate the object content manager", e);
 
 		}
         
@@ -155,7 +155,7 @@
      * @param queryManager the query manager to used
      * @param session The JCR session
      */
-    public PersistenceManagerImpl(Mapper mapper,
+    public ObjectContentManagerImpl(Mapper mapper,
                                   ObjectConverter converter,
                                   QueryManager queryManager,
                                   ObjectCache requestObjectCache,
@@ -168,7 +168,7 @@
     }
     
     /**
-     * Sets the <code>Mapper</code> used by this persistence manager.
+     * Sets the <code>Mapper</code> used by this object content manager.
      * 
      * @param mapper mapping solver
      */
@@ -177,7 +177,7 @@
     }
     
     /**
-     * Sets the <code>ObjectConverter</code> that is used internally by this persistence manager.
+     * Sets the <code>ObjectConverter</code> that is used internally by this object content manager.
      * 
      * @param objectConverter the internal <code>ObjectConverter</code>
      */
@@ -186,7 +186,7 @@
     }
     
     /**
-     * Sets the <code>QueryManager</code> used by the persistence manager.
+     * Sets the <code>QueryManager</code> used by the object content manager.
      * 
      * @param queryManager a <code>QueryManager</code>
      */
@@ -205,7 +205,7 @@
      * @throws org.apache.jackrabbit.ocm.exception.RepositoryException if the underlying repository
      *  has thrown a javax.jcr.RepositoryException
      * @throws JcrMappingException if the mapping for the class is not correct
-     * @throws PersistenceException if the object cannot be retrieved from the path
+     * @throws ObjectContentManagerException if the object cannot be retrieved from the path
      */
     public Object getObject( String path) {
         try {
@@ -230,7 +230,7 @@
      * @throws org.apache.jackrabbit.ocm.exception.RepositoryException if the underlying repository
      *  has thrown a javax.jcr.RepositoryException
      * @throws JcrMappingException if the mapping for the class is not correct
-     * @throws PersistenceException if the object cannot be retrieved from the path
+     * @throws ObjectContentManagerException if the object cannot be retrieved from the path
      */
     public Object getObjectByUuid( String uuid) {
         
@@ -280,7 +280,7 @@
      * @throws org.apache.jackrabbit.ocm.exception.RepositoryException if the underlying repository
      *  has thrown a javax.jcr.RepositoryException
      * @throws JcrMappingException if the mapping for the class is not correct
-     * @throws PersistenceException if the object cannot be retrieved from the path
+     * @throws ObjectContentManagerException if the object cannot be retrieved from the path
      */
     public Object getObject(Class objectClass, String path) {
         try {
@@ -351,12 +351,12 @@
                 Item item = session.getItem(path);
                 if (item.isNode()) {
                     if (!((Node) item).getDefinition().allowsSameNameSiblings()) {
-                        throw new PersistenceException("Path already exists and it is not supporting the same name sibling : "
+                        throw new ObjectContentManagerException("Path already exists and it is not supporting the same name sibling : "
                                                        + path);
                     }
                 } 
                 else {
-                    throw new PersistenceException("Path already exists and it is a property : "
+                    throw new ObjectContentManagerException("Path already exists and it is a property : "
                                                    + path);
                 }
 
@@ -377,7 +377,7 @@
         String path = objectConverter.getPath(session, object);
         try {
             if (!session.itemExists(path)) {
-                throw new PersistenceException("Path is not existing : " + path);
+                throw new ObjectContentManagerException("Path is not existing : " + path);
             } 
             else {
                 checkIfNodeLocked(path);
@@ -397,7 +397,7 @@
     public void remove(String path) {
         try {
             if (!session.itemExists(path)) {
-                throw new PersistenceException("Path does not exist : " + path);
+                throw new ObjectContentManagerException("Path does not exist : " + path);
             } 
             else {
                 checkIfNodeLocked(path);
@@ -454,7 +454,7 @@
                     node.remove();
                 }
                 catch(javax.jcr.RepositoryException re) {
-                    throw new PersistenceException("Cannot remove node at path " 
+                    throw new ObjectContentManagerException("Cannot remove node at path " 
                             + node.getPath() + " returned from query "
                             + jcrExpression,
                             re);
@@ -517,7 +517,7 @@
             NodeIterator nodeIterator = queryResult.getNodes();
 
             if (nodeIterator.getSize() > 1) {
-                throw new PersistenceException("Impossible to get the object - the query returns more than one object");
+                throw new ObjectContentManagerException("Impossible to get the object - the query returns more than one object");
             }
 
             Object object = null;
@@ -627,13 +627,13 @@
             }
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(InvalidItemStateException iise) {
-            throw new PersistenceException("Cannot checking modified object at path " + path, iise);
+            throw new ObjectContentManagerException("Cannot checking modified object at path " + path, iise);
         }
         catch(javax.jcr.version.VersionException ve) {
             throw new VersionException("Impossible to checkin the object " + path, ve);
@@ -666,10 +666,10 @@
             node.checkout();
         }         
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(UnsupportedRepositoryOperationException uroe) {
             throw new VersionException("Cannot checkout unversionable node at path " + path, uroe);
@@ -699,10 +699,10 @@
             history.addVersionLabel(versionName, versionLabel, false);
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(javax.jcr.version.VersionException ve) {
             throw new VersionException("Impossible to add a new version label to  " + path
@@ -735,10 +735,10 @@
             return new Version(history.getVersion(versionName));
         }
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(javax.jcr.version.VersionException ve) {
             throw new VersionException("The version name " + versionName + "does not exist", ve);
@@ -768,10 +768,10 @@
             return history.getVersionLabels(version);
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(javax.jcr.version.VersionException ve) {
             throw new VersionException("Impossible to get the version labels : " + path
@@ -801,10 +801,10 @@
             return history.getVersionLabels();
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(UnsupportedRepositoryOperationException uroe) {
             throw new VersionException("Impossible to retrieve version history for path " + path, uroe);
@@ -831,10 +831,10 @@
             return new VersionIterator(history.getAllVersions());
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(UnsupportedRepositoryOperationException uroe) {
             throw new VersionException("Impossible to retrieve version history for path " + path, uroe);
@@ -860,10 +860,10 @@
             return new Version(history.getRootVersion());
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(UnsupportedRepositoryOperationException uroe) {
             throw new VersionException("Impossible to get the root version  for the object " + path,
@@ -888,10 +888,10 @@
             return new Version(node.getBaseVersion());
         } 
         catch(ClassCastException cce) {
-            throw new PersistenceException("Cannot retrieve an object from a property path " + path);
+            throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
         }
         catch(PathNotFoundException pnfe) {
-            throw new PersistenceException("Cannot retrieve an object at path " + path, pnfe);
+            throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
         }
         catch(UnsupportedRepositoryOperationException uroe) {
             throw new VersionException("Impossible to get the base version for the object " + path,
@@ -1038,11 +1038,11 @@
 
     protected Node getNode(final String absPath) throws PathNotFoundException, RepositoryException {
         if (!getSession().itemExists(absPath)) {
-            throw new PersistenceException("No object stored on path: " + absPath);
+            throw new ObjectContentManagerException("No object stored on path: " + absPath);
         }
         Item item = getSession().getItem(absPath);
         if (!item.isNode()) {
-            throw new PersistenceException("No object stored on path: " + absPath
+            throw new ObjectContentManagerException("No object stored on path: " + absPath
                                            + " on absPath is item (leaf)");
         }
 
@@ -1069,11 +1069,11 @@
                     "Cannot persist current session changes. Attempt to overwrite checked-in node", ve);
         }
         catch(LockException le) {
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot persist current session changes. Violation of a lock detected", le);
         }
         catch(javax.jcr.RepositoryException e) {
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot persist current session changes.", e);
         }
     }
@@ -1095,11 +1095,11 @@
                     "Cannot persist current session changes. Attempt to overwrite checked-in node", ve);
         }
         catch(LockException le) {
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot persist current session changes. Violation of a lock detected", le);
         }
         catch(RepositoryException e) {
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot persist current session changes.", e);
         }
     }
@@ -1117,7 +1117,7 @@
 		    session.refresh(keepChanges);
 		}
         catch(RepositoryException e) {
-            throw new PersistenceException("Cannot refresh current session ", e);
+            throw new ObjectContentManagerException("Cannot refresh current session ", e);
         }
 	}
     
@@ -1132,7 +1132,7 @@
         	workspace.move(srcPath,destPath);
             
         }catch(javax.jcr.nodetype.ConstraintViolationException cve){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot move the object from " + srcPath + " to " + destPath + "." + " Violation of a nodetype or attempt to move under a property detected", cve);
             
         }catch(javax.jcr.version.VersionException ve){
@@ -1140,23 +1140,23 @@
                     "Cannot move the object from " + srcPath + " to " + destPath + "." + " Parent node of source or destination is versionable and checked in ", ve);
             
         }catch(javax.jcr.AccessDeniedException ade){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot move the object from " + srcPath + " to " + destPath + "." + " Session does not have access permissions", ade);
             
         }catch(javax.jcr.PathNotFoundException pnf){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot move the object from " + srcPath + " to " + destPath + "." + " Node at source or destination does not exist ", pnf);
             
         }catch(javax.jcr.ItemExistsException ie){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot move the object from " + srcPath + " to " + destPath + "." + " It might already exist at destination path.", ie);
             
         }catch(javax.jcr.lock.LockException le){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot move the object from " + srcPath + " to " + destPath + "." + "Violation of a lock detected", le);
             
         }catch(javax.jcr.RepositoryException re){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot move the object from " + srcPath + " to " + destPath + "." , re);
         }   
     }
@@ -1171,7 +1171,7 @@
             workspace.copy(srcPath,destPath);
             
         }catch(javax.jcr.nodetype.ConstraintViolationException cve){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot copy the object from " + srcPath + " to " + destPath + "." + "Violation of a nodetype or attempt to copy under property detected ", cve);
             
         }catch(javax.jcr.version.VersionException ve){
@@ -1179,23 +1179,23 @@
                     "Cannot copy the object from " + srcPath + " to " + destPath + "." + "Parent node of source or destination is versionable and checked in ", ve);
             
         }catch(javax.jcr.AccessDeniedException ade){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot copy the object from " + srcPath + " to " + destPath + "." + " Session does not have access permissions", ade);
             
         }catch(javax.jcr.PathNotFoundException pnf){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot copy the object from " + srcPath + " to " + destPath + "." + "Node at source or destination does not exist ", pnf);
             
         }catch(javax.jcr.ItemExistsException ie){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot copy the object from " + srcPath + " to " + destPath + "." + "It might already exist at destination path.", ie);
             
         }catch(javax.jcr.lock.LockException le){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot copy the object from " + srcPath + " to " + destPath + "." + "Violation of a lock detected", le);
             
         }catch(javax.jcr.RepositoryException re){
-            throw new PersistenceException(
+            throw new ObjectContentManagerException(
                     "Cannot copy the node from " + srcPath + " to " + destPath + "." , re);
         }
     }    

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerUtil.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/PersistenceUtil.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerUtil.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/PersistenceUtil.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerUtil.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/PersistenceUtil.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerUtil.java Mon Jun 18 14:46:42 2007
@@ -19,20 +19,20 @@
 import javax.jcr.Node;
 import javax.jcr.Session;
 
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.exception.RepositoryException;
 import org.apache.jackrabbit.ocm.mapper.model.BeanDescriptor;
 
 
 /**
-* Utility class for used in the persistence manager and in the converters
+* Utility class for used in the object content manager and in the converters
 *
 * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
 */
-public class PersistenceUtil
+public class ObjectContentManagerUtil
 {
 	
-    public static String getPath(Session session, BeanDescriptor beanDescriptor, Node parentNode) throws PersistenceException
+    public static String getPath(Session session, BeanDescriptor beanDescriptor, Node parentNode) throws ObjectContentManagerException
     {		
 		 try 
 		 {

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/ObjectConverter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/ObjectConverter.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/ObjectConverter.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/ObjectConverter.java Mon Jun 18 14:46:42 2007
@@ -19,7 +19,7 @@
 import javax.jcr.Node;
 import javax.jcr.Session;
 
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 
 
 /**
@@ -35,19 +35,19 @@
 	 * 
 	 * @param session the JCR session  
 	 * @param object the object to insert
-	 * @throws PersistenceException when it is not possible to insert the object
+	 * @throws ObjectContentManagerException when it is not possible to insert the object
 	 * 
 	 */
-    public void insert(Session session, Object object) throws PersistenceException;
+    public void insert(Session session, Object object) throws ObjectContentManagerException;
     
 	/**
 	 * Update the object 
 	 * 
 	 * @param session the JCR session 
 	 * @param object the object to update
-	 * @throws PersistenceException when it is not possible to update the object
+	 * @throws ObjectContentManagerException when it is not possible to update the object
 	 */    
-    public void update(Session session, Object object) throws PersistenceException;
+    public void update(Session session, Object object) throws ObjectContentManagerException;
     
     /**
      * Retrieve an object from the JCR repo
@@ -57,9 +57,9 @@
      * @param path the JCR path
      * @return The object found or null
      * 
-     * @throws PersistenceException when it is not possible to retrieve the object
+     * @throws ObjectContentManagerException when it is not possible to retrieve the object
      */
-    public Object getObject(Session session, String path) throws PersistenceException;
+    public Object getObject(Session session, String path) throws ObjectContentManagerException;
     
     /**
      * Retrieve an object from the JCR repo
@@ -69,9 +69,9 @@
      * @param path the JCR path
      * @return The object found or null
      * 
-     * @throws PersistenceException when it is not possible to retrieve the object
+     * @throws ObjectContentManagerException when it is not possible to retrieve the object
      */
-    public Object getObject(Session session, Class clazz, String path) throws PersistenceException;
+    public Object getObject(Session session, Class clazz, String path) throws ObjectContentManagerException;
     
     
     /**
@@ -100,9 +100,9 @@
 	 * @param parentNode The parent node used to store the new JCR element (object) 
 	 * @param nodeName The node name used to store the object
 	 * @param object the object to insert
-	 * @throws PersistenceException when it is not possible to insert the object
+	 * @throws ObjectContentManagerException when it is not possible to insert the object
 	 */
-    public void insert(Session session, Node parentNode, String nodeName, Object object) throws PersistenceException;
+    public void insert(Session session, Node parentNode, String nodeName, Object object) throws ObjectContentManagerException;
     
 	/**
 	 * Update the object 
@@ -111,9 +111,9 @@
 	 * @param parentNode The parent node used to store the new JCR element (object) 
 	 * @param nodeName The node name used to store the object
 	 * @param object the object to update
-	 * @throws PersistenceException when it is not possible to update the object
+	 * @throws ObjectContentManagerException when it is not possible to update the object
 	 */    
-    public void update(Session session, Node parentNode, String nodeName, Object object) throws PersistenceException;
+    public void update(Session session, Node parentNode, String nodeName, Object object) throws ObjectContentManagerException;
     
    
     /**
@@ -122,8 +122,8 @@
      * @param session the JCR session 
      * @param object the object for which the path has to be retrieve 
      * @return the object JCR path 
-     * @throws PersistenceException when it is not possible to retrieve the object path
+     * @throws ObjectContentManagerException when it is not possible to retrieve the object path
      */
-    public String getPath(Session session , Object object)  throws PersistenceException;
+    public String getPath(Session session , Object object)  throws ObjectContentManagerException;
 
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/ObjectConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/ObjectConverterImpl.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/ObjectConverterImpl.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/ObjectConverterImpl.java Mon Jun 18 14:46:42 2007
@@ -31,7 +31,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.ocm.exception.JcrMappingException;
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.manager.ManagerConstant;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.AtomicTypeConverterProvider;
 import org.apache.jackrabbit.ocm.manager.beanconverter.BeanConverter;
@@ -41,7 +41,7 @@
 import org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableCollection;
 import org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableCollectionUtil;
 import org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultCollectionConverterImpl;
-import org.apache.jackrabbit.ocm.manager.impl.PersistenceUtil;
+import org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerUtil;
 import org.apache.jackrabbit.ocm.manager.objectconverter.ObjectConverter;
 import org.apache.jackrabbit.ocm.manager.objectconverter.ProxyManager;
 import org.apache.jackrabbit.ocm.mapper.Mapper;
@@ -60,7 +60,7 @@
  */
 public class ObjectConverterImpl implements ObjectConverter {
 
-	private static final String DEFAULT_BEAN_CONVERTER = "org.apache.jackrabbit.ocm.persistence.beanconverter.impl.DefaultBeanConverterImpl";
+	private static final String DEFAULT_BEAN_CONVERTER = "org.apache.jackrabbit.ocm.manager.beanconverter.impl.DefaultBeanConverterImpl";
 
 	private final static Log log = LogFactory.getLog(ObjectConverterImpl.class);
 
@@ -146,7 +146,7 @@
 			this.insert(session, parentNode, nodeName, object);
 
 		} catch (PathNotFoundException pnfe) {
-			throw new PersistenceException("Impossible to insert the object at '" + path + "'", pnfe);
+			throw new ObjectContentManagerException("Impossible to insert the object at '" + path + "'", pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to insert the object at '" + path
 					+ "'", re);
@@ -173,7 +173,7 @@
 		} catch (NoSuchNodeTypeException nsnte) {
 			throw new JcrMappingException("Unknown node type " + jcrNodeType + " for mapped class " + object.getClass(), nsnte);
 		} catch (RepositoryException re) {
-			throw new PersistenceException("Cannot create new node of type " + jcrNodeType + " from mapped class "
+			throw new ObjectContentManagerException("Cannot create new node of type " + jcrNodeType + " from mapped class "
 					+ object.getClass(), re);
 		}
 
@@ -212,7 +212,7 @@
 		} catch (NoSuchNodeTypeException nsnte) {
 			throw new JcrMappingException("Unknown mixin type " + mixinTypeName + " for mapped class " + object.getClass(), nsnte);
 		} catch (RepositoryException re) {
-			throw new PersistenceException("Cannot create new node of type " + jcrNodeType + " from mapped class "
+			throw new ObjectContentManagerException("Cannot create new node of type " + jcrNodeType + " from mapped class "
 					+ object.getClass(), re);
 		}
 
@@ -233,7 +233,7 @@
 			Node parentNode = (Node) session.getItem(parentPath);
 			this.update(session, parentNode, nodeName, object);
 		} catch (PathNotFoundException pnfe) {
-			throw new PersistenceException("Impossible to update the object at '" + path + "'", pnfe);
+			throw new ObjectContentManagerException("Impossible to update the object at '" + path + "'", pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to update the object at '" + path
 					+ "'", re);
@@ -258,7 +258,7 @@
 			updateBeanFields(session, object, classDescriptor, objectNode);
 			updateCollectionFields(session, object, classDescriptor, objectNode);
 		} catch (PathNotFoundException pnfe) {
-			throw new PersistenceException("Impossible to update the object: " + nodeName + " at node : " + parentNode, pnfe);
+			throw new ObjectContentManagerException("Impossible to update the object: " + nodeName + " at node : " + parentNode, pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to update the object: "
 					+ nodeName + " at node : " + parentNode, re);
@@ -310,11 +310,10 @@
 			retrieveCollectionFields(session, classDescriptor, node, object, false);
 			
 			return object;
-//		} catch (ClassNotFoundException clnf) {
-//			throw new PersistenceException("Impossible to instantiate the object at " + path, clnf);
+		
 		} catch (PathNotFoundException pnfe) {
 			// HINT should never get here
-			throw new PersistenceException("Impossible to get the object at " + path, pnfe);
+			throw new ObjectContentManagerException("Impossible to get the object at " + path, pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object at " + path, re);
 		}
@@ -350,7 +349,7 @@
 			Object object = null;
 			if (classDescriptor.usesNodeTypePerHierarchyStrategy()) {
 				if (!node.hasProperty(ManagerConstant.DISCRIMINATOR_PROPERTY_NAME)) {
-					throw new PersistenceException("Cannot fetch object of type '" + clazz.getName()
+					throw new ObjectContentManagerException("Cannot fetch object of type '" + clazz.getName()
 							+ "' using NODETYPE_PER_HIERARCHY. Discriminator property is not present.");
 				}
 
@@ -378,11 +377,9 @@
 			retrieveCollectionFields(session, classDescriptor, node, object, false);
 			
 			return object;
-//		} catch (ClassNotFoundException clnf) {
-//			throw new PersistenceException("Impossible to instantiate the object at " + path, clnf);
 		} catch (PathNotFoundException pnfe) {
 			// HINT should never get here
-			throw new PersistenceException("Impossible to get the object at " + path, pnfe);
+			throw new ObjectContentManagerException("Impossible to get the object at " + path, pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object at " + path, re);
 		}
@@ -400,7 +397,7 @@
 			
 		} catch (PathNotFoundException pnfe) {
 
-			throw new PersistenceException("Impossible to get the object at " + path, pnfe);
+			throw new ObjectContentManagerException("Impossible to get the object at " + path, pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object at " + path, re);
 		}
@@ -429,14 +426,14 @@
 				}
 				else
 				{
-					throw new PersistenceException("Impossible to retrieve the mapped attribute. The attribute '" + 
+					throw new ObjectContentManagerException("Impossible to retrieve the mapped attribute. The attribute '" + 
 							                                                         attributeName + "'  is not a bean or a collection for the class : " + classDescriptor.getClassName());
 				}
 			}
 			
 		} catch (PathNotFoundException pnfe) {
 
-			throw new PersistenceException("Impossible to get the object at " + path, pnfe);
+			throw new ObjectContentManagerException("Impossible to get the object at " + path, pnfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object at " + path, re);
 		}
@@ -494,7 +491,7 @@
 	 *            <tt>node</tt> is a version node, <tt>false</tt> if no
 	 *            check against version node should be performed
 	 * 
-	 * @throws PersistenceException
+	 * @throws ObjectContentManagerException
 	 *             thrown if node types are incompatible
 	 * @throws org.apache.jackrabbit.ocm.exception.RepositoryException
 	 *             thrown if an error occured in the underlying repository
@@ -514,7 +511,7 @@
 			}
 
 			if (!compatible) {
-				throw new PersistenceException("Cannot map object of type '" + classDescriptor.getClassName() + "'. Node type '"
+				throw new ObjectContentManagerException("Cannot map object of type '" + classDescriptor.getClassName() + "'. Node type '"
 						+ node.getPrimaryNodeType().getName() + "' does not match descriptor node type '"
 						+ classDescriptor.getJcrNodeType() + "'");
 			}
@@ -596,7 +593,7 @@
 		
 
 		String beanName = beanDescriptor.getFieldName();
-		String beanPath = PersistenceUtil.getPath(session, beanDescriptor, node);
+		String beanPath = ObjectContentManagerUtil.getPath(session, beanDescriptor, node);
 	    
 		Object bean = null;
 		if (requestObjectCache.isCached(beanPath))

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/SimpleFieldsHelper.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/SimpleFieldsHelper.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/SimpleFieldsHelper.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/SimpleFieldsHelper.java Mon Jun 18 14:46:42 2007
@@ -34,7 +34,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.ocm.exception.JcrMappingException;
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.manager.ManagerConstant;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.AtomicTypeConverter;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.AtomicTypeConverterProvider;
@@ -86,7 +86,7 @@
 			{
 				if (!node.hasProperty(ManagerConstant.DISCRIMINATOR_PROPERTY_NAME)) 
 				{
-					throw new PersistenceException("Class '"
+					throw new ObjectContentManagerException("Class '"
 							+ classDescriptor.getClassName()
 							+ "' has not a discriminator property.");
 				}
@@ -121,7 +121,7 @@
 
 			}
 		} catch (ValueFormatException vfe) {
-			throw new PersistenceException(
+			throw new ObjectContentManagerException(
 					"Cannot retrieve properties of object " + object + " from node " + node, vfe);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException( "Cannot retrieve properties of object " + object
@@ -174,13 +174,13 @@
 				storeSimpleField(object, objectNode, valueFactory, fieldDescriptor, fieldName, jcrName);
 			}
 		} catch (ValueFormatException vfe) {
-			throw new PersistenceException("Cannot persist properties of object " + object + ". Value format exception.", vfe);
+			throw new ObjectContentManagerException("Cannot persist properties of object " + object + ". Value format exception.", vfe);
 		} catch (VersionException ve) {
-			throw new PersistenceException("Cannot persist properties of object " + object + ". Versioning exception.", ve);
+			throw new ObjectContentManagerException("Cannot persist properties of object " + object + ". Versioning exception.", ve);
 		} catch (LockException le) {
-			throw new PersistenceException("Cannot persist properties of object " + object + " on locked node.", le);
+			throw new ObjectContentManagerException("Cannot persist properties of object " + object + " on locked node.", le);
 		} catch (ConstraintViolationException cve) {
-			throw new PersistenceException("Cannot persist properties of object " + object + ". Constraint violation.", cve);
+			throw new ObjectContentManagerException("Cannot persist properties of object " + object + ". Constraint violation.", cve);
 		} catch (RepositoryException re) {
 			throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Cannot persist properties of object "
 					+ object, re);
@@ -259,7 +259,7 @@
 		for (int i = 0; i < propertyDefinitions.length; i++) {
 			PropertyDefinition definition = propertyDefinitions[i];
 			if (definition.getName().equals(fieldDescriptor.getJcrName()) && definition.isMandatory() && (value == null)) {
-				throw new PersistenceException("Class of type:" + fieldDescriptor.getClassDescriptor().getClassName()
+				throw new ObjectContentManagerException("Class of type:" + fieldDescriptor.getClassDescriptor().getClassName()
 						+ " has property: " + fieldDescriptor.getFieldName() + " declared as JCR property: "
 						+ fieldDescriptor.getJcrName() + " This property is mandatory but property in bean has value null");
 			}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/repository/RepositoryUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/repository/RepositoryUtil.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/repository/RepositoryUtil.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/repository/RepositoryUtil.java Mon Jun 18 14:46:42 2007
@@ -28,7 +28,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.core.jndi.RegistryHelper;
 import org.apache.jackrabbit.ocm.exception.JcrMappingException;
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.exception.RepositoryException;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.jackrabbit.util.Text;
@@ -185,9 +185,9 @@
      * @param path The path from wich the parent path has to be returned
      * @return The parent path
      * 
-     * @throws PersistenceException when the path is invalid
+     * @throws ObjectContentManagerException when the path is invalid
      */
-    public static String getParentPath(String path) throws PersistenceException
+    public static String getParentPath(String path) throws ObjectContentManagerException
     {
         String parentPath = "";
         
@@ -221,9 +221,9 @@
      * @param path  The path from which the node name has to be retrieved
      * @return The node name
      * 
-     * @throws PersistenceException when the path is invalid
+     * @throws ObjectContentManagerException when the path is invalid
      */
-    public static String getNodeName(String path)  throws PersistenceException
+    public static String getNodeName(String path)  throws ObjectContentManagerException
     {
         
         String[] pathElements = path.split(PATH_SEPARATOR);

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/TestBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/TestBase.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/TestBase.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/TestBase.java Mon Jun 18 14:46:42 2007
@@ -63,8 +63,8 @@
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.StringTypeConverterImpl;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.TimestampTypeConverterImpl;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.UtilDateTypeConverterImpl;
-import org.apache.jackrabbit.ocm.manager.impl.PersistenceManagerImpl;
-import org.apache.jackrabbit.ocm.manager.inheritance.PersistenceManagerInheritanceHierarchyTest;
+import org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl;
+import org.apache.jackrabbit.ocm.manager.inheritance.ObjectContentManagerInheritanceHierarchyTest;
 import org.apache.jackrabbit.ocm.manager.objectconverter.ObjectConverter;
 import org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl;
 import org.apache.jackrabbit.ocm.mapper.Mapper;
@@ -91,7 +91,7 @@
 	
 	protected Session session;
 
-	protected ObjectContentManager persistenceManager;
+	protected ObjectContentManager ocm;
 
 	protected Mapper mapper;
     
@@ -121,7 +121,7 @@
 			super.setUp();
 	        
 	        if (!isInit) {
-	            initPersistenceManager();
+	            initObjectContentManager();
 	            registerNodeTypes(getSession());
 	            isInit = true;
 	        }
@@ -142,20 +142,20 @@
 	}
 
 	/**
-	 * Getter for property persistenceManager.
+	 * Getter for property ocm.
 	 * 
 	 * @return jcrSession
 	 */
-	public ObjectContentManager getPersistenceManager()
+	public ObjectContentManager getObjectContentManager()
 	{
 		try
 		{
-			if (persistenceManager == null)
+			if (ocm == null)
 			{
-				initPersistenceManager();
+				initObjectContentManager();
                 registerNodeTypes(getSession());
 			}
-			return persistenceManager;
+			return ocm;
 		}
 		catch (Exception e)
 		{
@@ -190,7 +190,7 @@
         }
     }
     
-	protected void initPersistenceManager() throws UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
+	protected void initObjectContentManager() throws UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
 	{
 		Repository repository = RepositoryUtil.getRepository("repositoryTest");
 		String[] files = { "./src/test/test-config/jcrmapping.xml", 
@@ -201,19 +201,19 @@
                            "./src/test/test-config/jcrmapping-jcrnodetypes.xml", 
                            "./src/test/test-config/jcrmapping-uuid.xml"};
 		session = RepositoryUtil.login(repository, "superuser", "superuser");
-		persistenceManager = new PersistenceManagerImpl(session, files);
+		ocm = new ObjectContentManagerImpl(session, files);
 		
 	}
 
 	/**
 	 * Setter for property jcrSession.
 	 * 
-	 * @param persistenceManager
-	 *            The persistence manager
+	 * @param ocm
+	 *            The object content manager
 	 */
-	public void setPersistenceManager(ObjectContentManager persistenceManager)
+	public void setObjectContentManager(ObjectContentManager ocm)
 	{
-		this.persistenceManager = persistenceManager;
+		this.ocm = ocm;
 	}
 
 	public void exportDocument(String filePath, String nodePath, boolean skipBinary, boolean noRecurse)
@@ -257,7 +257,7 @@
 
 	public QueryManager getQueryManager()
 	{
-		return persistenceManager.getQueryManager();
+		return ocm.getQueryManager();
 	}
 	
     protected boolean contains(Collection result, String path, Class objectClass)

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AllTests.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AllTests.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AllTests.java Mon Jun 18 14:46:42 2007
@@ -34,7 +34,7 @@
     }
 
     public static Test buildSuite() {
-        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.jcr.persistence.atomic");
+        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.jcr.manager.atomic");
         //$JUnit-BEGIN$
         suite.addTestSuite(AtomicTest.class);
         suite.addTestSuite(NullAtomicTest.class);        

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AtomicTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AtomicTest.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AtomicTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/AtomicTest.java Mon Jun 18 14:46:42 2007
@@ -67,7 +67,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
         	Date date = new Date();
         	Calendar calendar = Calendar.getInstance();
             // --------------------------------------------------------------------------------
@@ -97,15 +97,15 @@
             a.setPathProperty("/node1/node2");
             a.setUndefinedProperty("aStringData");
             
-            persistenceManager.insert(a);
-            persistenceManager.save();
+            ocm.insert(a);
+            ocm.save();
 
              
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------
             a = null;
-            a = (Atomic) persistenceManager.getObject( "/test");
+            a = (Atomic) ocm.getObject( "/test");
             assertNotNull("a is null", a);
             assertNotNull("Boolean object is null", a.getBooleanObject());
             assertTrue("Incorrect boolean object", a.getBooleanObject().booleanValue());
@@ -144,9 +144,9 @@
             {
                // update with an incorrect namespace - Should throws an exception
                a.setNamedProperty("unknown:test");               
-               persistenceManager.update(a);
+               ocm.update(a);
                fail("Exception was not triggered with an invalid namespace");
-               persistenceManager.save();
+               ocm.save();
             }
             catch (Exception e)
             {
@@ -161,9 +161,9 @@
             {
                // update with an incorrect namespace - Should throws an exception
                a.setPathProperty("//node1");               
-               persistenceManager.update(a);
+               ocm.update(a);
                fail("Exception was not triggered with an invalid path");
-               persistenceManager.save();
+               ocm.save();
             }
             catch (Exception e)
             {
@@ -175,17 +175,17 @@
             // Update the property "undefinedProperty" with an invalid value
             // --------------------------------------------------------------------------------            
             a = null;
-            a = (Atomic) persistenceManager.getObject( "/test");
+            a = (Atomic) ocm.getObject( "/test");
 
             a.setUndefinedProperty(new Double(1.2));
-            persistenceManager.update(a);
-            persistenceManager.save();
+            ocm.update(a);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------
             a = null;
-            a = (Atomic) persistenceManager.getObject( "/test");
+            a = (Atomic) ocm.getObject( "/test");
             assertNotNull("a is null", a);
             assertTrue("Invalid undefinedProperty value ", ((Double) a.getUndefinedProperty()).doubleValue() == 1.2);
             

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/NullAtomicTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/NullAtomicTest.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/NullAtomicTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/atomic/NullAtomicTest.java Mon Jun 18 14:46:42 2007
@@ -67,7 +67,7 @@
         try
         {
 
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
      
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
@@ -85,14 +85,14 @@
             ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("Test Stream".getBytes());
             a.setInputStream(byteArrayInputStream);
             
-            persistenceManager.insert(a);
-            persistenceManager.save();
+            ocm.insert(a);
+            ocm.save();
              
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------
             a = null;
-            a = (Atomic) persistenceManager.getObject( "/test");
+            a = (Atomic) ocm.getObject( "/test");
             assertNotNull("a is null", a);
             assertNull("Boolean object is not null", a.getBooleanObject());
             

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/AllTests.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/AllTests.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/AllTests.java Mon Jun 18 14:46:42 2007
@@ -34,9 +34,9 @@
     }
 
     public static Test buildSuite() {
-        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.persistence.auto");
+        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.manager.auto");
         //$JUnit-BEGIN$
-        suite.addTestSuite(PersistenceManagerAutoTest.class);
+        suite.addTestSuite(ObjectContentManagerAutoTest.class);
 
         //$JUnit-END$
 

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/ObjectContentManagerAutoTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/PersistenceManagerAutoTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/ObjectContentManagerAutoTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/PersistenceManagerAutoTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/ObjectContentManagerAutoTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/PersistenceManagerAutoTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/auto/ObjectContentManagerAutoTest.java Mon Jun 18 14:46:42 2007
@@ -27,7 +27,7 @@
 import org.apache.jackrabbit.ocm.RepositoryLifecycleTestSetup;
 import org.apache.jackrabbit.ocm.TestBase;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
-import org.apache.jackrabbit.ocm.manager.impl.PersistenceManagerImpl;
+import org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl;
 import org.apache.jackrabbit.ocm.repository.RepositoryUtil;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.DocumentImpl;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.DocumentStream;
@@ -40,14 +40,14 @@
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  */
-public class PersistenceManagerAutoTest extends TestBase {
-	private final static Log log = LogFactory.getLog(PersistenceManagerAutoTest.class);
+public class ObjectContentManagerAutoTest extends TestBase {
+	private final static Log log = LogFactory.getLog(ObjectContentManagerAutoTest.class);
 
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
 	 */
-	public PersistenceManagerAutoTest(String testName) throws Exception {
+	public ObjectContentManagerAutoTest(String testName) throws Exception {
 		super(testName);
 
 	}
@@ -55,7 +55,7 @@
 	public static Test suite() {
 		// All methods starting with "test" will be executed in the test suite.
 		return new RepositoryLifecycleTestSetup(new TestSuite(
-				PersistenceManagerAutoTest.class));
+				ObjectContentManagerAutoTest.class));
 	}
 
 	public void tearDown() throws Exception {
@@ -68,7 +68,7 @@
 	
 	public void testAuto() {
 		
-		ObjectContentManager persistenceManager = this.getPersistenceManager();
+		ObjectContentManager ocm = this.getObjectContentManager();
 
 		//---------------------------------------------------------------------------------------------------------
 		// Insert cmsobjects
@@ -92,34 +92,34 @@
 	    	    	    
 	    folder.addChild(document);
 	    folder.addChild(subFolder);
-	    persistenceManager.insert(folder);               		
-		persistenceManager.save();
+	    ocm.insert(folder);               		
+		ocm.save();
 		
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve folder2 
 		//---------------------------------------------------------------------------------------------------------	
-		Folder folder2 = (Folder) persistenceManager.getObject( "/folder2");
+		Folder folder2 = (Folder) ocm.getObject( "/folder2");
 		assertNotNull("folder 2 is null", folder2);
 		assertEquals("Invalid number of cms object  found in folder2 children", folder2.getChildren().size() ,0); // autoInsert = false
 		
 		//---------------------------------------------------------------------------------------------------------	
 		// Insert nested objects
 		//---------------------------------------------------------------------------------------------------------
-		persistenceManager.insert(subFolder);
-		persistenceManager.insert(document);
-		persistenceManager.save();
+		ocm.insert(subFolder);
+		ocm.insert(document);
+		ocm.save();
 		
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve folder2 
 		//---------------------------------------------------------------------------------------------------------	
-		 folder2 = (Folder) persistenceManager.getObject( "/folder2");
+		 folder2 = (Folder) ocm.getObject( "/folder2");
 		assertNotNull("folder 2 is null", folder2);
 		assertEquals("Invalid number of cms object  found in folder2 children", folder2.getChildren().size() ,0); // autoInsert = false
 
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve children attribute 
 		//---------------------------------------------------------------------------------------------------------			
-		persistenceManager.retrieveMappedAttribute(folder2, "children");
+		ocm.retrieveMappedAttribute(folder2, "children");
 		assertNotNull("folder 2 is null", folder2);
 		assertEquals("Invalid number of cms object  found in folder2 children", folder2.getChildren().size() ,2);
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/document4", DocumentImpl.class));
@@ -129,13 +129,13 @@
 		// Update 
 		//---------------------------------------------------------------------------------------------------------	
 		folder2.setChildren(null);
-		persistenceManager.update(folder2); // autoupdate = true for the children attribute. So no update on the children collection
-		persistenceManager.save();
+		ocm.update(folder2); // autoupdate = true for the children attribute. So no update on the children collection
+		ocm.save();
 
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve children attribute 
 		//---------------------------------------------------------------------------------------------------------			
-		persistenceManager.retrieveMappedAttribute(folder2, "children");
+		ocm.retrieveMappedAttribute(folder2, "children");
 		assertNotNull("folder 2 is null", folder2);
 		assertEquals("Invalid number of cms object  found in folder2 children", folder2.getChildren().size() ,2);
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/document4", DocumentImpl.class));
@@ -144,13 +144,13 @@
 		
 	}
 	
-	protected void initPersistenceManager() throws UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
+	protected void initObjectContentManager() throws UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
 	{
 		Repository repository = RepositoryUtil.getRepository("repositoryTest");
 		String[] files = { "./src/test/test-config/jcrmapping-auto.xml"};
 		session = RepositoryUtil.login(repository, "superuser", "superuser");
 
-		persistenceManager = new PersistenceManagerImpl(session, files);
+		ocm = new ObjectContentManagerImpl(session, files);
 		
 	}	
 	

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AllTests.java?view=diff&rev=548496&r1=548495&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AllTests.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/AllTests.java Mon Jun 18 14:46:42 2007
@@ -34,13 +34,13 @@
     }
 
     public static Test buildSuite() {
-        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.persistence.basic");
+        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.manager.basic");
         //$JUnit-BEGIN$
-        suite.addTestSuite(PersistenceManagerAvoidRecursiveLoopTest.class);
-        suite.addTestSuite(PersistenceManagerCopyMoveTest.class);
-        suite.addTestSuite(PersistenceManagerRemoveTest.class);
-        suite.addTestSuite(PersistenceManagerSameNameSiblingTest.class);
-        suite.addTestSuite(PersistenceManagerTest.class);        
+        suite.addTestSuite(ObjectContentManagerAvoidRecursiveLoopTest.class);
+        suite.addTestSuite(ObjectContentManagerCopyMoveTest.class);
+        suite.addTestSuite(ObjectContentManagerRemoveTest.class);
+        suite.addTestSuite(ObjectContentManagerSameNameSiblingTest.class);
+        suite.addTestSuite(ObjectContentManagerTest.class);        
         //$JUnit-END$
 
         return suite;

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerAvoidRecursiveLoopTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerAvoidRecursiveLoopTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerAvoidRecursiveLoopTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerAvoidRecursiveLoopTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerAvoidRecursiveLoopTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerAvoidRecursiveLoopTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerAvoidRecursiveLoopTest.java Mon Jun 18 14:46:42 2007
@@ -29,28 +29,28 @@
 import org.apache.jackrabbit.ocm.RepositoryLifecycleTestSetup;
 import org.apache.jackrabbit.ocm.TestBase;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
-import org.apache.jackrabbit.ocm.manager.impl.PersistenceManagerImpl;
+import org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl;
 import org.apache.jackrabbit.ocm.repository.RepositoryUtil;
 import org.apache.jackrabbit.ocm.testmodel.crossreference.A;
 import org.apache.jackrabbit.ocm.testmodel.crossreference.B;
 
 
 /**
- * Basic test for PersistenceManager
+ * Basic test for ObjectContentManager
  * Test when objects are cross referenced 
  * eg. object 'a' contains a reference to an object 'b' and object 'b' contains a reference to 'a'.
  *
  * @author <a href="mailto:christophe.lombart@gmail.com>Christophe Lombart</a>
  */
-public class PersistenceManagerAvoidRecursiveLoopTest extends TestBase
+public class ObjectContentManagerAvoidRecursiveLoopTest extends TestBase
 {
-    private final static Log log = LogFactory.getLog(PersistenceManagerAvoidRecursiveLoopTest.class);
+    private final static Log log = LogFactory.getLog(ObjectContentManagerAvoidRecursiveLoopTest.class);
 
     /**
      * <p>Defines the test case name for junit.</p>
      * @param testName The test case name.
      */
-    public PersistenceManagerAvoidRecursiveLoopTest(String testName)  throws Exception
+    public ObjectContentManagerAvoidRecursiveLoopTest(String testName)  throws Exception
     {
         super(testName);
     }
@@ -59,7 +59,7 @@
     {
         // All methods starting with "test" will be executed in the test suite.
         return new RepositoryLifecycleTestSetup(
-                new TestSuite(PersistenceManagerAvoidRecursiveLoopTest.class));
+                new TestSuite(ObjectContentManagerAvoidRecursiveLoopTest.class));
     }
 
 
@@ -68,10 +68,10 @@
      */
     public void tearDown() throws Exception
     {
-    	if (getPersistenceManager().objectExists("/test"))
+    	if (getObjectContentManager().objectExists("/test"))
     	{
-    	   getPersistenceManager().remove("/test");
-    	   getPersistenceManager().save();
+    	   getObjectContentManager().remove("/test");
+    	   getObjectContentManager().save();
     	}
         super.tearDown();
     }
@@ -80,7 +80,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
@@ -89,13 +89,13 @@
             a.setA1("a1");
             a.setA2("a2");
             
-            persistenceManager.insert(a);
-            persistenceManager.save();
+            ocm.insert(a);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            a = (A) persistenceManager.getObject( "/test");
+            a = (A) ocm.getObject( "/test");
             assertNotNull("a is null", a);
             
             B b = new B();
@@ -117,14 +117,14 @@
             b2.setA(a);
             a.addB(b2);
 
-            persistenceManager.update(a);
-            persistenceManager.save();
+            ocm.update(a);
+            ocm.save();
             
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            a = (A) persistenceManager.getObject( "/test");
+            a = (A) ocm.getObject( "/test");
             assertNotNull("a is null", a);
             assertTrue("Duplicate instance a", a == a.getB().getA());
             
@@ -144,13 +144,13 @@
     }
 
 	
-	protected void initPersistenceManager() throws UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
+	protected void initObjectContentManager() throws UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
 	{
 		Repository repository = RepositoryUtil.getRepository("repositoryTest");
 		String[] files = { "./src/test/test-config/jcrmapping-avoidrecursiveloop.xml" };
 		session = RepositoryUtil.login(repository, "superuser", "superuser");
        
-		persistenceManager = new PersistenceManagerImpl(session, files);
+		ocm = new ObjectContentManagerImpl(session, files);
 		
 	}	
 

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerCopyMoveTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerCopyMoveTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerCopyMoveTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerCopyMoveTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerCopyMoveTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerCopyMoveTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerCopyMoveTest.java Mon Jun 18 14:46:42 2007
@@ -28,7 +28,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.ocm.RepositoryLifecycleTestSetup;
 import org.apache.jackrabbit.ocm.TestBase;
-import org.apache.jackrabbit.ocm.exception.PersistenceException;
+import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.testmodel.A;
 import org.apache.jackrabbit.ocm.testmodel.Atomic;
 import org.apache.jackrabbit.ocm.testmodel.B;
@@ -40,15 +40,15 @@
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  */
-public class PersistenceManagerCopyMoveTest extends TestBase
+public class ObjectContentManagerCopyMoveTest extends TestBase
 {
-	private final static Log log = LogFactory.getLog(PersistenceManagerCopyMoveTest.class);
+	private final static Log log = LogFactory.getLog(ObjectContentManagerCopyMoveTest.class);
 	
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
 	 */
-	public PersistenceManagerCopyMoveTest(String testName) throws Exception
+	public ObjectContentManagerCopyMoveTest(String testName) throws Exception
 	{
 		super(testName);
 
@@ -58,7 +58,7 @@
 	{
 		// All methods starting with "test" will be executed in the test suite.
 		return new RepositoryLifecycleTestSetup(
-                new TestSuite(PersistenceManagerCopyMoveTest.class));
+                new TestSuite(ObjectContentManagerCopyMoveTest.class));
 	}
 
     /**
@@ -112,18 +112,18 @@
         
         a.setCollection(collection);
         
-        persistenceManager.insert(a);
-        persistenceManager.save();
+        ocm.insert(a);
+        ocm.save();
 		
         // --------------------------------------------------------------------------------
         // Copy the object 
         // --------------------------------------------------------------------------------
-        persistenceManager.copy("/test", "/test2");      
+        ocm.copy("/test", "/test2");      
         
         // --------------------------------------------------------------------------------
         // Get the object 
         // --------------------------------------------------------------------------------
-        a = (A) persistenceManager.getObject("/test2");
+        a = (A) ocm.getObject("/test2");
         assertNotNull("a is null", a);
         assertTrue("Invalid field a1", a.getA1().equals("a1"));
         assertTrue("Invalid field b.b1", a.getB().getB1().equals("b1"));
@@ -136,18 +136,18 @@
        
         try 
         {
-			persistenceManager.copy("/incorrectpath", "/test2");			
+			ocm.copy("/incorrectpath", "/test2");			
 			fail("the copy method accepts an incorrect source path");
-		} catch (PersistenceException e) 
+		} catch (ObjectContentManagerException e) 
 		{
 			// Nothing to do  - Expected behaviour
 		}       
 
         try 
         {
-			persistenceManager.copy("/test", "incorrectpath");			
+			ocm.copy("/test", "incorrectpath");			
 			fail("the copy method accepts an incorrect destination path");
-		} catch (PersistenceException e) 
+		} catch (ObjectContentManagerException e) 
 		{
 			// Nothing to do  - Expected behaviour
 		}
@@ -155,9 +155,9 @@
         // --------------------------------------------------------------------------------
         // Remove objects 
         // --------------------------------------------------------------------------------
-        persistenceManager.remove("/test");
-        persistenceManager.remove("/test2");
-        persistenceManager.save();
+        ocm.remove("/test");
+        ocm.remove("/test2");
+        ocm.save();
         
 	}
 
@@ -172,40 +172,40 @@
         	Atomic atomic =  new Atomic();
         	atomic.setPath("/source");
         	atomic.setString("test atomic");
-        	persistenceManager.insert(atomic);
-        	persistenceManager.save();
+        	ocm.insert(atomic);
+        	ocm.save();
 			
 			// --------------------------------------------------------------------------------
 			// Copy the object 
 			// --------------------------------------------------------------------------------
-        	persistenceManager.move("/source", "/result");
+        	ocm.move("/source", "/result");
 
 			// --------------------------------------------------------------------------------
 			// Get the object 
 			// --------------------------------------------------------------------------------
-			atomic = (Atomic) persistenceManager.getObject("/result");
+			atomic = (Atomic) ocm.getObject("/result");
 			assertNotNull("atomic is null", atomic);
 			assertTrue("Invalid field a1", atomic.getString().equals("test atomic"));			        
 
-			assertFalse("Object with path /source still exists", persistenceManager.objectExists("/source"));
+			assertFalse("Object with path /source still exists", ocm.objectExists("/source"));
 
 			// --------------------------------------------------------------------------------
 			// Check exceptions 
 			// --------------------------------------------------------------------------------      
 			try 
 			{
-				persistenceManager.move("/incorrectpath", "/test2");			
+				ocm.move("/incorrectpath", "/test2");			
 				fail("the copy method accepts an incorrect source path");
-			} catch (PersistenceException e) 
+			} catch (ObjectContentManagerException e) 
 			{
 				// Nothing to do  - Expected behaviour
 			}       
 
 			try 
 			{
-				persistenceManager.move("/test", "incorrectpath");			
+				ocm.move("/test", "incorrectpath");			
 				fail("the copy method accepts an incorrect destination path");
-			} catch (PersistenceException e) 
+			} catch (ObjectContentManagerException e) 
 			{
 				// Nothing to do  - Expected behaviour
 			}
@@ -213,8 +213,8 @@
 			// --------------------------------------------------------------------------------
 			// Remove objects 
 			// --------------------------------------------------------------------------------
-			persistenceManager.remove("/result");
-			persistenceManager.save();
+			ocm.remove("/result");
+			ocm.save();
 		} 
         catch (Exception e) 
 		{
@@ -260,30 +260,29 @@
 			
 			a.setCollection(collection);
 			
-			persistenceManager.insert(a);
-        	persistenceManager.save();
+			ocm.insert(a);
+        	ocm.save();
 			
 			// --------------------------------------------------------------------------------
 			// Copy the object 
-			// --------------------------------------------------------------------------------
-			//persistenceManager
-        	persistenceManager.move("/source", "/result");            
+			// --------------------------------------------------------------------------------			
+        	ocm.move("/source", "/result");            
         	// --------------------------------------------------------------------------------
 			// Get the object 
 			// --------------------------------------------------------------------------------
-			a = (A) persistenceManager.getObject("/result");
+			a = (A) ocm.getObject("/result");
 			assertNotNull("a is null", a);
 			assertTrue("Invalid field a1", a.getA1().equals("a1"));
 			assertTrue("Invalid field b.b1", a.getB().getB1().equals("b1"));
 			assertTrue("Invalid number of items in field collection", a.getCollection().size() == 3);
 			        
-			assertFalse("Object with path /source still exists", persistenceManager.objectExists("/source"));
+			assertFalse("Object with path /source still exists", ocm.objectExists("/source"));
 			
 			// --------------------------------------------------------------------------------
 			// Remove objects 
 			// --------------------------------------------------------------------------------
-			persistenceManager.remove("/result");
-			persistenceManager.save();
+			ocm.remove("/result");
+			ocm.save();
 		} 
         catch (Exception e) 
 		{

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerRemoveTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerRemoveTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerRemoveTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerRemoveTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerRemoveTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerRemoveTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerRemoveTest.java Mon Jun 18 14:46:42 2007
@@ -41,15 +41,15 @@
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  */
-public class PersistenceManagerRemoveTest extends TestBase
+public class ObjectContentManagerRemoveTest extends TestBase
 {
-	private final static Log log = LogFactory.getLog(PersistenceManagerRemoveTest.class);
+	private final static Log log = LogFactory.getLog(ObjectContentManagerRemoveTest.class);
 	private Date date = new Date();
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
 	 */
-	public PersistenceManagerRemoveTest(String testName) throws Exception
+	public ObjectContentManagerRemoveTest(String testName) throws Exception
 	{
 		super(testName);
 
@@ -59,7 +59,7 @@
 	{
 		// All methods starting with "test" will be executed in the test suite.
 		return new RepositoryLifecycleTestSetup(
-                new TestSuite(PersistenceManagerRemoveTest.class));
+                new TestSuite(ObjectContentManagerRemoveTest.class));
 	}
 
     /**
@@ -85,23 +85,23 @@
 		try
 		{
 			
-			ObjectContentManager persistenceManager = this.getPersistenceManager();
-			persistenceManager.remove("/test5");
-			persistenceManager.save();
+			ObjectContentManager ocm = this.getObjectContentManager();
+			ocm.remove("/test5");
+			ocm.save();
 
-			assertFalse("Test5 has not been removed", persistenceManager.objectExists("/test5"));
+			assertFalse("Test5 has not been removed", ocm.objectExists("/test5"));
 
 			QueryManager queryManager = this.getQueryManager();
 			Filter filter = queryManager.createFilter(Atomic.class);
 			filter.addEqualTo("booleanObject" , new Boolean(false));
 			Query query = queryManager.createQuery(filter);
-			persistenceManager.remove(query);
-			persistenceManager.save();
+			ocm.remove(query);
+			ocm.save();
 
 			filter = queryManager.createFilter(Atomic.class);
 			filter.setScope("//");
 			query = queryManager.createQuery(filter);			
-			Collection result = persistenceManager.getObjects(query);
+			Collection result = ocm.getObjects(query);
 			assertEquals("Invalid number of objects", 5, result.size());
 
 		}
@@ -118,7 +118,7 @@
 		try
 		{
 
-			ObjectContentManager persistenceManager = getPersistenceManager();
+			ObjectContentManager ocm = getObjectContentManager();
 
 			for (int i = 1; i <= 10; i++)
 			{
@@ -147,10 +147,10 @@
 					a.setByteArray("This is small object stored in the repository".getBytes());
 					a.setInputStream(new ByteArrayInputStream("Another Stream".getBytes()));
 				}
-				persistenceManager.insert(a);
+				ocm.insert(a);
 
 			}
-			persistenceManager.save();
+			ocm.save();
 
 		}
 		catch (Exception e)



Mime
View raw message