Package org.apache.maven.continuum.model.project

Examples of org.apache.maven.continuum.model.project.ProjectNotifier


        assertNotNull( project.getNotifiers() );

        assertEquals( 1, project.getNotifiers().size() );

        ProjectNotifier notifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "mail", notifier.getType() );

        assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );

        ProjectGroup pg = result.getProjectGroups().get( 0 );

        assertNotNull( pg );
View Full Code Here


        assertNotNull( project.getNotifiers() );

        assertEquals( 1, project.getNotifiers().size() );

        ProjectNotifier notifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "mail", notifier.getType() );

        assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );

        ProjectGroup pg = result.getProjectGroups().get( 0 );

        assertNotNull( pg );
View Full Code Here

        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<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();

        notifiers.add( notifier );

        project.setNotifiers( notifiers );

        project.setVersion( "1.1-SNAPSHOT" );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        executor.updateProjectFromCheckOut( checkOut, project, null, null );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        assertNotNull( project );

        assertEquals( "Maven", project.getName() );

        assertEquals( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/", project.getScmUrl() );

        ProjectNotifier actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "dev@maven.apache.org", actualNotifier.getConfiguration().get( "address" ) );

        assertEquals( "1.1-SNAPSHOT", project.getVersion() );
    }
View Full Code Here

        assertEquals( "Maven", project.getName() );

        assertEquals( 1, project.getNotifiers().size() );

        ProjectNotifier actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "myuser@myhost.org", actualNotifier.getConfiguration().get( "address" ) );

        // ----------------------------------------------------------------------
        // Updating a new time to prevent duplicated notifiers
        // ----------------------------------------------------------------------

        executor.updateProjectFromCheckOut( checkOut, project, null, null );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        assertEquals( 1, project.getNotifiers().size() );

        actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "myuser@myhost.org", actualNotifier.getConfiguration().get( "address" ) );
    }
View Full Code Here

        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<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();

        notifiers.add( notifier );

        project.setNotifiers( notifiers );

        project.setVersion( "1.1-SNAPSHOT" );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        executor.updateProjectFromCheckOut( checkOut, project, null, 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, 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" ) );
    }
View Full Code Here

        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<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();

        notifiers.add( notifier );

        project.setNotifiers( notifiers );

        project.setVersion( "1.1-SNAPSHOT" );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        executor.updateProjectFromCheckOut( checkOut, project, null, null );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        assertNotNull( project );

        assertEquals( "Maven", project.getName() );

        assertEquals( 1, project.getNotifiers().size() );

        ProjectNotifier actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "dev@maven.apache.org", actualNotifier.getConfiguration().get( "address" ) );

        // ----------------------------------------------------------------------
        // Updating a new time to prevent duplicated notifiers
        // ----------------------------------------------------------------------

        executor.updateProjectFromCheckOut( checkOut, project, null, null );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        assertEquals( 1, project.getNotifiers().size() );

        actualNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );

        assertEquals( "dev@maven.apache.org", actualNotifier.getConfiguration().get( "address" ) );
    }
View Full Code Here

        context.setBuildResult( build );

        context.setBuildDefinition( buildDef );

        ProjectNotifier projectNotifier = new ProjectNotifier();
        projectNotifier.setType( "mail" );
        Map<String, String> config = new HashMap<String, String>();
        config.put( MailContinuumNotifier.ADDRESS_FIELD, "foo@bar" );
        projectNotifier.setConfiguration( config );
        List<ProjectNotifier> projectNotifiers = new ArrayList<ProjectNotifier>();
        projectNotifiers.add( projectNotifier );
        context.setNotifier( projectNotifiers );

        //context.put( ContinuumNotificationDispatcher.CONTEXT_BUILD_OUTPUT, buildOutput );
View Full Code Here

        {
            addActionError( authzE.getMessage() );
            return REQUIRES_AUTHORIZATION;
        }

        ProjectNotifier notifier = getNotifier();

        boolean isNew = ( notifier == null || getNotifierId() == 0 );

        if ( isNew )
        {
            notifier = new ProjectNotifier();
        }

        notifier.setType( getNotifierType() );

        notifier.setSendOnSuccess( isSendOnSuccess() );

        notifier.setSendOnFailure( isSendOnFailure() );

        notifier.setSendOnError( isSendOnError() );

        notifier.setSendOnWarning( isSendOnWarning() );

        notifier.setSendOnScmFailure( isSendOnScmFailure() );

        setNotifierConfiguration( notifier );

        saveNotifier( notifier );
View Full Code Here

     * @throws ContinuumException
     */
    public String edit()
        throws ContinuumException
    {
        ProjectNotifier notifier = getNotifier();

        if ( notifier == null )
        {
            notifier = new ProjectNotifier();
        }

        try
        {
            checkAuthorization();
        }
        catch ( AuthorizationRequiredException authzE )
        {
            addActionError( authzE.getMessage() );
            return REQUIRES_AUTHORIZATION;
        }

        // setup Action fields
        setNotifierType( notifier.getType() );

        setSendOnSuccess( notifier.isSendOnSuccess() );

        setSendOnFailure( notifier.isSendOnFailure() );

        setSendOnError( notifier.isSendOnError() );

        setSendOnWarning( notifier.isSendOnWarning() );

        setSendOnScmFailure( notifier.isSendOnScmFailure() );

        initConfiguration( notifier.getConfiguration() );

        return SUCCESS;
    }
View Full Code Here

        if ( emailAddress == null )
        {
            return null;
        }

        ProjectNotifier notifier = new ProjectNotifier();

        notifier.setType( "mail" );

        Properties props = new Properties();

        props.put( "address", emailAddress );

        notifier.setConfiguration( props );

        List<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();

        notifiers.add( notifier );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.project.ProjectNotifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.