continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r191364 - in /maven/continuum/trunk: ./ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/core/ con...
Date Sun, 19 Jun 2005 21:08:41 GMT
Author: trygvis
Date: Sun Jun 19 14:08:39 2005
New Revision: 191364

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

Modified:
    maven/continuum/trunk/build.bat
    maven/continuum/trunk/build.sh
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/pom.xml
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/ContinuumJPoxStoreTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
    maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
    maven/continuum/trunk/pom.xml

Modified: maven/continuum/trunk/build.bat
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/build.bat?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/build.bat (original)
+++ maven/continuum/trunk/build.bat Sun Jun 19 14:08:39 2005
@@ -32,6 +32,9 @@
 SET INCLUDES=continuum-api/pom.xml,continuum-cc/pom.xml,continuum-core/pom.xml,continuum-model/pom.xml,continuum-notifiers/pom.xml,continuum-notifiers/continuum-jabber-notifier/pom.xml,continuum-notifiers/continuum-msn-notifier/pom.xml,continuum-web/pom.xml,continuum-xmlrpc/pom.xml
 
 call m2 -N install %MAVEN_CMD_LINE_ARGS%
+cd continuum-notifiers
+call m2 -N install %MAVEN_CMD_LINE_ARGS%
+cd ..
 call m2 -r -Dmaven.reactor.includes=*/pom.xml clean:clean %MAVEN_CMD_LINE_ARGS%
 call m2 -r -Dmaven.reactor.includes="%INCLUDES%" install %MAVEN_CMD_LINE_ARGS%
 cd continuum-plexus-application

Modified: maven/continuum/trunk/build.sh
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/build.sh?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/build.sh (original)
+++ maven/continuum/trunk/build.sh Sun Jun 19 14:08:39 2005
@@ -16,6 +16,7 @@
 
 (
   m2 -N install "$@"
+  (cd continuum-notifiers && m2 -N install "$@" )
   m2 -r -Dmaven.reactor.includes=*/pom.xml clean:clean "$@"
   m2 -r -Dmaven.reactor.includes="$includes" install "$@"
   (cd continuum-plexus-application && sh build.sh "$@")

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Sun Jun 19 14:08:39 2005
@@ -49,13 +49,13 @@
     void updateProject( ContinuumProject project )
         throws ContinuumStoreException;
 
-    void updateProject( String projectId,
-                        String name,
-                        String scmUrl,
-                        List notifiers,
-                        String version,
-                        String commandLineArguments )
-        throws ContinuumStoreException;
+//    void updateProject( String projectId,
+//                        String name,
+//                        String scmUrl,
+//                        List notifiers,
+//                        String version,
+//                        String commandLineArguments )
+//        throws ContinuumStoreException;
 
     // ----------------------------------------------------------------------
     // ContinuumProject Queries

Modified: maven/continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/pom.xml?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/pom.xml Sun Jun 19 14:08:39 2005
@@ -18,6 +18,10 @@
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>jpox</groupId>
+      <artifactId>jpox</artifactId>
+    </dependency>
     <!--
      |
      | Plexus Dependencies

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sun Jun 19 14:08:39 2005
@@ -482,11 +482,12 @@
     private void updateProject( ContinuumProject project )
         throws ContinuumException
     {
-        core.updateProject( project.getId(),
-                            project.getName(),
-                            project.getScmUrl(),
-                            project.getNotifiers(),
-                            project.getVersion(),
-                            project.getCommandLineArguments() );
+        core.updateProject( project );
+//        core.updateProject( project.getId(),
+//                            project.getName(),
+//                            project.getScmUrl(),
+//                            project.getNotifiers(),
+//                            project.getVersion(),
+//                            project.getCommandLineArguments() );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
Sun Jun 19 14:08:39 2005
@@ -56,13 +56,16 @@
     void updateProjectFromScm( String projectId )
         throws ContinuumException;
 
-    void updateProject( String projectId,
-                        String name,
-                        String scmUrl,
-                        List notifiers,
-                        String version,
-                        String commandLineArguments )
+    void updateProject( ContinuumProject project )
         throws ContinuumException;
+
+//    void updateProject( String projectId,
+//                        String name,
+//                        String scmUrl,
+//                        List notifiers,
+//                        String version,
+//                        String commandLineArguments )
+//        throws ContinuumException;
 
     ContinuumProject getProject( String projectId )
         throws ContinuumException;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
Sun Jun 19 14:08:39 2005
@@ -234,6 +234,19 @@
         return project.getId();
     }
 
+    public void removeProject( String projectId )
+        throws ContinuumException
+    {
+        try
+        {
+            store.removeProject( projectId );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Error while removing project.", ex );
+        }
+    }
+
     public void updateProjectFromScm( String projectId )
         throws ContinuumException
     {
@@ -277,44 +290,45 @@
         updateProjectFromCheckOut( project );
     }
 
-    public void updateProject( String projectId,
-                               String name,
-                               String scmUrl,
-                               List notifiers,
-                               String version,
-                               String commandLineArguments )
+    public void updateProject( ContinuumProject project )
         throws ContinuumException
     {
         try
         {
-            commandLineArguments = StringUtils.clean( commandLineArguments );
-
-            store.updateProject( projectId,
-                                 name,
-                                 scmUrl,
-                                 notifiers,
-                                 version,
-                                 commandLineArguments );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw logAndCreateException( "Error while updating the project.", e );
-        }
-    }
-
-    public void removeProject( String projectId )
-        throws ContinuumException
-    {
-        try
-        {
-            store.removeProject( projectId );
+            store.updateProject( project );
         }
         catch ( ContinuumStoreException ex )
         {
             throw logAndCreateException( "Error while removing project.", ex );
         }
+
     }
 
+//    public void updateProject( String projectId,
+//                               String name,
+//                               String scmUrl,
+//                               List notifiers,
+//                               String version,
+//                               String commandLineArguments )
+//        throws ContinuumException
+//    {
+//        try
+//        {
+//            commandLineArguments = StringUtils.clean( commandLineArguments );
+//
+//            store.updateProject( projectId,
+//                                 name,
+//                                 scmUrl,
+//                                 notifiers,
+//                                 version,
+//                                 commandLineArguments );
+//        }
+//        catch ( ContinuumStoreException e )
+//        {
+//            throw logAndCreateException( "Error while updating the project.", e );
+//        }
+//    }
+
     public ContinuumProject getProject( String projectId )
         throws ContinuumException
     {
@@ -597,9 +611,6 @@
     {
         getLogger().info( "Updating project '" + project.getName() + "'." );
 
-        // Save the ID now in case the builder fucks it up
-        String id = project.getId();
-
         // ----------------------------------------------------------------------
         // Make a new descriptor
         // ----------------------------------------------------------------------
@@ -621,12 +632,14 @@
 
         try
         {
-            store.updateProject( id,
-                                 project.getName(),
-                                 project.getScmUrl(),
-                                 project.getNotifiers(),
-                                 project.getVersion(),
-                                 project.getCommandLineArguments() );
+//            store.updateProject( id,
+//                                 project.getName(),
+//                                 project.getScmUrl(),
+//                                 project.getNotifiers(),
+//                                 project.getVersion(),
+//                                 project.getCommandLineArguments() );
+
+            store.updateProject( project );
         }
         catch ( ContinuumStoreException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
Sun Jun 19 14:08:39 2005
@@ -119,7 +119,7 @@
         else
         {
             String currentNagEmailAddress = null;
-            
+
             if ( project.getNotifiers() != null && !project.getNotifiers().isEmpty()
)
             {
                 for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); )
@@ -129,7 +129,7 @@
                     // Can we have an other type for maven 1 project?
                     if ( "mail".equals( notif.getType() ) )
                     {
-                        currentNagEmailAddress = notif.getConfiguration().getProperty( ContinuumRecipientSource.ADDRESS_FIELD
);
+                        currentNagEmailAddress = (String) notif.getConfiguration().get( ContinuumRecipientSource.ADDRESS_FIELD
);
                     }
                 }
             }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
Sun Jun 19 14:08:39 2005
@@ -91,7 +91,7 @@
 
                 if ( notifier.getType().equals( notifierType ) && notifier.getConfiguration().containsKey(
ADDRESS_FIELD ) )
                 {
-                    String addressField = notifier.getConfiguration().getProperty( ADDRESS_FIELD
);
+                    String addressField = (String) notifier.getConfiguration().get( ADDRESS_FIELD
);
 
                     String[] addresses = StringUtils.split( addressField, "," );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
Sun Jun 19 14:08:39 2005
@@ -19,7 +19,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 import org.apache.maven.continuum.project.ContinuumBuild;
@@ -43,13 +42,13 @@
     extends AbstractLogEnabled
     implements ContinuumNotificationDispatcher
 {
-    /** @requirement */
+    /** @plexus.requirement */
     private NotifierManager notifierManager;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private ContinuumStore store;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private RecipientSource recipientSource;
 
     // ----------------------------------------------------------------------
@@ -140,7 +139,7 @@
 
                 String notifierType = continuumNotifier.getType();
 
-                Properties configuration = continuumNotifier.getConfiguration();
+                Map configuration = continuumNotifier.getConfiguration();
 
                 Notifier notifier = notifierManager.getNotifier( notifierType );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
Sun Jun 19 14:08:39 2005
@@ -55,7 +55,7 @@
     extends AbstractContinuumStore
     implements ContinuumStore, Initializable
 {
-    /** @requirement */
+    /** @plexus.requirement */
     private JdoFactory jdoFactory;
 
     private ContinuumJPoxStore store;
@@ -175,43 +175,64 @@
     {
         try
         {
-            store.storeContinuumProject( project );
-        }
-        catch ( Exception e )
-        {
-            throw new ContinuumStoreException( "Error while setting the working directory.",
e );
-        }
-    }
+            project.setCommandLineArguments( StringUtils.clean( project.getCommandLineArguments()
) );
 
-    public void updateProject( String projectId,
-                               String name,
-                               String scmUrl,
-                               List notifiers,
-                               String version,
-                               String commandLineArguments )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
+            store.storeContinuumProject( project );
 
-            ContinuumProject project = store.getContinuumProject( projectId, false );
+//            pm.attachCopyAll( project.getDevelopers(), true );
+//
+//            Collection notifiers = project.getNotifiers();
 
-            project.setName( name );
-            project.setScmUrl( scmUrl );
-            project.setNotifiers( notifiers );
-            project.setVersion( version );
-            project.setCommandLineArguments( commandLineArguments );
+//            System.err.println( "updating " + notifiers.size() );
+//
+//            for ( Iterator it = notifiers.iterator(); it.hasNext(); )
+//            {
+//                ContinuumNotifier notifier = (ContinuumNotifier) it.next();
+//
+//                System.err.println( "type: " + notifier.getType() );
+//                System.err.println( "config:" + notifier.getConfiguration() );
+//                System.err.println( "id: " + JDOHelper.getObjectId( notifier ) );
+//
+//                pm.attachCopy( notifier, true );
+//            }
 
-            store.commit();
+//            pm.attachCopyAll( notifiers, true );
         }
         catch ( Exception e )
         {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while updating project.", e );
+            throw new ContinuumStoreException( "Error while setting the working directory.",
e );
         }
     }
+
+//    public void updateProject( String projectId,
+//                               String name,
+//                               String scmUrl,
+//                               List notifiers,
+//                               String version,
+//                               String commandLineArguments )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            project.setName( name );
+//            project.setScmUrl( scmUrl );
+//            project.setNotifiers( notifiers );
+//            project.setVersion( version );
+//            project.setCommandLineArguments( commandLineArguments );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while updating project.", e );
+//        }
+//    }
 
     public Collection getAllProjects()
         throws ContinuumStoreException

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=191364&r1=191363&r2=191364&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
Sun Jun 19 14:08:39 2005
@@ -18,9 +18,11 @@
 
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 
-import javax.jdo.PersistenceManagerFactory;
 import javax.jdo.JDODetachedFieldAccessException;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
 
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ScmFile;
@@ -66,6 +68,155 @@
         }
     }
 
+    public void testNotifiers()
+        throws Exception
+    {
+        // ----------------------------------------------------------------------
+        // Store a single notifier
+        // ----------------------------------------------------------------------
+
+        ContinuumNotifier n = new ContinuumNotifier();
+
+        n.setType( "foo" );
+
+        n.getConfiguration().put( "foo", "bar" );
+
+        Object oid = store.addContinuumNotifier( n );
+
+        n = store.getContinuumNotifierByJdoId( oid, true );
+
+        assertEquals( "foo", n.getType() );
+
+        assertNotNull( n.getConfiguration() );
+
+        assertEquals( 1, n.getConfiguration().size() );
+
+        assertEquals( "bar", n.getConfiguration().get( "foo" ) );
+
+        // ----------------------------------------------------------------------
+        // Update a single notifier
+        // ----------------------------------------------------------------------
+
+        n = store.getContinuumNotifierByJdoId( oid, true );
+
+        n.setType( "bar" );
+
+        n.getConfiguration().remove( "foo" );
+
+        n.getConfiguration().put( "bar", "foo" );
+
+        PersistenceManager pm = store.begin();
+
+        pm.attachCopy( n, true );
+
+        store.commit();
+
+        n = store.getContinuumNotifierByJdoId( oid, true );
+
+        assertNotifier( "bar", "bar", "foo", n );
+
+        assertEquals( 1, n.getConfiguration().size() );
+    }
+
+    public void testNotifiersInProject()
+        throws Exception
+    {
+        // ----------------------------------------------------------------------
+        // Make a project with two notifiers
+        // ----------------------------------------------------------------------
+
+        ContinuumProject p = makeProject( store );
+
+        ContinuumNotifier n;
+
+        n = makeNotifier( "foo", "foo", "bar" );
+
+        p.getNotifiers().add( n );
+
+        n = makeNotifier( "bar", "bar", "foo" );
+
+        p.getNotifiers().add( n );
+
+        store.storeContinuumProject( p );
+
+        // ----------------------------------------------------------------------
+        // Assert
+        // ----------------------------------------------------------------------
+
+        p = store.getContinuumProject( p.getId(), true );
+
+        List notifiers = p.getNotifiers();
+
+        assertEquals( 2, notifiers.size() );
+
+        assertNotifier( "foo", "foo", "bar", (ContinuumNotifier)notifiers.get( 0 ) );
+
+        assertNotifier( "bar", "bar", "foo", (ContinuumNotifier) notifiers.get( 1 ) );
+
+        // ----------------------------------------------------------------------
+        // Modify the first notifier
+        // ----------------------------------------------------------------------
+
+        System.err.println( "***" );
+        System.err.println( "***" );
+        System.err.println( "***" );
+
+        System.err.println( "store.getContinuumProject( p.getId(), true );" );
+        p = store.getContinuumProject( p.getId(), true );
+
+        System.err.println( "p.getNotifiers();" );
+        notifiers = p.getNotifiers();
+
+        System.err.println( "notifiers.get( 0 );" );
+        n = (ContinuumNotifier) notifiers.get( 0 );
+
+        System.err.println( "n.setType( \"baz\" );" );
+        n.setType( "baz" );
+
+        // change a existsing property
+        System.err.println( "n.getConfiguration().put( \"foo\", \"foo\" );" );
+        n.getConfiguration().put( "foo", "foo" );
+
+        // add another property
+        System.err.println( "n.getConfiguration().put( \"baz\", \"yay\" );" );
+        n.getConfiguration().put( "baz", "yay" );
+
+        System.err.println( "store.storeContinuumProject( p );" );
+        store.storeContinuumProject( p );
+        
+        System.err.println( "***" );
+        System.err.println( "***" );
+        System.err.println( "***" );
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        p = store.getContinuumProject( p.getId(), true );
+
+        notifiers = p.getNotifiers();
+
+        assertEquals( 2, notifiers.size() );
+
+        n = (ContinuumNotifier) notifiers.get( 0 );
+
+        assertEquals( "baz", n.getType() );
+
+        assertNotNull( n.getConfiguration() );
+
+        assertEquals( "foo", n.getConfiguration().get( "foo" ) );
+
+        assertEquals( "yay", n.getConfiguration().get( "baz" ) );
+
+        n = (ContinuumNotifier) notifiers.get( 1 );
+
+        assertEquals( "bar", n.getType() );
+
+        assertNotNull( n.getConfiguration() );
+
+        assertEquals( "foo", n.getConfiguration().get( "bar" ) );
+    }
+
     public void testCascadingDelete()
         throws Exception
     {
@@ -184,6 +335,28 @@
     //
     // ----------------------------------------------------------------------
 
+    private void assertNotifier( String type, String key, String value, ContinuumNotifier
notifier )
+    {
+        assertEquals( type, notifier.getType() );
+
+        assertNotNull( notifier.getConfiguration() );
+
+        assertEquals( 1, notifier.getConfiguration().size() );
+
+        assertEquals( value, notifier.getConfiguration().get( key ) );
+    }
+
+    private ContinuumNotifier makeNotifier( String type, String key, String value )
+    {
+        ContinuumNotifier notifier = new ContinuumNotifier();
+
+        notifier.setType( type );
+
+        notifier.getConfiguration().put( key, value );
+
+        return notifier;
+    }
+
     private ContinuumProject makeProject( ContinuumJPoxStore store )
         throws Exception
     {
@@ -247,6 +420,6 @@
         //
         // ----------------------------------------------------------------------
 
-        return p;
+        return store.getContinuumProjectByJdoId( oid, true );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Sun Jun 19 14:08:39 2005
@@ -169,14 +169,6 @@
 
         configuration.setProperty( "foo", "bar" );
 
-        ContinuumProject expected = makeMavenTwoProject( "Test Project",
-                                                         "scm:local:src/test/repo",
-                                                         "foo@bar.com",
-                                                         "1.0",
-                                                         "a b",
-                                                         "maven2",
-                                                         "/tmp" );
-
         String projectId = store.addProject( makeMavenTwoProject( "Test Project",
                                                                   "scm:local:src/test/repo",
                                                                   "foo@bar.com",
@@ -189,7 +181,13 @@
 
         ContinuumProject actual = store.getProject( projectId );
 
-        assertProjectEquals( projectId, expected, actual );
+        assertProjectEquals( projectId, makeMavenTwoProject( "Test Project",
+                                                             "scm:local:src/test/repo",
+                                                             "foo@bar.com",
+                                                             "1.0",
+                                                             "a b",
+                                                             "maven2",
+                                                             "/tmp" ), actual );
     }
 
 
@@ -223,19 +221,21 @@
         String builderId = "maven2";
         String workingDirectory = "/tmp";
 
-        String projectId = store.addProject( makeMavenTwoProject( name,
-                                                                  scmUrl,
-                                                                  nagEmailAddress,
-                                                                  version,
-                                                                  commandLineArguments,
-                                                                  builderId,
-                                                                  workingDirectory ) );
+        ContinuumProject project = makeMavenTwoProject( name,
+                                                        scmUrl,
+                                                        nagEmailAddress,
+                                                        version,
+                                                        commandLineArguments,
+                                                        builderId,
+                                                        workingDirectory );
+
+        String projectId = store.addProject( project );
 
         // ----------------------------------------------------------------------
         //
         // ----------------------------------------------------------------------
 
-        ContinuumProject project = store.getProject( projectId );
+        project = store.getProject( projectId );
 
         assertNotNull( project );
 
@@ -261,25 +261,44 @@
         //
         // ----------------------------------------------------------------------
 
+        project = store.getProject( projectId );
+        System.err.println( ( (ContinuumNotifier) project.getNotifiers().get( 0 ) ).getConfiguration()
);
+
         String name2 = "name 2";
         String scmUrl2 = "scm url 2";
         String emailAddress2 = "2@bar";
         String version2 = "v2";
         String commandLineArguments2 = "";
 
-        store.updateProject( projectId,
-                             name2,
-                             scmUrl2,
-                             createNotifiers( emailAddress2 ),
-                             version2,
-                             commandLineArguments2 );
+        project.setName( name2 );
+        project.setScmUrl( scmUrl2 );
+
+        ContinuumNotifier notifier = ((ContinuumNotifier) project.getNotifiers().get( 0 ));
+        notifier.setType( "kewk" );
+        notifier.getConfiguration().put( "address", emailAddress2 );
+        notifier.getConfiguration().put( "name", "tryg" );
+        project.setVersion( version2 );
+        project.setCommandLineArguments( commandLineArguments2 );
+
+        System.err.println( ( (ContinuumNotifier) project.getNotifiers().get( 0 ) ).getConfiguration()
);
+        store.updateProject( project );
+        System.err.println( ( (ContinuumNotifier) project.getNotifiers().get( 0 ) ).getConfiguration()
);
 
         project = store.getProject( projectId );
 
+        System.err.println( ((ContinuumNotifier)project.getNotifiers().get(0)).getConfiguration()
);
+
+        notifier = new ContinuumNotifier();
+        notifier.setType( "kewk" );
+        notifier.getConfiguration().put( "address", emailAddress2 );
+        notifier.getConfiguration().put( "name", "tryg" );
+        List notifiers = new ArrayList();
+        notifiers.add( notifier );
+
         assertProjectEquals( projectId,
                              name2,
                              scmUrl2,
-                             createNotifiers( emailAddress2 ),
+                             notifiers,
                              version2,
                              commandLineArguments2,
                              builderId,
@@ -798,6 +817,8 @@
     {
         ContinuumNotifier notifier = new ContinuumNotifier();
 
+        notifier.setType( "mail" );
+
         Properties props = new Properties();
 
         props.put( "address", emailAddress );
@@ -811,7 +832,8 @@
         return notifiers;
     }
 
-    public static String addMavenTwoProject( ContinuumStore store, ContinuumProject project
)
+    public static String addMavenTwoProject( ContinuumStore store,
+                                             ContinuumProject project )
         throws Exception
     {
         String projectId = store.addProject( project );
@@ -841,20 +863,22 @@
         return projectId;
     }
 
-    public static String addMavenTwoProject( ContinuumStore store, String name, String scmUrl
)
+    public static String addMavenTwoProject( ContinuumStore store,
+                                             String name,
+                                             String scmUrl )
         throws Exception
     {
         return addMavenTwoProject( store, makeStubMavenTwoProject( name, scmUrl ) );
     }
 
     public static String addMavenTwoProject( ContinuumStore store,
-                                     String name,
-                                     String scmUrl,
-                                     String nagEmailAddress,
-                                     String version,
-                                     String commandLineArguments,
-                                     String executorId,
-                                     String workingDirectory  )
+                                             String name,
+                                             String scmUrl,
+                                             String nagEmailAddress,
+                                             String version,
+                                             String commandLineArguments,
+                                             String executorId,
+                                             String workingDirectory )
         throws Exception
     {
         String projectId = store.addProject( makeMavenTwoProject( name,
@@ -924,9 +948,17 @@
                                       String workingDirectory,
                                       ContinuumProject actual )
     {
-        assertProjectEquals( projectId, name, scmUrl, createNotifiers( emailAddress), version,
commandLineArguments,
-                             builderId, workingDirectory, actual );
+        assertProjectEquals( projectId,
+                             name,
+                             scmUrl,
+                             createNotifiers( emailAddress),
+                             version,
+                             commandLineArguments,
+                             builderId,
+                             workingDirectory,
+                             actual );
     }
+
     private void assertProjectEquals( String projectId,
                                       String name,
                                       String scmUrl,
@@ -943,9 +975,9 @@
 
         assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
 
-        assertNotNull( notifiers );
+        assertNotNull( "project.notifiers", actual.getNotifiers() );
 
-        assertEquals( "project.notifiers", notifiers.size(), actual.getNotifiers().size()
);
+        assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size()
);
 
         for ( int i = 0; i < notifiers.size(); i++ )
         {

Modified: maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Sun Jun 19 14:08:39
2005
@@ -154,8 +154,8 @@
           <name>configuration</name>
           <version>1.0.0</version>
           <description>Extended configuration specific to this notifier goes here.</description>
-          <type>Properties</type>
-          <association xml.mapStyle="inline" stash.part="true">
+          <type>Map</type>
+          <association xml.mapStyle="inline" stash.part="true" stash.keyType="java.lang.String">
             <type>String</type>
             <multiplicity>*</multiplicity>
           </association>

Modified: maven/continuum/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/pom.xml?rev=191364&r1=191363&r2=191364&view=diff
==============================================================================
--- maven/continuum/trunk/pom.xml (original)
+++ maven/continuum/trunk/pom.xml Sun Jun 19 14:08:39 2005
@@ -111,7 +111,10 @@
       <dependency>
         <groupId>jpox</groupId>
         <artifactId>jpox</artifactId>
+        <!--
         <version>1.1.0-beta-3</version>
+        -->
+        <version>1.1.0-beta-4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>jpox</groupId>



Mime
View raw message