project.setArtifactId( "maven" );
project.setScmUrl( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/" );
ProjectNotifier notifier = new ProjectNotifier();
Properties props = new Properties();
props.put( "address", "dev@maven.apache.org" );
notifier.setConfiguration( props );
notifier.setFrom( ProjectNotifier.FROM_USER );
List notifiers = new ArrayList();
notifiers.add( notifier );
project.setNotifiers( notifiers );
project.setVersion( "1.1-SNAPSHOT" );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
executor.updateProjectFromCheckOut( checkOut, project, null );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
assertNotNull( project );
assertEquals( "Maven", project.getName() );
assertEquals( 2, project.getNotifiers().size() );
ProjectNotifier actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );
assertEquals( "myuser@myhost.org", actualNotifier.getConfiguration().get( "address" ) );
actualNotifier = (ProjectNotifier) project.getNotifiers().get( 1 );
assertEquals( "dev@maven.apache.org", actualNotifier.getConfiguration().get( "address" ) );
// ----------------------------------------------------------------------
// Updating a new time to prevent duplicated notifiers
// ----------------------------------------------------------------------
executor.updateProjectFromCheckOut( checkOut, project, null );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
assertEquals( 2, project.getNotifiers().size() );
actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );
assertEquals( "myuser@myhost.org", actualNotifier.getConfiguration().get( "address" ) );
actualNotifier = (ProjectNotifier) project.getNotifiers().get( 1 );
assertEquals( "dev@maven.apache.org", actualNotifier.getConfiguration().get( "address" ) );
}