jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r548496 [3/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/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerSameNameSiblingTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerSameNameSiblingTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerSameNameSiblingTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerSameNameSiblingTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerSameNameSiblingTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerSameNameSiblingTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerSameNameSiblingTest.java Mon Jun 18 14:46:42 2007
@@ -35,7 +35,7 @@
 import org.apache.jackrabbit.ocm.TestBase;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.DefaultAtomicTypeConverterProvider;
-import org.apache.jackrabbit.ocm.manager.impl.PersistenceManagerImpl;
+import org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl;
 import org.apache.jackrabbit.ocm.manager.objectconverter.ObjectConverter;
 import org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl;
 import org.apache.jackrabbit.ocm.mapper.impl.DigesterMapperImpl;
@@ -53,16 +53,16 @@
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  */
-public class PersistenceManagerSameNameSiblingTest extends TestBase
+public class ObjectContentManagerSameNameSiblingTest extends TestBase
 {
-	private final static Log log = LogFactory.getLog(PersistenceManagerSameNameSiblingTest.class);
+	private final static Log log = LogFactory.getLog(ObjectContentManagerSameNameSiblingTest.class);
 	private Date date = new Date();
 	
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
 	 */
-	public PersistenceManagerSameNameSiblingTest(String testName) throws Exception
+	public ObjectContentManagerSameNameSiblingTest(String testName) throws Exception
 	{
 		super(testName);
 		
@@ -72,7 +72,7 @@
 	{
 		// All methods starting with "test" will be executed in the test suite.
 		return new RepositoryLifecycleTestSetup(
-                new TestSuite(PersistenceManagerSameNameSiblingTest.class));
+                new TestSuite(ObjectContentManagerSameNameSiblingTest.class));
 	}
 
 	public void tearDown() throws Exception 
@@ -88,37 +88,37 @@
 		try
 		{
 			this.importData(date);
-			ObjectContentManager persistenceManager = this.getPersistenceManager();
+			ObjectContentManager ocm = this.getObjectContentManager();
 				
 			// Query all objects 
 			QueryManager queryManager = this.getQueryManager();
 			Filter filter = queryManager.createFilter(Atomic.class);	
 			filter.setScope("/");
 			Query query = queryManager.createQuery(filter);
-			Collection result = persistenceManager.getObjects(query);
+			Collection result = ocm.getObjects(query);
             assertEquals("Incorrect number of objects found", 10, result.size());
                          
             // Get objects
-            Atomic atomic = (Atomic) persistenceManager.getObject( "/test[2]");
+            Atomic atomic = (Atomic) ocm.getObject( "/test[2]");
             assertNotNull("Object /test[2] not found", atomic);
             
-            atomic = (Atomic) persistenceManager.getObject( "/test[10]");
+            atomic = (Atomic) ocm.getObject( "/test[10]");
             assertNotNull("Object /test[2] not found", atomic);            
             
             // Update the object 
             atomic.setString("Modified Test String 10");
-            persistenceManager.update(atomic);
-            persistenceManager.save();
+            ocm.update(atomic);
+            ocm.save();
 
             // Query on the attribute "string"
             queryManager = this.getQueryManager();
 			filter = queryManager.createFilter(Atomic.class);	
 			filter.addLike("string", "Modified%");			
 			query = queryManager.createQuery(filter);
-			result = persistenceManager.getObjects(query);
+			result = ocm.getObjects(query);
 			assertTrue("Incorrect number of objects found", result.size() == 1);
             
-			atomic = (Atomic) persistenceManager.getObject(query);
+			atomic = (Atomic) ocm.getObject(query);
 			assertNotNull("Object not found", atomic);
 			assertTrue("Incorrect Object", atomic.getString().equals("Modified Test String 10"));   
 			
@@ -127,10 +127,10 @@
 			filter = queryManager.createFilter(Atomic.class);	
 			filter.setScope("/");
 			query = queryManager.createQuery(filter) ;           
-            persistenceManager.remove(query);
-            persistenceManager.save();
+            ocm.remove(query);
+            ocm.save();
 
-			result = persistenceManager.getObjects(query);
+			result = ocm.getObjects(query);
             assertTrue("Incorrect number of objects found", result.size() == 0);
             
             
@@ -145,30 +145,30 @@
 
 	public void testUnsupportedSameNameSiblings()
 	{
-		     ObjectContentManager persistenceManager = getPersistenceManager();
+		     ObjectContentManager ocm = getObjectContentManager();
              try
              {
             	 
             	 Page page = new Page();
             	 page.setPath("/page");
             	 page.setTitle("Page Title");            	 
-            	 persistenceManager.insert(page);
-            	 persistenceManager.save();
+            	 ocm.insert(page);
+            	 ocm.save();
             	 
             	 Paragraph p1 = new Paragraph("para1");
             	 p1.setPath("/page/paragraph");
-            	 persistenceManager.insert(p1);
+            	 ocm.insert(p1);
             	 
             	 Paragraph p2 = new Paragraph("para1");
             	 p2.setPath("/page/paragraph");
-            	 persistenceManager.insert(p2);
+            	 ocm.insert(p2);
              fail();            	 
             	 
              }
              catch(Exception e)
              {
-    		            	 persistenceManager.remove("/page");
-            	        persistenceManager.save();
+    		            	 ocm.remove("/page");
+            	        ocm.save();
              }
 	}
 	
@@ -178,7 +178,7 @@
 		try
 		{
 
-			ObjectContentManager persistenceManager = getPersistenceManager();
+			ObjectContentManager ocm = getObjectContentManager();
 			
 			
 			for (int i = 1; i <= 10; i++)
@@ -208,11 +208,11 @@
 					 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)
@@ -223,14 +223,14 @@
 
 	}
 	
-	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-sibling.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/ObjectContentManagerTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/PersistenceManagerTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/basic/ObjectContentManagerTest.java Mon Jun 18 14:46:42 2007
@@ -37,15 +37,15 @@
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  */
-public class PersistenceManagerTest extends TestBase
+public class ObjectContentManagerTest extends TestBase
 {
-    private final static Log log = LogFactory.getLog(PersistenceManagerTest.class);
+    private final static Log log = LogFactory.getLog(ObjectContentManagerTest.class);
 
     /**
      * <p>Defines the test case name for junit.</p>
      * @param testName The test case name.
      */
-    public PersistenceManagerTest(String testName)  throws Exception
+    public ObjectContentManagerTest(String testName)  throws Exception
     {
         super(testName);
     }
@@ -54,7 +54,7 @@
     {
         // All methods starting with "test" will be executed in the test suite.
         return new RepositoryLifecycleTestSetup(
-                new TestSuite(PersistenceManagerTest.class));
+                new TestSuite(ObjectContentManagerTest.class));
     }
 
 
@@ -63,10 +63,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();
     }
@@ -75,7 +75,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
 
             // --------------------------------------------------------------------------------
@@ -109,14 +109,14 @@
             
             a.setCollection(collection);
             
-            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);
             assertTrue("Incorrect a1", a.getA1().equals("a1"));
             assertNotNull("a.b is null", a.getB());
@@ -134,13 +134,13 @@
             a.setB(newB);
             
             
-            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("Incorrect a1", a.getA1().equals("new value"));
             assertNotNull("a.b is null", a.getB());
@@ -165,7 +165,7 @@
     {
     	 try
          {
-         	ObjectContentManager persistenceManager = getPersistenceManager();
+         	ObjectContentManager ocm = getObjectContentManager();
 
 
              // --------------------------------------------------------------------------------         	
@@ -174,14 +174,14 @@
          	Discriminator discriminatorObject = new Discriminator();
          	discriminatorObject.setPath("/test");
          	discriminatorObject.setContent("This is my content");
-             persistenceManager.insert(discriminatorObject);             
-             persistenceManager.save();
+             ocm.insert(discriminatorObject);             
+             ocm.save();
              
 
              // --------------------------------------------------------------------------------
              // Get the object
              // --------------------------------------------------------------------------------           
-             discriminatorObject = (Discriminator) persistenceManager.getObject( "/test");
+             discriminatorObject = (Discriminator) ocm.getObject( "/test");
              assertNotNull("discriminator object  is null", discriminatorObject );
              assertTrue("Incorrect content", discriminatorObject.getContent().equals("This is my content"));
              
@@ -190,13 +190,13 @@
              // --------------------------------------------------------------------------------
              discriminatorObject.setContent("new content");             
              
-             persistenceManager.update(discriminatorObject);
-             persistenceManager.save();
+             ocm.update(discriminatorObject);
+             ocm.save();
 
              // --------------------------------------------------------------------------------
              // Get the object
              // --------------------------------------------------------------------------------           
-             discriminatorObject = (Discriminator) persistenceManager.getObject( "/test");
+             discriminatorObject = (Discriminator) ocm.getObject( "/test");
              assertNotNull("discriminator object  is null", discriminatorObject );
              assertTrue("Incorrect content", discriminatorObject.getContent().equals("new content"));
              
@@ -212,9 +212,9 @@
     
     public void testIsPersistent()
     {    
-    	ObjectContentManager persistenceManager = getPersistenceManager();
-    	assertTrue("Class A is not persistent ", persistenceManager.isPersistent(A.class));
-    	assertFalse("Class String is  persistent - hum ? ", persistenceManager.isPersistent(String.class));
+    	ObjectContentManager ocm = getObjectContentManager();
+    	assertTrue("Class A is not persistent ", ocm.isPersistent(A.class));
+    	assertFalse("Class String is  persistent - hum ? ", ocm.isPersistent(String.class));
     }
     
 

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/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/beanconverter/AllTests.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/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.persistence.beanconverter");
+        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.manager.beanconverter");
         //$JUnit-BEGIN$
         suite.addTestSuite(BeanDescriptorTest.class);
         //$JUnit-END$

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/BeanDescriptorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/BeanDescriptorTest.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/beanconverter/BeanDescriptorTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/BeanDescriptorTest.java Mon Jun 18 14:46:42 2007
@@ -82,10 +82,10 @@
             getSession().save();
         }
         
-        if (getPersistenceManager().objectExists("/test"))
+        if (getObjectContentManager().objectExists("/test"))
         {
-            getPersistenceManager().remove("/test");
-            getPersistenceManager().save();
+            getObjectContentManager().remove("/test");
+            getObjectContentManager().save();
         }           
 
     }
@@ -101,13 +101,13 @@
 			A a = new A();
 			a.setPath("/test");
 			a.setA1("a1");
-			persistenceManager.insert(a);
-			persistenceManager.save();
+			ocm.insert(a);
+			ocm.save();
 			
     		// ------------------------------------------------------------------------
     		// Retrieve 
     		// ------------------------------------------------------------------------
-			a = (A) persistenceManager.getObject("/test");
+			a = (A) ocm.getObject("/test");
 			assertNotNull("Object is null", a);
 			assertNull("attribute is not null", a.getB());
 			
@@ -116,21 +116,21 @@
 			b.setB2("b2");
 			a.setB(b);
 			
-			persistenceManager.update(a);
-			persistenceManager.save();
+			ocm.update(a);
+			ocm.save();
 
     		// ------------------------------------------------------------------------
     		// Retrieve 
     		// ------------------------------------------------------------------------
-			a = (A) persistenceManager.getObject("/test");
+			a = (A) ocm.getObject("/test");
 			assertNotNull("Object is null", a);
 			assertNotNull("attribute is null", a.getB());
 			
     		// ------------------------------------------------------------------------
 			// Remove object
     		// ------------------------------------------------------------------------			
-			persistenceManager.remove("/test");
-			persistenceManager.save();
+			ocm.remove("/test");
+			ocm.save();
 		} 
     	catch (RuntimeException e) 
     	{
@@ -150,16 +150,16 @@
         expD.setD1("d1value");
         expD.setB1(expB);
         
-       persistenceManager.insert( expD);
-       persistenceManager.save();
+       ocm.insert( expD);
+       ocm.save();
         
-        D actD = (D) persistenceManager.getObject( "/someD");
+        D actD = (D) ocm.getObject( "/someD");
         
         assertEquals(expD.getD1(), actD.getD1());
         assertEquals(expB.getB1(), actD.getB1().getB1());
         assertEquals(expB.getB2(), actD.getB1().getB2());
         
-        DFull actDFull = (DFull) persistenceManager.getObject( DFull.class,  "/someD");
+        DFull actDFull = (DFull) ocm.getObject( DFull.class,  "/someD");
         
         assertEquals(expD.getD1(), actDFull.getD1());
         assertEquals(expB.getB1(), actDFull.getB1());
@@ -167,16 +167,16 @@
         
         expB.setB1("updatedvalue1");
         
-        persistenceManager.update( expD);
+        ocm.update( expD);
         getSession().save();
         
-        actD = (D) persistenceManager.getObject( "/someD");
+        actD = (D) ocm.getObject( "/someD");
         
         assertEquals(expD.getD1(), actD.getD1());
         assertEquals(expB.getB1(), actD.getB1().getB1());
         assertEquals(expB.getB2(), actD.getB1().getB2());
         
-        actDFull = (DFull) persistenceManager.getObject( DFull.class,  "/someD");
+        actDFull = (DFull) ocm.getObject( DFull.class,  "/someD");
         
         assertEquals(expD.getD1(), actDFull.getD1());
         assertEquals(expB.getB1(), actDFull.getB1());
@@ -184,15 +184,15 @@
         
             
         expD.setB1(null);
-        persistenceManager.update( expD);
+        ocm.update( expD);
         getSession().save();
         
-        actD = (D) persistenceManager.getObject(  "/someD");
+        actD = (D) ocm.getObject(  "/someD");
         
         assertEquals(expD.getD1(), actD.getD1());
         assertNull("b1 was not  removed", actD.getB1());
         
-        actDFull = (DFull) persistenceManager.getObject( DFull.class,  "/someD");
+        actDFull = (DFull) ocm.getObject( DFull.class,  "/someD");
         assertEquals(expD.getD1(), actDFull.getD1());
         assertNull("b1 was not  removed", actDFull.getB1());
         assertNull("b2 wan not remove", actDFull.getB2());
@@ -212,28 +212,28 @@
         expE.setB1(expB);
         
         
-        persistenceManager.insert( expE);
-        persistenceManager.save();
+        ocm.insert( expE);
+        ocm.save();
        
-        E actE = (E) persistenceManager.getObject( "/someD");
+        E actE = (E) ocm.getObject( "/someD");
        
         assertEquals(expE.getD1(), actE.getD1());
         
         expE.setD1("updatedvalueD1");
         expB.setB1("updatedvalue1");
         
-        persistenceManager.update( expE);
-        persistenceManager.save();
+        ocm.update( expE);
+        ocm.save();
                
-        actE = (E) persistenceManager.getObject(  "/someD");
+        actE = (E) ocm.getObject(  "/someD");
         
         assertEquals(expE.getD1(), actE.getD1());
                         
         expE.setB1(null);
-        persistenceManager.update( expE);
-        persistenceManager.save();
+        ocm.update( expE);
+        ocm.save();
         
-        actE = (E) persistenceManager.getObject(  "/someD");
+        actE = (E) ocm.getObject(  "/someD");
         
         assertEquals(expE.getD1(), actE.getD1());        
         
@@ -253,7 +253,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
@@ -270,19 +270,19 @@
             paragraphs.add(new Paragraph("Para 3"));
             page.setParagraphs(paragraphs);
             
-            persistenceManager.insert(page);
-            persistenceManager.save();
+            ocm.insert(page);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            page = (Page) persistenceManager.getObject("/test");
+            page = (Page) ocm.getObject("/test");
             paragraphs = page.getParagraphs();
             for (Iterator iter = paragraphs.iterator(); iter.hasNext();) {
 				Paragraph paragraph = (Paragraph) iter.next();
 				System.out.println("Paragraph path : " + paragraph.getPath());				
 			}            
-            Paragraph p1 = (Paragraph) persistenceManager.getObject("/test/collection-element[2]");
+            Paragraph p1 = (Paragraph) ocm.getObject("/test/collection-element[2]");
             Page paraPage = p1.getPage();
             assertNotNull("Parent page is null", paraPage);
             assertTrue("Invalid parent page", paraPage.getPath().equals("/test"));
@@ -290,8 +290,8 @@
             // --------------------------------------------------------------------------------
             // Remove the object
             // --------------------------------------------------------------------------------           
-            persistenceManager.remove("/test");
-            persistenceManager.save();
+            ocm.remove("/test");
+            ocm.save();
             
         }
         catch (Exception e)

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/FakeBeanConverter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/FakeBeanConverter.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/beanconverter/FakeBeanConverter.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/beanconverter/FakeBeanConverter.java Mon Jun 18 14:46:42 2007
@@ -23,7 +23,7 @@
 import javax.jcr.Session;
 
 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.ocm.manager.atomictypeconverter.AtomicTypeConverterProvider;
@@ -53,13 +53,13 @@
      * @see org.apache.jackrabbit.ocm.manager.beanconverter.BeanConverter#insert(javax.jcr.Session, javax.jcr.Node, org.apache.jackrabbit.ocm.mapper.Mapper, java.lang.String, java.lang.Object)
      */
 	public void insert(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Object object, ClassDescriptor parentClassDescriptor, Object parent)
-	throws PersistenceException, RepositoryException, 	JcrMappingException {
+	throws ObjectContentManagerException, RepositoryException, 	JcrMappingException {
         try {
             log.add("insert at path " + parentNode.getPath());
             
         }
         catch(javax.jcr.RepositoryException re) {
-            throw new PersistenceException(re);
+            throw new ObjectContentManagerException(re);
         }
     } 
 
@@ -67,12 +67,12 @@
      * @see org.apache.jackrabbit.ocm.manager.beanconverter.BeanConverter#update(javax.jcr.Session, javax.jcr.Node, org.apache.jackrabbit.ocm.mapper.Mapper, java.lang.String, java.lang.Object)
      */
 	public void update(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Object object, ClassDescriptor parentClassDescriptor, Object parent)
-	throws PersistenceException, RepositoryException,	JcrMappingException {
+	throws ObjectContentManagerException, RepositoryException,	JcrMappingException {
         try {
             log.add("update at path " + parentNode.getPath());
         }
         catch(javax.jcr.RepositoryException re) {
-            throw new PersistenceException(re);
+            throw new ObjectContentManagerException(re);
         }
     }
 
@@ -80,12 +80,12 @@
      * @see org.apache.jackrabbit.ocm.manager.beanconverter.BeanConverter#getObject(javax.jcr.Session, javax.jcr.Node, org.apache.jackrabbit.ocm.mapper.Mapper, java.lang.String, java.lang.Class)
      */
     public Object getObject(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Class beanClass, Object parent)
-	throws PersistenceException, RepositoryException,JcrMappingException {
+	throws ObjectContentManagerException, RepositoryException,JcrMappingException {
         try {
             log.add("get from path " + parentNode.getPath());
         }
         catch(javax.jcr.RepositoryException re) {
-            throw new PersistenceException(re);
+            throw new ObjectContentManagerException(re);
         }
         // The B object is not important for the unit test. 
         // The unit test checks only the log generated by this converter
@@ -96,13 +96,13 @@
      * @see org.apache.jackrabbit.ocm.manager.beanconverter.BeanConverter#remove(javax.jcr.Session, javax.jcr.Node, org.apache.jackrabbit.ocm.mapper.Mapper, java.lang.String)
      */
 	public void remove(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Object object, ClassDescriptor parentClassDescriptor, Object parent)
-    throws PersistenceException,	RepositoryException, JcrMappingException {
+    throws ObjectContentManagerException,	RepositoryException, JcrMappingException {
 
         try {
             log.add("remove from path " + parentNode.getPath());
         }
         catch(javax.jcr.RepositoryException re) {
-            throw new PersistenceException(re);
+            throw new ObjectContentManagerException(re);
         }
     }
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/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/collectionconverter/AllTests.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/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.persistence.collectionconverter");
+        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.manager.collectionconverter");
         //$JUnit-BEGIN$
         suite.addTestSuite(ArrayListTest.class);
         suite.addTestSuite(DefaultCollectionConverterImplTest.class);        

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ArrayListTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ArrayListTest.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/collectionconverter/ArrayListTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ArrayListTest.java Mon Jun 18 14:46:42 2007
@@ -58,10 +58,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();
@@ -71,7 +71,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
         	
 
             // --------------------------------------------------------------------------------
@@ -83,13 +83,13 @@
             main.setPath("/test");
             main.setText("Main text");
             
-            persistenceManager.insert(main);
-            persistenceManager.save();
+            ocm.insert(main);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            main = (Main) persistenceManager.getObject( "/test");
+            main = (Main) ocm.getObject( "/test");
             ArrayList arrayList = main.getList();
             assertNull("main.getList is not null", arrayList ); 
             
@@ -109,13 +109,13 @@
             arrayListElement.add(e2);
             
             main.setList(arrayListElement);
-            persistenceManager.update(main);
-            persistenceManager.save();
+            ocm.update(main);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            main = (Main) persistenceManager.getObject( "/test");
+            main = (Main) ocm.getObject( "/test");
             arrayList = main.getList();
             assertNotNull("main.getList is null", arrayList ); 
             Element[] elements = (Element[]) arrayList.toArray(new Element[arrayList.size()]);
@@ -142,13 +142,13 @@
             
             main.setList(arrayListElement);            
             
-            persistenceManager.update(main);
-            persistenceManager.save();
+            ocm.update(main);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            main = (Main) persistenceManager.getObject( "/test");
+            main = (Main) ocm.getObject( "/test");
             arrayList = main.getList();
             assertNotNull("main.getList() is null", arrayList ); 
             elements = (Element[]) arrayList.toArray(new Element[arrayList.size()]);

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DefaultCollectionConverterImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DefaultCollectionConverterImplTest.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/collectionconverter/DefaultCollectionConverterImplTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DefaultCollectionConverterImplTest.java Mon Jun 18 14:46:42 2007
@@ -60,10 +60,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();
@@ -73,7 +73,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object with a null collection field
@@ -81,13 +81,13 @@
             A a = new A();
             a.setPath("/test");               
             
-            persistenceManager.insert(a);
-            persistenceManager.save();
+            ocm.insert(a);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            a = (A) persistenceManager.getObject( "/test");
+            a = (A) ocm.getObject( "/test");
             assertNull("a.collection is not null", a.getCollection());
             
             // --------------------------------------------------------------------------------
@@ -112,13 +112,13 @@
             
             a.setCollection(collection);
             
-            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);
             assertNotNull("a.collection is null", a.getCollection());
             assertTrue("Incorrect collection size", a.getCollection().size() == 3);
@@ -128,13 +128,13 @@
             // Update the object
             // --------------------------------------------------------------------------------
             a.setCollection(null);
-            persistenceManager.update(a);
-            persistenceManager.save();
+            ocm.update(a);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            a = (A) persistenceManager.getObject( "/test");
+            a = (A) ocm.getObject( "/test");
             assertNull("a.collection is not null", a.getCollection());
             
             // --------------------------------------------------------------------------------
@@ -155,7 +155,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
@@ -181,13 +181,13 @@
             
             a.setCollection(collection);
             
-            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.collection is null", a.getCollection());
             assertEquals("Incorrect a.collection size", 3, a.getCollection().size());
             assertTrue("Incorrect a.collection", ((C) a.getCollection().iterator().next()).getId().equals("first"));
@@ -208,13 +208,13 @@
             collection.add(c2);
             a.setCollection(collection);
             
-            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);
             assertNotNull("a.collection is null", a.getCollection());
             assertTrue("Incorrect collection size", a.getCollection().size() == 2);
@@ -239,7 +239,7 @@
         try
         {
 
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
@@ -265,13 +265,13 @@
             
             a.setCollection(collection);
             
-            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.collection is null", a.getCollection());
             assertEquals("Incorrect a.collection size", 3, a.getCollection().size());
             assertEquals("Incorrect a.collection", "first", ((C) a.getCollection().iterator().next()).getId());
@@ -290,13 +290,13 @@
             collection.add(c4);
             a.setCollection(collection);
             
-            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);
             assertNotNull("a.collection is null", a.getCollection());
             assertEquals("Incorrect collection size", 4, a.getCollection().size());

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/HashMapTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/HashMapTest.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/collectionconverter/HashMapTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/HashMapTest.java Mon Jun 18 14:46:42 2007
@@ -58,10 +58,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();
@@ -71,7 +71,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
         	
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository with null hashmap
@@ -81,13 +81,13 @@
             main.setPath("/test");
             main.setText("Main text");
                         
-            persistenceManager.insert(main);
-            persistenceManager.save();
+            ocm.insert(main);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            main = (Main) persistenceManager.getObject( "/test");            
+            main = (Main) ocm.getObject( "/test");            
             assertTrue("Incorrect text", main.getText().equals("Main text"));           
             assertNull("HashMap is not null", main.getHashMap());
             
@@ -112,13 +112,13 @@
             
             main.setHashMap(hashMapElement);
             
-            persistenceManager.update(main);
-            persistenceManager.save();
+            ocm.update(main);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            main = (Main) persistenceManager.getObject( "/test");
+            main = (Main) ocm.getObject( "/test");
             assertNotNull("main.getHashMap() is null", main.getHashMap());
             assertTrue("Incorrect text", main.getText().equals("Main text"));           
             assertTrue("Incorrect para element", ((Element) main.getHashMap().get("e1")).getText().equals("Element 1"));
@@ -143,8 +143,8 @@
             hashMapElement.addObject(e3);
             main.setHashMap(hashMapElement);
             
-            persistenceManager.update(main);
-            persistenceManager.save();
+            ocm.update(main);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/MultiValueCollectionConverterImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/MultiValueCollectionConverterImplTest.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/collectionconverter/MultiValueCollectionConverterImplTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/MultiValueCollectionConverterImplTest.java Mon Jun 18 14:46:42 2007
@@ -63,10 +63,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();
@@ -76,7 +76,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
@@ -92,13 +92,13 @@
             values.add("Value4");
             multiValue.setMultiValues(values);
             
-            persistenceManager.insert(multiValue);
-            persistenceManager.save();
+            ocm.insert(multiValue);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            multiValue = (MultiValue) persistenceManager.getObject( "/test");
+            multiValue = (MultiValue) ocm.getObject( "/test");
             assertNotNull("Object is null", multiValue);
             assertNull("nullMultiValues field is not null", multiValue.getNullMultiValues());
             assertTrue("Incorrect number of values", multiValue.getMultiValues().size() == 4);            
@@ -115,14 +115,14 @@
             values.add("Value5");
             multiValue.setMultiValues(values);
             
-            persistenceManager.update(multiValue);
-            persistenceManager.save();
+            ocm.update(multiValue);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
 
-            multiValue = (MultiValue) persistenceManager.getObject( "/test");
+            multiValue = (MultiValue) ocm.getObject( "/test");
             assertNotNull("Object is null", multiValue);
             assertNull("nullMultiValues field is not null", multiValue.getNullMultiValues());
             assertTrue("Incorrect number of values", multiValue.getMultiValues().size() == 5);            

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/NTCollectionConverterImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/NTCollectionConverterImplTest.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/collectionconverter/NTCollectionConverterImplTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/NTCollectionConverterImplTest.java Mon Jun 18 14:46:42 2007
@@ -63,10 +63,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();
@@ -76,7 +76,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
             
         	// --------------------------------------------------------------------------------
             // Create and store an object graph in the repository with a null collection
@@ -86,13 +86,13 @@
             page.setPath("/test");
             page.setTitle("Page Title");
             
-            persistenceManager.insert(page);
-            persistenceManager.save();
+            ocm.insert(page);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            page = (Page) persistenceManager.getObject( "/test");
+            page = (Page) ocm.getObject( "/test");
             assertNull("page.getParagraphs is not null", page.getParagraphs());
             assertTrue("Incorrect page title", page.getTitle().equals("Page Title"));                        
             
@@ -106,13 +106,13 @@
             paragraphs.add(new Paragraph("Para 3"));
             page.setParagraphs(paragraphs);
             
-            persistenceManager.update(page);
-            persistenceManager.save();
+            ocm.update(page);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            page = (Page) persistenceManager.getObject( "/test");
+            page = (Page) ocm.getObject( "/test");
             assertNotNull("page.getParagraphs is null", page.getParagraphs());
             assertTrue("Incorrect page title", page.getTitle().equals("Page Title"));
             assertTrue("Incorrect page.getParagraphs size", page.getParagraphs().size() == 3);
@@ -129,14 +129,14 @@
             paragraphs.add(new Paragraph("Para 5"));
             page.setParagraphs(paragraphs);
             
-            persistenceManager.update(page);
-            persistenceManager.save();
+            ocm.update(page);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
 
-            page = (Page) persistenceManager.getObject( "/test");
+            page = (Page) ocm.getObject( "/test");
             assertNotNull("page.getParagraphs is null", page.getParagraphs());
             assertTrue("Incorrect page title", page.getTitle().equals("Page Title"));
             assertTrue("Incorrect page.getParagraphs size", page.getParagraphs().size() == 4);

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualNodesCollectionConverterImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualNodesCollectionConverterImplTest.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/collectionconverter/ResidualNodesCollectionConverterImplTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualNodesCollectionConverterImplTest.java Mon Jun 18 14:46:42 2007
@@ -59,10 +59,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();
@@ -72,7 +72,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository with null values
@@ -80,13 +80,13 @@
 
             Residual residual = new Residual.ResidualNodes();
             residual.setPath("/test");
-            persistenceManager.insert(residual);
-            persistenceManager.save();
+            ocm.insert(residual);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            residual = (Residual) persistenceManager.getObject( "/test");
+            residual = (Residual) ocm.getObject( "/test");
             assertNotNull("Object is null", residual);
             assertNull("Map is not null", residual.getElements());
             
@@ -103,13 +103,13 @@
             map.put("value4", new Paragraph("Value4"));
             residual.setElements(map);
             
-            persistenceManager.update(residual);
-            persistenceManager.save();
+            ocm.update(residual);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            residual = (Residual) persistenceManager.getObject( "/test");
+            residual = (Residual) ocm.getObject( "/test");
             assertNotNull("Object is null", residual);
             assertTrue("Incorrect number of values", residual.getElements().size() == 4);            
             assertTrue("Incorrect collection element type", (residual.getElements().get("value2") instanceof Paragraph));
@@ -126,14 +126,14 @@
             map.put("value15", new Paragraph("Value15"));
             residual.setElements(map);
             
-            persistenceManager.update(residual);
-            persistenceManager.save();
+            ocm.update(residual);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
 
-            residual = (Residual) persistenceManager.getObject( "/test");
+            residual = (Residual) ocm.getObject( "/test");
             assertNotNull("Object is null", residual);
             assertTrue("Incorrect number of values", residual.getElements().size() == 5);
             assertNull("Unexpected collection element", residual.getElements().get("value2"));

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualPropertiesCollectionConverterImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualPropertiesCollectionConverterImplTest.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/collectionconverter/ResidualPropertiesCollectionConverterImplTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualPropertiesCollectionConverterImplTest.java Mon Jun 18 14:46:42 2007
@@ -61,10 +61,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();
@@ -74,7 +74,7 @@
     {
         try
         {
-        	ObjectContentManager persistenceManager = getPersistenceManager();
+        	ObjectContentManager ocm = getObjectContentManager();
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository with a null hashmap
@@ -83,13 +83,13 @@
             Residual residual = new Residual.ResidualProperties();
             residual.setPath("/test");
                         
-            persistenceManager.insert(residual);
-            persistenceManager.save();
+            ocm.insert(residual);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            residual = (Residual) persistenceManager.getObject( "/test");
+            residual = (Residual) ocm.getObject( "/test");
             assertNotNull("Object is null", residual);
             assertNull("Hashmap is not null", residual.getElements());
             
@@ -108,13 +108,13 @@
             map.put("value5", Arrays.asList(new String[]{ "Value5-1", "Value5-2" }));
             residual.setElements(map);
             
-            persistenceManager.update(residual);
-            persistenceManager.save();
+            ocm.update(residual);
+            ocm.save();
             
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
-            residual = (Residual) persistenceManager.getObject( "/test");
+            residual = (Residual) ocm.getObject( "/test");
             assertNotNull("Object is null", residual);
             assertTrue("Incorrect number of values", residual.getElements().size() == 5);            
             assertTrue("Incorrect collection element", residual.getElements().get("value2").equals("Value2"));
@@ -135,14 +135,14 @@
             map.put("value16", Arrays.asList(new String[]{ "Value16-1", "Value16-2" }));
             residual.setElements(map);
             
-            persistenceManager.update(residual);
-            persistenceManager.save();
+            ocm.update(residual);
+            ocm.save();
 
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------           
 
-            residual = (Residual) persistenceManager.getObject( "/test");
+            residual = (Residual) ocm.getObject( "/test");
             assertNotNull("Object is null", residual);
             assertTrue("Incorrect number of values", residual.getElements().size() == 6);
             assertNull("Unexpected collection element", residual.getElements().get("value2"));

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/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/inheritance/AllTests.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/AllTests.java Mon Jun 18 14:46:42 2007
@@ -34,10 +34,10 @@
     }
 
     public static Test buildSuite() {
-        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.persistence.inheritance");
+        TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.manager.inheritance");
         //$JUnit-BEGIN$
-        suite.addTestSuite(PersistenceManagerInheritanceConcreteClassTest.class);
-        suite.addTestSuite(PersistenceManagerInheritanceHierarchyTest.class);        
+        suite.addTestSuite(ObjectContentManagerInheritanceConcreteClassTest.class);
+        suite.addTestSuite(ObjectContentManagerInheritanceHierarchyTest.class);        
         //$JUnit-END$
 
         return suite;

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java (from r548484, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/PersistenceManagerInheritanceConcreteClassTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java?view=diff&rev=548496&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/PersistenceManagerInheritanceConcreteClassTest.java&r1=548484&p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java&r2=548496
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/PersistenceManagerInheritanceConcreteClassTest.java (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java Mon Jun 18 14:46:42 2007
@@ -41,14 +41,14 @@
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  */
-public class PersistenceManagerInheritanceConcreteClassTest extends TestBase {
-	private final static Log log = LogFactory.getLog(PersistenceManagerInheritanceConcreteClassTest.class);
+public class ObjectContentManagerInheritanceConcreteClassTest extends TestBase {
+	private final static Log log = LogFactory.getLog(ObjectContentManagerInheritanceConcreteClassTest.class);
 
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
 	 */
-	public PersistenceManagerInheritanceConcreteClassTest(String testName) throws Exception {
+	public ObjectContentManagerInheritanceConcreteClassTest(String testName) throws Exception {
 		super(testName);
 
 	}
@@ -56,7 +56,7 @@
 	public static Test suite() {
 		// All methods starting with "test" will be executed in the test suite.
 		return new RepositoryLifecycleTestSetup(new TestSuite(
-				PersistenceManagerInheritanceConcreteClassTest.class));
+				ObjectContentManagerInheritanceConcreteClassTest.class));
 	}
 
 	public void tearDown() throws Exception {
@@ -70,7 +70,7 @@
 	public void testRetrieveSingleton() {
 
 		try {
-			ObjectContentManager persistenceManager = this.getPersistenceManager();
+			ObjectContentManager ocm = this.getObjectContentManager();
 
 			//---------------------------------------------------------------------------------------------------------
 			// Insert a  Document 
@@ -84,15 +84,15 @@
             documentStream.setContent("Test Content".getBytes());
             document.setDocumentStream(documentStream);
             
-            persistenceManager.insert(document);
-			persistenceManager.save();
+            ocm.insert(document);
+			ocm.save();
 			
 			
 			//---------------------------------------------------------------------------------------------------------
 			// Retrieve a document object
 			//---------------------------------------------------------------------------------------------------------						
 
-			document = (DocumentImpl) persistenceManager.getObject( "/document1");
+			document = (DocumentImpl) ocm.getObject( "/document1");
 			assertEquals("Document path is invalid", document.getPath(), "/document1");
 			assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
 			assertNotNull("document stream is null", document.getDocumentStream());
@@ -103,20 +103,20 @@
 			// Update  a descendant object
 			//---------------------------------------------------------------------------------------------------------						
 			document.setName("anotherName");
-			persistenceManager.update(document);
-			persistenceManager.save();
+			ocm.update(document);
+			ocm.save();
 
 			//---------------------------------------------------------------------------------------------------------
 			// Retrieve the updated descendant object
 			//---------------------------------------------------------------------------------------------------------						
-			document = (DocumentImpl) persistenceManager.getObject( "/document1");
+			document = (DocumentImpl) ocm.getObject( "/document1");
 			assertEquals("document name is incorrect", document.getName(), "anotherName");
 			assertEquals("Document path is invalid", document.getPath(), "/document1");
 			assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
 			assertNotNull("document stream is null", document.getDocumentStream());
 			assertTrue("Invalid document stream", document.getDocumentStream().getEncoding().equals("utf-8"));
 
-			CmsObjectImpl cmsObject = (CmsObjectImpl) persistenceManager.getObject( "/document1");
+			CmsObjectImpl cmsObject = (CmsObjectImpl) ocm.getObject( "/document1");
 			assertEquals("cmsObject name is incorrect", cmsObject.getName(), "anotherName");
 			assertEquals("cmsObject path is invalid", cmsObject.getPath(), "/document1");
            			
@@ -130,7 +130,7 @@
 
 	
 	public void testRetrieveCollection() {
-		ObjectContentManager persistenceManager = this.getPersistenceManager();
+		ObjectContentManager ocm = this.getObjectContentManager();
 
 		//---------------------------------------------------------------------------------------------------------
 		// Insert cmsobjects
@@ -143,7 +143,7 @@
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content".getBytes());
         document.setDocumentStream(documentStream);        
-        persistenceManager.insert(document);
+        ocm.insert(document);
         
         document = new DocumentImpl();
         document.setPath("/document2");        
@@ -153,7 +153,7 @@
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content".getBytes());
         document.setDocumentStream(documentStream);       
-        persistenceManager.insert(document);
+        ocm.insert(document);
 
         document = new DocumentImpl();
         document.setPath("/document3");        
@@ -163,12 +163,12 @@
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content 3".getBytes());
         document.setDocumentStream(documentStream);       
-        persistenceManager.insert(document);
+        ocm.insert(document);
         
         FolderImpl folder = new FolderImpl();
         folder.setPath("/folder1");
         folder.setName("folder1");
-        persistenceManager.insert(folder);
+        ocm.insert(folder);
  
 
         document = new DocumentImpl();        
@@ -187,24 +187,24 @@
         folder.setName("folder2");        
         folder.addChild(document);
         folder.addChild(subFolder);
-        persistenceManager.insert(folder);               		
+        ocm.insert(folder);               		
         
         
 		Atomic a = new Atomic();
 		a.setPath("/atomic");
 		a.setBooleanPrimitive(true);
-		persistenceManager.insert(a);
+		ocm.insert(a);
 
-		persistenceManager.save();
+		ocm.save();
 
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve Folders found on the root level
 		//---------------------------------------------------------------------------------------------------------			
-		QueryManager queryManager = persistenceManager.getQueryManager();
+		QueryManager queryManager = ocm.getQueryManager();
 		Filter filter = queryManager.createFilter(FolderImpl.class);
 		Query query = queryManager.createQuery(filter);
 		filter.setScope("/");
-		Collection result = persistenceManager.getObjects(query);
+		Collection result = ocm.getObjects(query);
 		assertEquals("Invalid number of folders found", result.size(), 2);
 		assertTrue("Invalid item in the collection", this.contains(result, "/folder1",FolderImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/folder2", FolderImpl.class));		
@@ -213,13 +213,13 @@
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve Documents 
 		//---------------------------------------------------------------------------------------------------------			
-		queryManager = persistenceManager.getQueryManager();
+		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(DocumentImpl.class);
 		
 		filter.addLike("name", "document name%");
 		query = queryManager.createQuery(filter);
 
-		result = persistenceManager.getObjects(query);
+		result = ocm.getObjects(query);
 		assertEquals("Invalid number of documents  found", result.size(),2);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));
@@ -228,14 +228,14 @@
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve folder2 
 		//---------------------------------------------------------------------------------------------------------	
-		FolderImpl folder2 = (FolderImpl) persistenceManager.getObject( "/folder2");
+		FolderImpl folder2 = (FolderImpl) ocm.getObject( "/folder2");
 		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));
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/subfolder", FolderImpl.class));
 		
 		
-		CmsObjectImpl cmsObject = (CmsObjectImpl) persistenceManager.getObject( "/folder2");
+		CmsObjectImpl cmsObject = (CmsObjectImpl) ocm.getObject( "/folder2");
 		assertNotNull("folder 2 is null", cmsObject);
 		assertTrue("Invalid instance for folder 2",  cmsObject instanceof FolderImpl);
 		assertEquals("Invalid number of documents  found in folder2 children",  folder2.getChildren().size(),2);
@@ -245,12 +245,12 @@
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve Contents (ancestor of Documents) 
 		//---------------------------------------------------------------------------------------------------------			
-		queryManager = persistenceManager.getQueryManager();
+		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(ContentImpl.class);
 		filter.addLike("name", "document name%");
 		query = queryManager.createQuery(filter);
 
-		result = persistenceManager.getObjects(query);
+		result = ocm.getObjects(query);
 		assertEquals("Invalid number of documents  found", result.size(),2);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));
@@ -259,12 +259,12 @@
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve all cmsobjects found on the root level
 		//---------------------------------------------------------------------------------------------------------					
-		queryManager = persistenceManager.getQueryManager();
+		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(CmsObjectImpl.class);
 		filter.setScope("/");
 		query = queryManager.createQuery(filter);
 
-		result = persistenceManager.getObjects(query);
+		result = ocm.getObjects(query);
 		assertEquals("Invalid ancestor object found", result.size(),5);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));	
@@ -276,11 +276,11 @@
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve all cmsobjects found anywhere
 		//---------------------------------------------------------------------------------------------------------					
-		queryManager = persistenceManager.getQueryManager();
+		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(CmsObjectImpl.class);		
 		query = queryManager.createQuery(filter);
 
-		result = persistenceManager.getObjects(query);
+		result = ocm.getObjects(query);
 		assertEquals("Invalid ancestor object found", result.size(),7);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));	
@@ -293,7 +293,7 @@
 	}
 	  
 	public void testBeanCollection() {
-		ObjectContentManager persistenceManager = this.getPersistenceManager();
+		ObjectContentManager ocm = this.getObjectContentManager();
 
 		//---------------------------------------------------------------------------------------------------------
 		// Insert cmsobjects
@@ -320,14 +320,14 @@
 	         	    	 
 	     }
 	     log.debug("Save the folder and its 200 children");   
-	     persistenceManager.insert(folder);
-	     persistenceManager.save();
+	     ocm.insert(folder);
+	     ocm.save();
 	     log.debug("End - Save the folder and its 200 children");
 
 		//---------------------------------------------------------------------------------------------------------	
 		// Retrieve Folder
 		//---------------------------------------------------------------------------------------------------------			
-		folder  = (FolderImpl) persistenceManager.getObject("/mainfolder");
+		folder  = (FolderImpl) ocm.getObject("/mainfolder");
 		assertNotNull("Folder is null",folder);		
 		Collection children = folder.getChildren();
 		assertEquals("Invalid number of children", children.size(), 200);



Mime
View raw message