continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r190705 - /maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc /maven/continuum/trunk/continuum-core /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/console /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1 /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core/src/test/repository /maven/continuum/trunk/continuum-model/src/main/resources
Date Wed, 15 Jun 2005 03:23:31 GMT
Author: evenisse
Date: Tue Jun 14 20:23:29 2005
New Revision: 190705

URL: http://svn.apache.org/viewcvs?rev=190705&view=rev
Log:
[CONTINUUM-188]. Update notification in plexus according to proposal.

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.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/execution/maven/m1/MavenOneMetadataHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.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/notification/console/ConsoleNotifier.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
    maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-1.xml
    maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-2.xml
    maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -52,7 +52,7 @@
     void updateProject( String projectId,
                         String name,
                         String scmUrl,
-                        String nagEmailAddress,
+                        List notifiers,
                         String version,
                         String commandLineArguments )
         throws ContinuumStoreException;

Modified: maven/continuum/trunk/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java (original)
+++ maven/continuum/trunk/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java Tue Jun 14 20:23:29 2005
@@ -19,9 +19,13 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
 
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.project.AntProject;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.builder.AbstractContinuumProjectBuilder;
@@ -111,14 +115,24 @@
 
             if ( publishers != null )
             {
-                String nagEmailAddress = findNagEmailAddress( publishers.getChild( "email" ) );
+                String emailAddress = findNagEmailAddress( publishers.getChild( "email" ) );
 
-                if ( nagEmailAddress == null )
+                if ( emailAddress == null )
                 {
-                    nagEmailAddress = findNagEmailAddress( publishers.getChild( "htmlemail" ) );
+                    emailAddress = findNagEmailAddress( publishers.getChild( "htmlemail" ) );
                 }
 
-                continuumProject.setNagEmailAddress( nagEmailAddress );
+                ContinuumNotifier notifier = new ContinuumNotifier();
+
+                Properties props = new Properties();
+
+                props.put( "address", emailAddress );
+
+                notifier.setConfiguration( props );
+
+                List notifiers = new ArrayList();
+
+                continuumProject.setNotifiers( notifiers );
             }
 
             // ----------------------------------------------------------------------
@@ -273,7 +287,7 @@
             return null;
         }
 
-        String nagEmailAddress = failure[ 0 ].getValue();
+        String nagEmailAddress = failure[ 0 ].getAttribute( "address" );
 
         if ( StringUtils.isEmpty( nagEmailAddress ) )
         {

Modified: maven/continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/pom.xml?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/pom.xml Tue Jun 14 20:23:29 2005
@@ -41,7 +41,7 @@
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-notification</artifactId>
-      <version>1.0-alpha-3</version>
+      <version>1.0-alpha-4-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -486,7 +486,7 @@
         core.updateProject( project.getId(),
                             project.getName(),
                             project.getScmUrl(),
-                            project.getNagEmailAddress(),
+                            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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -18,6 +18,7 @@
 
 import java.net.URL;
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
@@ -59,7 +60,7 @@
     void updateProject( String projectId,
                         String name,
                         String scmUrl,
-                        String nagEmailAddress,
+                        List notifiers,
                         String version,
                         String commandLineArguments )
         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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -281,7 +281,7 @@
     public void updateProject( String projectId,
                                String name,
                                String scmUrl,
-                               String nagEmailAddress,
+                               List notifiers,
                                String version,
                                String commandLineArguments )
         throws ContinuumException
@@ -293,7 +293,7 @@
             store.updateProject( projectId,
                                  name,
                                  scmUrl,
-                                 nagEmailAddress,
+                                 notifiers,
                                  version,
                                  commandLineArguments );
         }
@@ -623,7 +623,7 @@
             store.updateProject( id,
                                  project.getName(),
                                  project.getScmUrl(),
-                                 project.getNagEmailAddress(),
+                                 project.getNotifiers(),
                                  project.getVersion(),
                                  project.getCommandLineArguments() );
         }

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -18,7 +18,13 @@
 
 import java.io.File;
 import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
 
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.MavenOneProject;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -95,13 +101,15 @@
         // Nag email address
         Xpp3Dom build = mavenProject.getChild( "build" );
 
-        String nagEmailAddress;
+        List notifiers = null;
+
+        ContinuumNotifier notifier = new ContinuumNotifier();
 
         if ( build == null )
         {
-            if ( !StringUtils.isEmpty( project.getNagEmailAddress() ) )
+            if ( project.getNotifiers() != null && !project.getNotifiers().isEmpty() )
             {
-                nagEmailAddress = project.getNagEmailAddress();
+                notifiers = project.getNotifiers();
             }
             else
             {
@@ -110,13 +118,48 @@
         }
         else
         {
-            nagEmailAddress = getValue( build, "nagEmailAddress", project.getNagEmailAddress() );
+            String currentNagEmailAddress = null;
+            
+            if ( project.getNotifiers() != null && !project.getNotifiers().isEmpty() )
+            {
+                for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); )
+                {
+                    ContinuumNotifier notif = (ContinuumNotifier) i.next();
+
+                    // Can we have an other type for maven 1 project?
+                    if ( "mail".equals( notif.getType() ) )
+                    {
+                        currentNagEmailAddress = notif.getConfiguration().getProperty( ContinuumRecipientSource.ADDRESS_FIELD );
+                    }
+                }
+            }
+
+            String nagEmailAddress = getValue( build, "nagEmailAddress", currentNagEmailAddress );
+
+            if ( nagEmailAddress != null )
+            {
+                Properties props = new Properties();
+
+                props.put( ContinuumRecipientSource.ADDRESS_FIELD, nagEmailAddress );
+
+                notifier.setConfiguration( props );
+            }
+
         }
 
-        if ( StringUtils.isEmpty( nagEmailAddress ) )
+        if ( notifiers == null && notifier.getConfiguration().isEmpty() )
         {
             throw new MavenOneMetadataHelperException( "Missing nag email address from the project descriptor." );
         }
+        else
+        {
+            if ( notifiers == null )
+            {
+                notifiers = new ArrayList();
+            }
+
+            notifiers.add( notifier );
+        }
 
         // Version
         String version = getValue( mavenProject, "currentVersion", project.getVersion() );
@@ -140,7 +183,7 @@
 
         project.setScmUrl( scmConnection );
 
-        project.setNagEmailAddress( nagEmailAddress );
+        project.setNotifiers( notifiers );
 
         project.setVersion( version );
     }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java Tue Jun 14 20:23:29 2005
@@ -18,7 +18,6 @@
 
 import java.io.File;
 
-import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.MavenOneProject;
 
 /**

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java Tue Jun 14 20:23:29 2005
@@ -17,13 +17,16 @@
  */
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.continuum.project.ContinuumDeveloper;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.model.CiManagement;
 import org.apache.maven.model.Developer;
@@ -74,7 +77,7 @@
 
     public void mapMavenProjectToContinuumProject( MavenProject mavenProject, MavenTwoProject continuumProject )
     {
-        continuumProject.setNagEmailAddress( getNagEmailAddress( mavenProject ) );
+        continuumProject.setNotifiers( getNotifiers( mavenProject ) );
 
         continuumProject.setName( getProjectName( mavenProject ) );
 
@@ -172,9 +175,9 @@
             throw new MavenBuilderHelperException( "Missing CiManagement from the project descriptor." );
         }
 
-        if ( StringUtils.isEmpty( getNagEmailAddress( project ) ) )
+        if ( getNotifiers( project ).isEmpty() )
         {
-            throw new MavenBuilderHelperException( "Missing nag email address from the continuous integration info." );
+            throw new MavenBuilderHelperException( "Missing notifiers from the continuous integration info." );
         }
 
         // SCM connection
@@ -217,19 +220,27 @@
         return project.getScm().getConnection();
     }
 
-    private String getNagEmailAddress( MavenProject project )
+    private List getNotifiers( MavenProject mavenProject )
     {
-        for ( Iterator it = project.getCiManagement().getNotifiers().iterator(); it.hasNext(); )
+        List notifiers = new ArrayList();
+
+        for ( Iterator i = mavenProject.getCiManagement().getNotifiers().iterator(); i.hasNext(); )
         {
-            Notifier notifier = (Notifier) it.next();
+            Notifier projectNotifier = (Notifier) i.next();
+
+            ContinuumNotifier notifier = new ContinuumNotifier();
 
-            if ( notifier.getType().equals( "mail" ) )
+            if ( !StringUtils.isEmpty( projectNotifier.getType() ) )
             {
-                return notifier.getAddress();
+                notifier.setType( projectNotifier.getType() );
             }
+
+            notifier.setConfiguration( projectNotifier.getConfiguration() );
+
+            notifiers.add( notifier );
         }
 
-        return null;
+        return notifiers;
     }
 
     private String getVersion( MavenProject project )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java Tue Jun 14 20:23:29 2005
@@ -18,7 +18,6 @@
 
 import java.io.File;
 
-import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.project.MavenProject;
 

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -18,12 +18,15 @@
 
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.ContinuumProject;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.notification.AbstractRecipientSource;
 import org.codehaus.plexus.notification.NotificationException;
 import org.codehaus.plexus.notification.RecipientSource;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -31,12 +34,14 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: ContinuumRecipientSource.java,v 1.2 2005/04/01 22:55:52 trygvis Exp $
+ * @version $Id$
  */
 public class ContinuumRecipientSource
-    extends AbstractLogEnabled
-    implements RecipientSource, Initializable
+    extends AbstractRecipientSource
+    implements Initializable
 {
+    public static String ADDRESS_FIELD = "address";
+
     /** @configuration */
     private String toOverride;
 
@@ -64,28 +69,7 @@
     // RecipientSource Implementation
     // ----------------------------------------------------------------------
 
-    public Set getRecipients( String notifierType, String messageId, Map context )
-        throws NotificationException
-    {
-        if ( notifierType.equals( "console" ) )
-        {
-            return Collections.EMPTY_SET;
-        }
-        else if ( notifierType.equals( "mail" ) )
-        {
-            return getMailRecipients( context );
-        }
-
-        getLogger().warn( "Unknown notifier type '" + notifierType + "'." );
-
-        return Collections.EMPTY_SET;
-    }
-
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
-    private Set getMailRecipients( Map context )
+    public Set getRecipients( String notifierType, String messageId, Map configuration, Map context )
         throws NotificationException
     {
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT );
@@ -101,11 +85,26 @@
         {
             recipients.add( toOverride );
         }
-        else if ( !StringUtils.isEmpty( project.getNagEmailAddress() ) )
+        else if ( project.getNotifiers() != null && !project.getNotifiers().isEmpty() )
         {
-            recipients.add( project.getNagEmailAddress() );
+            for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); )
+            {
+                ContinuumNotifier notifier = (ContinuumNotifier) i.next();
+
+                if ( notifier.getType().equals( notifierType ) && notifier.getConfiguration().containsKey( ADDRESS_FIELD ) )
+                {
+                    recipients.add( notifier.getConfiguration().getProperty( ADDRESS_FIELD ) );
+                }
+            }
         }
 
-        return recipients;
+        if ( recipients.isEmpty() )
+        {
+            return Collections.EMPTY_SET;
+        }
+        else
+        {
+            return recipients;
+        }
     }
 }

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -17,64 +17,73 @@
  */
 
 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;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.UpdateScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.notification.NotificationDispatcher;
 import org.codehaus.plexus.notification.NotificationException;
+import org.codehaus.plexus.notification.RecipientSource;
+import org.codehaus.plexus.notification.notifier.Notifier;
+import org.codehaus.plexus.notification.notifier.manager.NotifierManager;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: DefaultContinuumNotificationDispatcher.java,v 1.2 2005/04/01 22:55:52 trygvis Exp $
+ * @version $Id$
  */
 public class DefaultContinuumNotificationDispatcher
     extends AbstractLogEnabled
     implements ContinuumNotificationDispatcher
 {
     /** @requirement */
-    private NotificationDispatcher notificationDispatcher;
+    private NotifierManager notifierManager;
 
     /** @requirement */
     private ContinuumStore store;
 
+    /** @requirement */
+    private RecipientSource recipientSource;
+
     // ----------------------------------------------------------------------
     // ContinuumNotificationDispatcher Implementation
     // ----------------------------------------------------------------------
 
     public void buildStarted( ContinuumProject project )
     {
-        sendNotifiaction( MESSAGE_ID_BUILD_STARTED, project, null );
+        sendNotification( MESSAGE_ID_BUILD_STARTED, project, null );
     }
 
     public void checkoutStarted( ContinuumProject project )
     {
-        sendNotifiaction( MESSAGE_ID_CHECKOUT_STARTED, project, null );
+        sendNotification( MESSAGE_ID_CHECKOUT_STARTED, project, null );
     }
 
     public void checkoutComplete( ContinuumProject project, UpdateScmResult scmResult )
     {
-        sendNotifiaction( MESSAGE_ID_CHECKOUT_COMPLETE, project, null );
+        sendNotification( MESSAGE_ID_CHECKOUT_COMPLETE, project, null );
     }
 
     public void runningGoals( ContinuumProject project, ContinuumBuild build )
     {
-        sendNotifiaction( MESSAGE_ID_RUNNING_GOALS, project, build );
+        sendNotification( MESSAGE_ID_RUNNING_GOALS, project, build );
     }
 
     public void goalsCompleted( ContinuumProject project, ContinuumBuild build )
     {
-        sendNotifiaction( MESSAGE_ID_GOALS_COMPLETED, project, build );
+        sendNotification( MESSAGE_ID_GOALS_COMPLETED, project, build );
     }
 
     public void buildComplete( ContinuumProject project, ContinuumBuild build )
     {
-        sendNotifiaction( MESSAGE_ID_BUILD_COMPLETE, project, build );
+        sendNotification( MESSAGE_ID_BUILD_COMPLETE, project, build );
     }
 
     // ----------------------------------------------------------------------
@@ -82,14 +91,14 @@
     // ----------------------------------------------------------------------
 
 
-    private void sendNotifiaction( String messageId,
+    private void sendNotification( String messageId,
                                    ContinuumProject project,
                                    ContinuumBuild build )
     {
-        sendNotifiaction( messageId, project, build, null );
+        sendNotification( messageId, project, build, null );
     }
 
-    private void sendNotifiaction( String messageId,
+    private void sendNotification( String messageId,
                                    ContinuumProject project,
                                    ContinuumBuild build,
                                    UpdateScmResult scmResult )
@@ -125,7 +134,20 @@
 
         try
         {
-            notificationDispatcher.sendNotification( messageId, context );
+            for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); )
+            {
+                ContinuumNotifier continuumNotifier = (ContinuumNotifier) i.next();
+
+                String notifierType = continuumNotifier.getType();
+
+                Properties configuration = continuumNotifier.getConfiguration();
+
+                Notifier notifier = notifierManager.getNotifier( notifierType );
+
+                Set recipients = recipientSource.getRecipients( notifierType, messageId, configuration, context );
+
+                notifier.sendNotification( messageId, recipients, continuumNotifier.getConfiguration(), context );
+            }
         }
         catch ( NotificationException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/console/ConsoleNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/console/ConsoleNotifier.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/console/ConsoleNotifier.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/console/ConsoleNotifier.java Tue Jun 14 20:23:29 2005
@@ -17,6 +17,7 @@
  */
 
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
@@ -24,24 +25,22 @@
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
 
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.notification.NotificationException;
-import org.codehaus.plexus.notification.notifier.Notifier;
+import org.codehaus.plexus.notification.notifier.AbstractNotifier;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: ConsoleNotifier.java,v 1.1.1.1 2005/03/29 20:42:01 trygvis Exp $
+ * @version $Id$
  */
 public class ConsoleNotifier
-    extends AbstractLogEnabled
-    implements Notifier
+    extends AbstractNotifier
 {
     // ----------------------------------------------------------------------
     // Notifier Implementation
     // ----------------------------------------------------------------------
 
-    public void sendNotification( String source, Set recipients, Map context )
+    public void sendNotification( String source, Set recipients, Map configuration, Map context )
         throws NotificationException
     {
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT );
@@ -136,5 +135,14 @@
         {
             System.out.println( build.getError() );
         }
+    }
+
+    /**
+     * @see org.codehaus.plexus.notification.notifier.Notifier#sendNotification(java.lang.String, java.util.Set, java.util.Properties)
+     */
+    public void sendNotification( String arg0, Set arg1, Properties arg2 )
+        throws NotificationException
+    {
+        throw new NotificationException( "Not implemented." );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Tue Jun 14 20:23:29 2005
@@ -22,10 +22,12 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
@@ -35,23 +37,22 @@
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.exception.ResourceNotFoundException;
 
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.mailsender.MailMessage;
 import org.codehaus.plexus.mailsender.MailSender;
 import org.codehaus.plexus.mailsender.MailSenderException;
 import org.codehaus.plexus.notification.NotificationException;
-import org.codehaus.plexus.notification.notifier.Notifier;
+import org.codehaus.plexus.notification.notifier.AbstractNotifier;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.velocity.VelocityComponent;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id: MailContinuumNotifier.java,v 1.3 2005/04/02 21:40:04 trygvis Exp $
+ * @version $Id$
  */
 public class MailContinuumNotifier
-    extends AbstractLogEnabled
-    implements Initializable, Notifier
+    extends AbstractNotifier
+    implements Initializable
 {
     // ----------------------------------------------------------------------
     // Requirements
@@ -87,6 +88,8 @@
 
     private FormatterTool formatterTool;
 
+    private Map configuration;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -143,9 +146,11 @@
     // Notifier Implementation
     // ----------------------------------------------------------------------
 
-    public void sendNotification( String source, Set recipients, Map context )
+    public void sendNotification( String source, Set recipients, Map configuration, Map context )
         throws NotificationException
     {
+        this.configuration = configuration;
+
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT );
 
         ContinuumBuild build = (ContinuumBuild) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD );
@@ -348,12 +353,19 @@
             return fromMailbox;
         }
 
-        if ( StringUtils.isEmpty( project.getNagEmailAddress() ) )
+        String address = null;
+
+        if ( configuration != null )
+        {
+            address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD );
+        }
+
+        if ( StringUtils.isEmpty( address ) )
         {
             return FALLBACK_FROM_MAILBOX;
         }
 
-        return project.getNagEmailAddress();
+        return address;
     }
 
     private boolean shouldNotify( ContinuumBuild build, ContinuumBuild previousBuild )
@@ -424,5 +436,14 @@
         }
 
         return (ContinuumBuild) itr.next();
+    }
+
+    /**
+     * @see org.codehaus.plexus.notification.notifier.Notifier#sendNotification(java.lang.String, java.util.Set, java.util.Properties)
+     */
+    public void sendNotification( String arg0, Set arg1, Properties arg2 )
+        throws NotificationException
+    {
+        throw new NotificationException( "Not implemented." );
     }
 }

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -29,6 +29,7 @@
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumJPoxStore;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
@@ -186,7 +187,7 @@
     public void updateProject( String projectId,
                                String name,
                                String scmUrl,
-                               String nagEmailAddress,
+                               List notifiers,
                                String version,
                                String commandLineArguments )
         throws ContinuumStoreException
@@ -199,7 +200,7 @@
 
             project.setName( name );
             project.setScmUrl( scmUrl );
-            project.setNagEmailAddress( nagEmailAddress );
+            project.setNotifiers( notifiers );
             project.setVersion( version );
             project.setCommandLineArguments( commandLineArguments );
 

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml Tue Jun 14 20:23:29 2005
@@ -100,10 +100,13 @@
       <implementation>org.apache.maven.continuum.notification.DefaultContinuumNotificationDispatcher</implementation>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.notification.NotificationDispatcher</role>
+          <role>org.codehaus.plexus.notification.notifier.manager.NotifierManager</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.continuum.store.ContinuumStore</role>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.notification.RecipientSource</role>
         </requirement>
       </requirements>
     </component>

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java Tue Jun 14 20:23:29 2005
@@ -17,8 +17,12 @@
  */
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
 
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.MavenOneProject;
 
 import org.codehaus.plexus.PlexusTestCase;
@@ -63,7 +67,19 @@
 
         project.setScmUrl( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/" );
 
-        project.setNagEmailAddress( "dev@maven.apache.org" );
+        ContinuumNotifier notifier = new ContinuumNotifier();
+
+        Properties props = new Properties();
+
+        props.put( "address", "dev@maven.apache.org" );
+
+        notifier.setConfiguration( props );
+
+        List notifiers = new ArrayList();
+
+        notifiers.add( notifier );
+
+        project.setNotifiers( notifiers );
 
         project.setVersion( "1.1-SNAPSHOT" );
 
@@ -85,7 +101,9 @@
 
         assertEquals( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/", project.getScmUrl() );
 
-        assertEquals( "dev@maven.apache.org", project.getNagEmailAddress() );
+        ContinuumNotifier actualNotifier = (ContinuumNotifier) project.getNotifiers().get( 0 );
+
+        assertEquals( "dev@maven.apache.org", actualNotifier.getConfiguration().get( "address" ) );
 
         assertEquals( "1.1-SNAPSHOT", project.getVersion() );
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java Tue Jun 14 20:23:29 2005
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -48,7 +49,9 @@
 
         assertEquals( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/", project.getScmUrl() );
 
-        assertEquals( "dev@maven.apache.org", project.getNagEmailAddress() );
+        ContinuumNotifier notifier = (ContinuumNotifier) project.getNotifiers().get( 0 );
+
+        assertEquals( "dev@maven.apache.org", notifier.getConfiguration().get( "address" ) );
 
         assertEquals( "1.1-SNAPSHOT", project.getVersion() );
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java Tue Jun 14 20:23:29 2005
@@ -22,6 +22,7 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -35,7 +36,7 @@
 public class MavenTwoContinuumProjectBuilderTest
     extends PlexusTestCase
 {
-    public void testGetNagEmailAddressWhenTypeIsSetToEmail()
+    public void testGetEmailAddressWhenTypeIsSetToEmail()
         throws Exception
     {
         ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder)
@@ -51,10 +52,16 @@
 
         MavenTwoProject project = ( MavenTwoProject ) result.getProjects().get( 0 );
 
-        assertEquals( "foo@bar", project.getNagEmailAddress() );
+        assertNotNull( project.getNotifiers() );
+
+        assertEquals( 1, project.getNotifiers().size() );
+
+        ContinuumNotifier notifier = (ContinuumNotifier) project.getNotifiers().get(0);
+
+        assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );
     }
 
-    public void testGetNagEmailAddressWhenTypeIsntSet()
+    public void testGetEmailAddressWhenTypeIsntSet()
         throws Exception
     {
         ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder)
@@ -70,7 +77,13 @@
 
         MavenTwoProject project = (MavenTwoProject) result.getProjects().get( 0 );
 
-        assertEquals( "foo@bar", project.getNagEmailAddress() );
+        assertNotNull( project.getNotifiers() );
+
+        assertEquals( 1, project.getNotifiers().size() );
+
+        ContinuumNotifier notifier = (ContinuumNotifier) project.getNotifiers().get(0);
+
+        assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );
     }
 
     public void testCreateProjectsWithModules()

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=190705&r1=190704&r2=190705&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 Tue Jun 14 20:23:29 2005
@@ -30,6 +30,7 @@
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumJPoxStore;
+import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.MavenTwoProject;
@@ -264,14 +265,14 @@
 
         String name2 = "name 2";
         String scmUrl2 = "scm url 2";
-        String nagEmailAddress2 = "2@bar";
+        String emailAddress2 = "2@bar";
         String version2 = "v2";
         String commandLineArguments2 = "";
 
         store.updateProject( projectId,
                              name2,
                              scmUrl2,
-                             nagEmailAddress2,
+                             createNotifiers( emailAddress2 ),
                              version2,
                              commandLineArguments2 );
 
@@ -280,7 +281,7 @@
         assertProjectEquals( projectId,
                              name2,
                              scmUrl2,
-                             nagEmailAddress2,
+                             createNotifiers( emailAddress2 ),
                              version2,
                              commandLineArguments2,
                              builderId,
@@ -770,7 +771,7 @@
 
     public static MavenTwoProject makeMavenTwoProject( String name,
                                                        String scmUrl,
-                                                       String nagEmailAddress,
+                                                       String emailAddress,
                                                        String version,
                                                        String commandLineArguments,
                                                        String executorId,
@@ -780,7 +781,10 @@
 
         project.setName( name );
         project.setScmUrl( scmUrl );
-        project.setNagEmailAddress( nagEmailAddress );
+
+        List notifiers = createNotifiers( emailAddress );
+        project.setNotifiers( notifiers );
+
         project.setVersion( version );
         project.setCommandLineArguments( commandLineArguments );
         project.setExecutorId( executorId );
@@ -789,6 +793,23 @@
         return project;
     }
 
+    private static List createNotifiers( String emailAddress )
+    {
+        ContinuumNotifier notifier = new ContinuumNotifier();
+
+        Properties props = new Properties();
+
+        props.put( "address", emailAddress );
+
+        notifier.setConfiguration( props );
+
+        List notifiers = new ArrayList();
+
+        notifiers.add( notifier );
+
+        return notifiers;
+    }
+
     public static String addMavenTwoProject( ContinuumStore store, ContinuumProject project )
         throws Exception
     {
@@ -884,7 +905,7 @@
         assertProjectEquals( projectId,
                              expected.getName(),
                              expected.getScmUrl(),
-                             expected.getNagEmailAddress(),
+                             expected.getNotifiers(),
                              expected.getVersion(),
                              expected.getCommandLineArguments(),
                              expected.getExecutorId(),
@@ -895,7 +916,20 @@
     private void assertProjectEquals( String projectId,
                                       String name,
                                       String scmUrl,
-                                      String nagEmailAddress,
+                                      String emailAddress,
+                                      String version,
+                                      String commandLineArguments,
+                                      String builderId,
+                                      String workingDirectory,
+                                      ContinuumProject actual )
+    {
+        assertProjectEquals( projectId, name, scmUrl, createNotifiers( emailAddress), version, commandLineArguments,
+                             builderId, workingDirectory, actual );
+    }
+    private void assertProjectEquals( String projectId,
+                                      String name,
+                                      String scmUrl,
+                                      List notifiers,
                                       String version,
                                       String commandLineArguments,
                                       String builderId,
@@ -908,7 +942,22 @@
 
         assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
 
-        assertEquals( "project.nagEmailAddress", nagEmailAddress, actual.getNagEmailAddress() );
+        assertNotNull( notifiers );
+
+        assertEquals( "project.notifiers", notifiers.size(), actual.getNotifiers().size() );
+
+        for ( int i = 0; i < notifiers.size(); i++ )
+        {
+            ContinuumNotifier notifier = (ContinuumNotifier) notifiers.get( i );
+
+            ContinuumNotifier actualNotifier = (ContinuumNotifier) actual.getNotifiers().get( i );
+
+            assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() );
+
+            assertEquals( "project.notifiers.notifier.configuration.address",
+                          notifier.getConfiguration().get( "address" ),
+                          actualNotifier.getConfiguration().get( "address" ) );
+        }
 
         assertEquals( "project.version", version, actual.getVersion() );
 

Modified: maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-1.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-1.xml?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-1.xml (original)
+++ maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-1.xml Tue Jun 14 20:23:29 2005
@@ -7,7 +7,9 @@
     <notifiers>
       <notifier>
         <type>mail</type>
-        <address>foo@bar</address>
+        <configuration>
+          <address>foo@bar</address>
+        </configuration>
       </notifier>
     </notifiers>
   </ciManagement>

Modified: maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-2.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-2.xml?rev=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-2.xml (original)
+++ maven/continuum/trunk/continuum-core/src/test/repository/maven-builder-helper-2.xml Tue Jun 14 20:23:29 2005
@@ -6,7 +6,9 @@
   <ciManagement>
     <notifiers>
       <notifier>
-        <address>foo@bar</address>
+        <configuration>
+          <address>foo@bar</address>
+        </configuration>
       </notifier>
     </notifiers>
   </ciManagement>

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=190705&r1=190704&r2=190705&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Tue Jun 14 20:23:29 2005
@@ -36,11 +36,6 @@
           <type>String</type>
         </field>
         <field>
-          <name>nagEmailAddress</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
           <name>version</name>
           <version>1.0.0</version>
           <type>String</type>
@@ -138,6 +133,41 @@
           <version>1.0.0</version>
           <association stash.part="true">
             <type>ContinuumDeveloper</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+        <field>
+          <name>notifiers</name>
+          <version>1.0.0</version>
+          <association stash.part="true">
+            <type>ContinuumNotifier</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+      </fields>
+    </class>
+
+    <class stash.storable="true">
+      <name>ContinuumNotifier</name>
+      <version>1.0.0</version>
+      <description>
+        Configures one method for notifying users/developers when a build breaks.
+      </description>
+      <fields>
+        <field>
+          <name>type</name>
+          <version>1.0.0</version>
+          <defaultValue>mail</defaultValue>
+          <type>String</type>
+          <description>The mechanism used to deliver notifications.</description>
+        </field>
+        <field>
+          <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>String</type>
             <multiplicity>*</multiplicity>
           </association>
         </field>



Mime
View raw message