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

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


    {
        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        List<ProjectNotifier> notifiers = projectGroup.getNotifiers();

        ProjectNotifier notifier = null;

        for ( ProjectNotifier notif : notifiers )
        {
            notifier = notif;

            if ( notifier.getId() == notifierId )
            {
                break;
            }
        }
View Full Code Here


    public ProjectNotifier updateNotifier( int projectId, ProjectNotifier notifier )
        throws ContinuumException
    {
        Project project = getProjectWithAllDetails( projectId );

        ProjectNotifier notif = getNotifier( projectId, notifier.getId() );

        // I remove notifier then add it instead of update it due to a ClassCastException in jpox
        project.removeNotifier( notif );

        updateProject( project );
View Full Code Here

    public ProjectNotifier updateGroupNotifier( int projectGroupId, ProjectNotifier notifier )
        throws ContinuumException
    {
        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        ProjectNotifier notif = getGroupNotifier( projectGroupId, notifier.getId() );

        // I remove notifier then add it instead of update it due to a ClassCastException in jpox
        projectGroup.removeNotifier( notif );

        try
View Full Code Here

    */

    public ProjectNotifier addNotifier( int projectId, ProjectNotifier notifier )
        throws ContinuumException
    {
        ProjectNotifier notif = new ProjectNotifier();

        notif.setSendOnSuccess( notifier.isSendOnSuccess() );

        notif.setSendOnFailure( notifier.isSendOnFailure() );

        notif.setSendOnError( notifier.isSendOnError() );

        notif.setSendOnWarning( notifier.isSendOnWarning() );

        notif.setSendOnScmFailure( notifier.isSendOnScmFailure() );

        notif.setConfiguration( notifier.getConfiguration() );

        notif.setType( notifier.getType() );

        notif.setFrom( ProjectNotifier.FROM_USER );

        Project project = getProjectWithAllDetails( projectId );

        project.addNotifier( notif );

View Full Code Here

    }

    public ProjectNotifier addGroupNotifier( int projectGroupId, ProjectNotifier notifier )
        throws ContinuumException
    {
        ProjectNotifier notif = new ProjectNotifier();

        notif.setSendOnSuccess( notifier.isSendOnSuccess() );

        notif.setSendOnFailure( notifier.isSendOnFailure() );

        notif.setSendOnError( notifier.isSendOnError() );

        notif.setSendOnWarning( notifier.isSendOnWarning() );

        notif.setSendOnScmFailure( notifier.isSendOnScmFailure() );

        notif.setConfiguration( notifier.getConfiguration() );

        notif.setType( notifier.getType() );

        notif.setFrom( ProjectNotifier.FROM_USER );

        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        projectGroup.addNotifier( notif );
        try
View Full Code Here

    public void removeNotifier( int projectId, int notifierId )
        throws ContinuumException
    {
        Project project = getProjectWithAllDetails( projectId );

        ProjectNotifier n = getNotifier( projectId, notifierId );

        if ( n != null )
        {
            if ( n.isFromProject() )
            {
                n.setEnabled( false );

                storeNotifier( n );
            }
            else
            {
View Full Code Here

    public void removeGroupNotifier( int projectGroupId, int notifierId )
        throws ContinuumException
    {
        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        ProjectNotifier n = getGroupNotifier( projectGroupId, notifierId );

        if ( n != null )
        {
            if ( n.isFromProject() )
            {
                n.setEnabled( false );

                storeNotifier( n );
            }
            else
            {
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 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( "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 );

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

        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 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" ) );
    }
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.