continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r209940 - /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java
Date Sat, 09 Jul 2005 13:13:50 GMT
Author: trygvis
Date: Sat Jul  9 06:13:48 2005
New Revision: 209940

URL: http://svn.apache.org/viewcvs?rev=209940&view=rev
Log:
o Adding my JPOX test case.

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=209940&r1=209939&r2=209940&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
Sat Jul  9 06:13:48 2005
@@ -208,6 +208,44 @@
     // Developers
     // ----------------------------------------------------------------------
 
+    public void testCollectionManipulation()
+        throws Exception
+    {
+        ContinuumProject p = makeProject( store );
+
+        p = store.getContinuumProject( p.getId(), true );
+
+        List devs = p.getDevelopers();
+        ContinuumDeveloper dev = new ContinuumDeveloper();
+        dev.setEmail( "boo@bar.com" );
+        dev.setName( "Trygve" );
+        devs.add( dev );
+
+        store.storeContinuumProject( p );
+
+        p = store.getContinuumProject( p.getId(), true );
+        devs = p.getDevelopers();
+        assertEquals( 1, devs.size() );
+        dev = new ContinuumDeveloper();
+        dev.setEmail( "foo@bar.com" );
+        dev.setName( "Jason" );
+        devs.add( dev );
+
+        store.storeContinuumProject( p );
+
+        p = store.getContinuumProject( p.getId(), true );
+        devs = p.getDevelopers();
+        assertEquals( 2, devs.size() );
+        devs.remove( 0 );
+        devs.remove( 0 );
+        assertEquals( 0, devs.size() );
+        store.storeContinuumProject( p );
+
+        p = store.getContinuumProject( p.getId(), true );
+        devs = p.getDevelopers();
+        assertEquals( 0, devs.size() );
+    }
+
     public void testDevelopersInProject()
         throws Exception
     {



Mime
View raw message