continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r191124 - /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java
Date Fri, 17 Jun 2005 10:20:00 GMT
Author: trygvis
Date: Fri Jun 17 03:19:57 2005
New Revision: 191124

URL: http://svn.apache.org/viewcvs?rev=191124&view=rev
Log: (empty)

Modified:
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java?rev=191124&r1=191123&r2=191124&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java
Fri Jun 17 03:19:57 2005
@@ -17,6 +17,7 @@
  */
 
 import java.util.Collection;
+import java.util.Iterator;
 
 import javax.jdo.PersistenceManagerFactory;
 import javax.jdo.JDODetachedFieldAccessException;
@@ -34,6 +35,37 @@
 public class ContinuumJPoxStoreTest
     extends PlexusTestCase
 {
+    private JdoFactory jdoFactory;
+
+    private PersistenceManagerFactory pmf;
+
+    private ContinuumJPoxStore store;
+
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        jdoFactory = (JdoFactory) lookup( JdoFactory.ROLE );
+
+        pmf = jdoFactory.getPersistenceManagerFactory();
+
+        store = new ContinuumJPoxStore( pmf );
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        Collection projects = store.getContinuumProjectCollection( true, "", "" );
+
+        for ( Iterator it = projects.iterator(); it.hasNext(); )
+        {
+            ContinuumProject project = (ContinuumProject) it.next();
+
+            store.deleteContinuumProject( project.getId() );
+        }
+    }
+
     public void testCascadingDelete()
         throws Exception
     {
@@ -81,21 +113,17 @@
     public void testFetchGroups()
         throws Exception
     {
-        JdoFactory jdoFactory = (JdoFactory) lookup( JdoFactory.ROLE );
-
-        PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
-
-        ContinuumJPoxStore store = new ContinuumJPoxStore( pmf );
-
         ContinuumProject p = makeProject( store );
 
+        String projectId = p.getId();
+
         // ----------------------------------------------------------------------
         // Try to get a single project. This object should include the
         // "detailed" fetch group so it should be possible to access all
         // collections.
         // ----------------------------------------------------------------------
 
-        p = store.getContinuumProject( p.getId(), true );
+        p = store.getContinuumProject( projectId, true );
 
         assertEquals( "check out error exception", p.getCheckOutErrorException() );
 
@@ -112,9 +140,14 @@
 
         Collection projects = store.getContinuumProjectCollection( true, "", "" );
 
+        assertEquals( "projects.size", 1 , projects.size() );
+
         p = (ContinuumProject) projects.iterator().next();
 
-        assertEquals( "check out error exception", p.getCheckOutErrorException() );
+        assertEquals( "project.id", projectId, p.getId() );
+
+        assertEquals( "project.checkOutException",
+                      "check out error exception", p.getCheckOutErrorException() );
 
         // ----------------------------------------------------------------------
         // This is a 1..1 association



Mime
View raw message