incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r321219 - in /incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr: ./ persistence/atomicconverter/ persistence/collectionconverter/impl/ persistence/impl/
Date Fri, 14 Oct 2005 21:01:28 GMT
Author: clombart
Date: Fri Oct 14 14:01:09 2005
New Revision: 321219

URL: http://svn.apache.org/viewcvs?rev=321219&view=rev
Log:
unit test clean-up - GRFT-62

Modified:
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
Fri Oct 14 14:01:09 2005
@@ -137,6 +137,7 @@
 		super.tearDown();
 	}
 
+	
 	/** Getter for property persistenceManager.
 	 * @return jcrSession
 	 */

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
Fri Oct 14 14:01:09 2005
@@ -54,18 +54,34 @@
         return new TestSuite(AtomicTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }
+    
     public void testAtomicFields()
     {
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
 
-            if (persistenceManager.itemExists("/test"))
-            {
-            	persistenceManager.remove("/test");
-            	persistenceManager.save();
-            }
-
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
@@ -117,7 +133,7 @@
             
             assertNotNull("Incorrect input stream primitive", a.getInputStream());
             assertNotNull("Incorrect timestamp", a.getTimestamp());
-            assertTrue("Invalid timestamp value ", a.getTimestamp().getTime() == now);
+            assertTrue("Invalid timestamp value ", a.getTimestamp().getTime() == now);  
         
             
         }
         catch (Exception e)

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java
Fri Oct 14 14:01:09 2005
@@ -62,6 +62,28 @@
         // All methods starting with "test" will be executed in the test suite.
         return new TestSuite(NullAtomicTest.class);
     }
+    
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }    
 
     public void testNullValueAtomicFields()
     {
@@ -69,11 +91,7 @@
         {
 
         	PersistenceManager persistenceManager = getPersistenceManager();
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-            }
-
+     
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java
Fri Oct 14 14:01:09 2005
@@ -53,18 +53,35 @@
         return new TestSuite(DefaultCollectionConverterImplTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }
+    
     public void testDropElement()
     {
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
 
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-                persistenceManager.save();
-            }
-
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
@@ -148,11 +165,6 @@
         {
 
         	PersistenceManager persistenceManager = getPersistenceManager();
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-                persistenceManager.save();
-            }
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java
Fri Oct 14 14:01:09 2005
@@ -55,17 +55,35 @@
         return new TestSuite(HashMapTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }    
+    
     public void testHashMap()
     {
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
         	
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-                persistenceManager.save();
-            }
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java
Fri Oct 14 14:01:09 2005
@@ -56,17 +56,34 @@
         return new TestSuite(MultiValueCollectionConverterImplTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }    
+
     public void testMultiValue()
     {
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
-
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-                persistenceManager.save();
-            }
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java
Fri Oct 14 14:01:09 2005
@@ -54,18 +54,35 @@
         // All methods starting with "test" will be executed in the test suite.
         return new TestSuite(NTCollectionConverterImplTest.class);
     }
+    
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }       
 
     public void testCollection()
     {
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
-
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-                persistenceManager.save();
-            }
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java
Fri Oct 14 14:01:09 2005
@@ -42,7 +42,8 @@
 public class PersistenceManagerAtomicQueryTest extends TestBase
 {
 	private final static Log log = LogFactory.getLog(PersistenceManagerAtomicQueryTest.class);
-
+	private Date date = new Date();
+	
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
@@ -59,6 +60,16 @@
 		return new TestSuite(PersistenceManagerAtomicQueryTest.class);
 	}
 	
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+		this.importData(date);
+        
+    }
+    
     public void tearDown() throws Exception
     {
 
@@ -80,8 +91,6 @@
 
 		try
 		{
-			Date date = new Date();
-			this.importData(date);
 			
 			PersistenceManager persistenceManager = this.getPersistenceManager();
 			

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
Fri Oct 14 14:01:09 2005
@@ -63,6 +63,26 @@
         return new TestSuite(PersistenceManagerIteratorQueryTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+		this.importData();
+        
+    }
+    
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }    
+        
+        super.tearDown();
+    }	
     
     /**
      * Test equalTo
@@ -74,8 +94,6 @@
     	try
     	{
     		
-    		  importData();
-    		  
     		  // No scope    		  
     	      QueryManager queryManager = this.getQueryManager();
     	      Filter filter = queryManager.createFilter(Page.class);        	      

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java
Fri Oct 14 14:01:09 2005
@@ -58,13 +58,32 @@
         return new TestSuite(PersistenceManagerMultiValueQueryTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+		this.importData();
+        
+    }
+    
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }    
+        
+        super.tearDown();
+    }	
+    
     public void testMultiValueSearch()
     {
         try
         {
         	
-          importData();
-          
   	      QueryManager queryManager = this.getQueryManager();
 	      Filter filter = queryManager.createFilter(MultiValue.class);    
 	      filter.addEqualTo("multiValues", "Value1");
@@ -98,12 +117,6 @@
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
-
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-                persistenceManager.save();
-            }
 
 			PersistenceManagerImpl persistenceManagerImpl = (PersistenceManagerImpl) persistenceManager;
 			

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java
Fri Oct 14 14:01:09 2005
@@ -43,7 +43,7 @@
 public class PersistenceManagerRemoveTest extends TestBase
 {
 	private final static Log log = LogFactory.getLog(PersistenceManagerRemoveTest.class);
-
+	private Date date = new Date();
 	/**
 	 * <p>Defines the test case name for junit.</p>
 	 * @param testName The test case name.
@@ -60,10 +60,20 @@
 		return new TestSuite(PersistenceManagerRemoveTest.class);
 	}
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+		this.importData(date);
+        
+    }
+	
 	public void tearDown() throws Exception
 	{
 
-		for (int i = 1; i <= 100; i++)
+		for (int i = 1; i <= 10; i++)
 		{
 			if (getPersistenceManager().itemExists("/test" + i))
 			{
@@ -80,9 +90,7 @@
 
 		try
 		{
-			Date date = new Date();
-			this.importData(date);
-
+			
 			PersistenceManager persistenceManager = this.getPersistenceManager();
 			persistenceManager.remove("/test5");
 			persistenceManager.save();
@@ -116,11 +124,6 @@
 		{
 
 			PersistenceManager persistenceManager = getPersistenceManager();
-
-			if (persistenceManager.itemExists("/test"))
-			{
-				persistenceManager.remove("/test");
-			}
 
 			for (int i = 1; i <= 10; i++)
 			{

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java
Fri Oct 14 14:01:09 2005
@@ -62,6 +62,26 @@
         return new TestSuite(PersistenceManagerScopeQueryTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+		this.importData();
+        
+    }
+    
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().itemExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }    
+        
+        super.tearDown();
+    }	
     
     /**
      * Test equalTo
@@ -73,8 +93,6 @@
     	try
     	{
     		
-    		  importData();
-    		  
     		  // No scope    		  
     	      QueryManager queryManager = this.getQueryManager();
     	      Filter filter = queryManager.createFilter(Paragraph.class);    
@@ -147,10 +165,6 @@
     	try
 		{
     		PersistenceManager persistenceManager = getPersistenceManager();
-        	if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-            }
         	
 			PersistenceManagerImpl persistenceManagerImpl = (PersistenceManagerImpl) persistenceManager;
 			

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java
Fri Oct 14 14:01:09 2005
@@ -255,10 +255,6 @@
     private void importData() throws JcrMappingException 
     {
     	PersistenceManager persistenceManager = getPersistenceManager();
-    	if (persistenceManager.itemExists("/test"))
-        {
-            persistenceManager.remove("/test");
-        }
 
         Page page = new Page();
         page.setTitle("Page Title");

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java?rev=321219&r1=321218&r2=321219&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java
Fri Oct 14 14:01:09 2005
@@ -60,16 +60,29 @@
         return new TestSuite(PersistenceManagerTest.class);
     }
 
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+    	getPersistenceManager().remove("/test");
+        super.tearDown();
+    }
+    
     public void testClassA()
     {
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
 
-            if (persistenceManager.itemExists("/test"))
-            {
-                persistenceManager.remove("/test");
-            }
 
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository



Mime
View raw message