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

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


    public void testAddDeveloperToProject()
        throws ContinuumStoreException
    {
        Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );

        ProjectDeveloper developer = createTestDeveloper( 11, "email TADTP", "name TADTP", "scmId TADTP" );
        ProjectDeveloper copy = createTestDeveloper( developer );
        project.addDeveloper( developer );
        projectDao.updateProject( project );

        project = projectDao.getProjectWithAllDetails( testProject1.getId() );
        assertEquals( "check # devs", 2, project.getDevelopers().size() );
View Full Code Here


    public void testEditDeveloper()
        throws ContinuumStoreException
    {
        Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );

        ProjectDeveloper newDeveloper = (ProjectDeveloper) project.getDevelopers().get( 0 );
        newDeveloper.setName( "name1.1" );
        newDeveloper.setEmail( "email1.1" );

        ProjectDeveloper copy = createTestDeveloper( newDeveloper );
        projectDao.updateProject( project );

        project = projectDao.getProjectWithAllDetails( testProject1.getId() );
        assertEquals( "check # devs", 1, project.getDevelopers().size() );
        assertDeveloperEquals( copy, (ProjectDeveloper) project.getDevelopers().get( 0 ) );
View Full Code Here

        ProjectNotifier testNotifier1 = createTestNotifier( 11, true, true, false, "type11" );
        ProjectNotifier testNotifier2 = createTestNotifier( 12, false, false, true, "type12" );
        ProjectNotifier testNotifier3 = createTestNotifier( 13, false, true, false, "type13" );

        ProjectDeveloper testDeveloper1 = createTestDeveloper( 1, "email1", "name1", "scmId1" );
        ProjectDeveloper testDeveloper2 = createTestDeveloper( 2, "email2", "name2", "scmId2" );
        ProjectDeveloper testDeveloper3 = createTestDeveloper( 3, "email3", "name3", "scmId3" );

        ProjectDependency testDependency1 = createTestDependency( "groupId1", "artifactId1", "version1" );
        ProjectDependency testDependency2 = createTestDependency( "groupId2", "artifactId2", "version2" );
        ProjectDependency testDependency3 = createTestDependency( "groupId3", "artifactId3", "version3" );

        // TODO: simplify by deep copying the relationships in createTest... ?
        long baseTime = System.currentTimeMillis();
        testBuildResult1 = createTestBuildResult( 1, true, 1, 1, "error1", 1, baseTime, baseTime + 1000 );
        BuildResult buildResult1 = createTestBuildResult( testBuildResult1 );
        ScmResult scmResult = createTestScmResult( "commandOutput1", "providerMessage1", true, "1" );
        buildResult1.setScmResult( scmResult );
        ScmResult testBuildResult1ScmResult = createTestScmResult( scmResult, "1" );
        testBuildResult1.setScmResult( testBuildResult1ScmResult );
        testCheckoutResult1 = createTestScmResult( "commandOutputCO1", "providerMessageCO1", false, "CO1" );
        ScmResult checkoutResult1 = createTestScmResult( testCheckoutResult1, "CO1" );
        testProject1.setCheckoutResult( checkoutResult1 );
        testProject1.addBuildResult( buildResult1 );

        testBuildResult2 = createTestBuildResult( 2, false, 2, 2, "error2", 2, baseTime + 2000, baseTime + 3000 );
        BuildResult buildResult2 = createTestBuildResult( testBuildResult2 );
        testProject1.addBuildResult( buildResult2 );

        testBuildResult3 = createTestBuildResult( 3, true, 3, 3, "error3", 3, baseTime + 4000, baseTime + 5000 );
        BuildResult buildResult3 = createTestBuildResult( testBuildResult3 );
        scmResult = createTestScmResult( "commandOutput3", "providerMessage3", true, "3" );
        buildResult3.setScmResult( scmResult );
        testBuildResult3.setScmResult( createTestScmResult( scmResult, "3" ) );
        testProject2.addBuildResult( buildResult3 );

        // TODO: better way? this assumes that some untested methods already work!
        Schedule schedule2 = createTestSchedule( testSchedule2 );
        if ( addToStore )
        {
            schedule2 = scheduleDao.addSchedule( schedule2 );
            testSchedule2.setId( schedule2.getId() );
        }
        else
        {
            // from expected.xml, continuum-data-management
            testSchedule2.setId( 1 );
        }

        Schedule schedule1 = createTestSchedule( testSchedule1 );
        if ( addToStore )
        {
            schedule1 = scheduleDao.addSchedule( schedule1 );
            testSchedule1.setId( schedule1.getId() );
        }
        else
        {
            // from expected.xml, continuum-data-management
            testSchedule1.setId( 2 );
        }

        Schedule schedule3 = createTestSchedule( testSchedule3 );
        if ( addToStore )
        {
            schedule3 = scheduleDao.addSchedule( schedule3 );
            testSchedule3.setId( schedule3.getId() );
        }
        else
        {
            // from expected.xml, continuum-data-management
            testSchedule3.setId( 3 );
        }

        Installation installationJava14 = createTestInstallation( testInstallationJava14 );
        if ( addToStore )
        {
            installationJava14 = installationDao.addInstallation( installationJava14 );
        }
        else
        {
            installationJava14.setInstallationId( 1 );
        }

        Installation installationMaven20a3 = createTestInstallation( testInstallationMaven20a3 );
        if ( addToStore )
        {
            installationMaven20a3 = installationDao.addInstallation( installationMaven20a3 );
        }
        else
        {
            installationMaven20a3.setInstallationId( 2 );
        }

        Installation installationJava13 = createTestInstallation( testInstallationJava13 );
        if ( addToStore )
        {
            installationJava13 = installationDao.addInstallation( installationJava13 );
        }
        else
        {
            installationJava13.setInstallationId( 3 );
        }

        testProfile1 =
            createTestProfile( "name1", "description1", 1, true, true, installationJava13, installationMaven20a3 );
        testProfile2 =
            createTestProfile( "name2", "description2", 2, false, true, installationJava14, installationMaven20a3 );
        testProfile3 =
            createTestProfile( "name3", "description3", 3, true, false, installationJava14, installationMaven20a3 );

        Profile profile1 = createTestProfile( testProfile1 );
        if ( addToStore )
        {
            profile1 = profileDao.addProfile( profile1 );
            testProfile1.setId( profile1.getId() );
        }
        else
        {
            testProfile1.setId( 1 );
        }

        Profile profile2 = createTestProfile( testProfile2 );
        if ( addToStore )
        {
            profile2 = profileDao.addProfile( profile2 );
            testProfile2.setId( profile2.getId() );
        }
        else
        {
            testProfile2.setId( 2 );
        }

        Profile profile3 = createTestProfile( testProfile3 );
        if ( addToStore )
        {
            profile3 = profileDao.addProfile( profile3 );
            testProfile3.setId( profile3.getId() );
        }
        else
        {
            profile3.setId( 3 );
        }

        testRepoPurgeConfiguration1 =
            createTestRepositoryPurgeConfiguration( true, 5, 50, false, schedule2, true, localRepository1 );
        if ( addToStore )
        {
            testRepoPurgeConfiguration1 =
                repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( testRepoPurgeConfiguration1 );
        }
        else
        {
            testRepoPurgeConfiguration1.setId( 1 );
        }

        testRepoPurgeConfiguration2 =
            createTestRepositoryPurgeConfiguration( false, 10, 200, true, schedule1, true, localRepository2 );
        if ( addToStore )
        {
            testRepoPurgeConfiguration2 =
                repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( testRepoPurgeConfiguration2 );
        }
        else
        {
            testRepoPurgeConfiguration2.setId( 2 );
        }

        testRepoPurgeConfiguration3 =
            createTestRepositoryPurgeConfiguration( false, 10, 200, true, schedule2, true, localRepository1 );
        if ( addToStore )
        {
            testRepoPurgeConfiguration3 =
                repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( testRepoPurgeConfiguration3 );
        }
        else
        {
            testRepoPurgeConfiguration3.setId( 3 );
        }

        testDirectoryPurgeConfig =
            createTestDirectoryPurgeConfiguration( "location1", "directoryType1", true, 10, 50, schedule2, true );
        if ( addToStore )
        {
            testDirectoryPurgeConfig =
                directoryPurgeConfigurationDao.addDirectoryPurgeConfiguration( testDirectoryPurgeConfig );
        }
        else
        {
            testDirectoryPurgeConfig.setId( 1 );
        }

        BuildDefinition testGroupBuildDefinition1 =
            createTestBuildDefinition( "arguments1", "buildFile1", "goals1", profile1, schedule2, false, false );
        BuildDefinition testGroupBuildDefinition2 =
            createTestBuildDefinition( "arguments2", "buildFile2", "goals2", profile1, schedule1, false, false );
        BuildDefinition testGroupBuildDefinition3 =
            createTestBuildDefinition( "arguments3", "buildFile3", "goals3", profile2, schedule1, false, false );
        BuildDefinition testGroupBuildDefinition4 =
            createTestBuildDefinition( null, null, "deploy", null, null, false, false );

        BuildDefinition testBuildDefinition1 =
            createTestBuildDefinition( "arguments11", "buildFile11", "goals11", profile2, schedule1, false, false );
        BuildDefinition testBuildDefinition2 =
            createTestBuildDefinition( "arguments12", "buildFile12", "goals12", profile2, schedule2, false, false );
        BuildDefinition testBuildDefinition3 =
            createTestBuildDefinition( "arguments13", "buildFile13", "goals13", profile1, schedule2, false, false );
        BuildDefinition testBuildDefinition4 =
            createTestBuildDefinition( null, null, "deploy", null, null, false, false );

        ProjectGroup group = createTestProjectGroup( defaultProjectGroup );

        Project project1 = createTestProject( testProject1 );
        project1.addBuildResult( buildResult1 );
        project1.addBuildResult( buildResult2 );
        project1.setCheckoutResult( checkoutResult1 );
        ProjectNotifier notifier1 = createTestNotifier( testNotifier1 );
        project1.addNotifier( notifier1 );
        testProject1.addNotifier( testNotifier1 );

        BuildDefinition buildDefinition1 = createTestBuildDefinition( testBuildDefinition1 );
        project1.addBuildDefinition( buildDefinition1 );
        testProject1.addBuildDefinition( testBuildDefinition1 );
        BuildDefinition buildDefinition2 = createTestBuildDefinition( testBuildDefinition2 );
        project1.addBuildDefinition( buildDefinition2 );
        testProject1.addBuildDefinition( testBuildDefinition2 );

        ProjectDeveloper projectDeveloper1 = createTestDeveloper( testDeveloper1 );
        project1.addDeveloper( projectDeveloper1 );
        testProject1.addDeveloper( testDeveloper1 );

        ProjectDependency projectDependency1 = createTestDependency( testDependency1 );
        project1.addDependency( projectDependency1 );
        testProject1.addDependency( testDependency1 );

        ProjectDependency projectDependency2 = createTestDependency( testDependency2 );
        project1.addDependency( projectDependency2 );
        testProject1.addDependency( testDependency2 );

        group.addProject( project1 );
        defaultProjectGroup.addProject( project1 );
        Project project2 = createTestProject( testProject2 );
        project2.addBuildResult( buildResult3 );
        ProjectNotifier notifier2 = createTestNotifier( testNotifier2 );
        project2.addNotifier( notifier2 );
        testProject2.addNotifier( testNotifier2 );
        ProjectNotifier notifier3 = createTestNotifier( testNotifier3 );
        project2.addNotifier( notifier3 );
        testProject2.addNotifier( testNotifier3 );

        BuildDefinition buildDefinition3 = createTestBuildDefinition( testBuildDefinition3 );
        project2.addBuildDefinition( buildDefinition3 );
        testProject2.addBuildDefinition( testBuildDefinition3 );

        BuildDefinition buildDefinition4 = createTestBuildDefinition( testBuildDefinition4 );
        project2.addBuildDefinition( buildDefinition4 );
        testProject2.addBuildDefinition( testBuildDefinition4 );

        ProjectDeveloper projectDeveloper2 = createTestDeveloper( testDeveloper2 );
        project2.addDeveloper( projectDeveloper2 );
        testProject2.addDeveloper( testDeveloper2 );

        ProjectDeveloper projectDeveloper3 = createTestDeveloper( testDeveloper3 );
        project2.addDeveloper( projectDeveloper3 );
        testProject2.addDeveloper( testDeveloper3 );

        ProjectDependency projectDependency3 = createTestDependency( testDependency3 );
        project2.addDependency( projectDependency3 );
View Full Code Here

        return dependency;
    }

    protected static ProjectDeveloper createTestDeveloper( int continuumId, String email, String name, String scmId )
    {
        ProjectDeveloper developer = new ProjectDeveloper();
        developer.setContinuumId( continuumId );
        developer.setEmail( email );
        developer.setName( name );
        developer.setScmId( scmId );
        return developer;
    }
View Full Code Here

   
        if ( developers != null )
        {
            for ( Map<String, Object> map : developers )
            {
                ProjectDeveloper developer = new ProjectDeveloper();
                developer.setName( ContinuumBuildConstant.getDeveloperName( map ) );
                developer.setEmail( ContinuumBuildConstant.getDeveloperEmail( map ) );
                developer.setScmId( ContinuumBuildConstant.getDeveloperScmId( map ) );
   
                projectDevelopers.add( developer );
            }
        }
        return projectDevelopers;
View Full Code Here

        if ( developers != null )
        {
            for ( Map<String, Object> map : developers )
            {
                ProjectDeveloper developer = new ProjectDeveloper();
                developer.setName( ContinuumBuildConstant.getDeveloperName( map ) );
                developer.setEmail( ContinuumBuildConstant.getDeveloperEmail( map ) );
                developer.setScmId( ContinuumBuildConstant.getDeveloperScmId( map ) );

                projectDevelopers.add( developer );
            }
        }
        return projectDevelopers;
View Full Code Here

            List<ProjectDeveloper> cds = new ArrayList<ProjectDeveloper>();

            for ( Xpp3Dom developer : developersList )
            {
                ProjectDeveloper cd = new ProjectDeveloper();

                cd.setScmId( getValue( developer, "id", null ) );

                cd.setName( getValue( developer, "name", null ) );

                cd.setEmail( getValue( developer, "email", null ) );

                cds.add( cd );
            }

            project.setDevelopers( cds );
        }

        // ----------------------------------------------------------------------
        // Dependencies
        // ----------------------------------------------------------------------

        Xpp3Dom dependencies = mavenProject.getChild( "dependencies" );

        if ( dependencies != null )
        {
            Xpp3Dom[] dependenciesList = dependencies.getChildren();

            List<ProjectDependency> deps = new ArrayList<ProjectDependency>();

            for ( Xpp3Dom dependency : dependenciesList )
            {
                ProjectDependency cd = new ProjectDependency();

                if ( getValue( dependency, "groupId", null ) != null )
                {
                    cd.setGroupId( getValue( dependency, "groupId", null ) );

                    cd.setArtifactId( getValue( dependency, "artifactId", null ) );
                }
                else
                {
                    cd.setGroupId( getValue( dependency, "id", null ) );

                    cd.setArtifactId( getValue( dependency, "id", null ) );
                }

                cd.setVersion( getValue( dependency, "version", null ) );

                deps.add( cd );
            }

            project.setDependencies( deps );
View Full Code Here

        {
            List<ProjectDeveloper> developers = new ArrayList<ProjectDeveloper>();

            for ( Developer d : (List<Developer>) mavenProject.getDevelopers() )
            {
                ProjectDeveloper cd = new ProjectDeveloper();

                cd.setScmId( d.getId() );

                cd.setName( d.getName() );

                cd.setEmail( d.getEmail() );

                developers.add( cd );
            }

            continuumProject.setDevelopers( developers );
        }

        // ----------------------------------------------------------------------
        // Parent
        // ----------------------------------------------------------------------

        if ( mavenProject.getParent() != null )
        {
            MavenProject parentProject = mavenProject.getParent();

            ProjectDependency parent = new ProjectDependency();

            parent.setGroupId( parentProject.getGroupId() );

            parent.setArtifactId( parentProject.getArtifactId() );

            parent.setVersion( parentProject.getVersion() );

            continuumProject.setParent( parent );
        }

        // ----------------------------------------------------------------------
        // Dependencies
        // ----------------------------------------------------------------------

        List<ProjectDependency> dependencies = new ArrayList<ProjectDependency>();

        for ( Dependency dependency : (List<Dependency>) mavenProject.getDependencies() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Plugin dependency : (List<Plugin>) mavenProject.getBuildPlugins() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( ReportPlugin dependency : (List<ReportPlugin>) mavenProject.getReportPlugins() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Extension dependency : (List<Extension>) mavenProject.getBuildExtensions() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        continuumProject.setDependencies( dependencies );
View Full Code Here

        {
            List<ProjectDeveloper> developers = new ArrayList<ProjectDeveloper>();

            for ( Developer d : (List<Developer>) mavenProject.getDevelopers() )
            {
                ProjectDeveloper cd = new ProjectDeveloper();

                cd.setScmId( d.getId() );

                cd.setName( d.getName() );

                cd.setEmail( d.getEmail() );

                developers.add( cd );
            }

            continuumProject.setDevelopers( developers );
        }

        // ----------------------------------------------------------------------
        // Parent
        // ----------------------------------------------------------------------

        if ( mavenProject.getParent() != null )
        {
            MavenProject parentProject = mavenProject.getParent();

            ProjectDependency parent = new ProjectDependency();

            parent.setGroupId( parentProject.getGroupId() );

            parent.setArtifactId( parentProject.getArtifactId() );

            parent.setVersion( parentProject.getVersion() );

            continuumProject.setParent( parent );
        }

        // ----------------------------------------------------------------------
        // Dependencies
        // ----------------------------------------------------------------------

        List<ProjectDependency> dependencies = new ArrayList<ProjectDependency>();

        for ( Dependency dependency : (List<Dependency>) mavenProject.getDependencies() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Plugin dependency : (List<Plugin>) mavenProject.getBuildPlugins() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( ReportPlugin dependency : (List<ReportPlugin>) mavenProject.getReportPlugins() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Extension dependency : (List<Extension>) mavenProject.getBuildExtensions() )
        {
            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        continuumProject.setDependencies( dependencies );
View Full Code Here

            List<ProjectDeveloper> cds = new ArrayList<ProjectDeveloper>();

            for ( Xpp3Dom developer : developersList )
            {
                ProjectDeveloper cd = new ProjectDeveloper();

                cd.setScmId( getValue( developer, "id", null ) );

                cd.setName( getValue( developer, "name", null ) );

                cd.setEmail( getValue( developer, "email", null ) );

                cds.add( cd );
            }

            project.setDevelopers( cds );
        }

        // ----------------------------------------------------------------------
        // Dependencies
        // ----------------------------------------------------------------------

        Xpp3Dom dependencies = mavenProject.getChild( "dependencies" );

        if ( dependencies != null )
        {
            Xpp3Dom[] dependenciesList = dependencies.getChildren();

            List<ProjectDependency> deps = new ArrayList<ProjectDependency>();

            for ( Xpp3Dom dependency : dependenciesList )
            {
                ProjectDependency cd = new ProjectDependency();

                if ( getValue( dependency, "groupId", null ) != null )
                {
                    cd.setGroupId( getValue( dependency, "groupId", null ) );

                    cd.setArtifactId( getValue( dependency, "artifactId", null ) );
                }
                else
                {
                    cd.setGroupId( getValue( dependency, "id", null ) );

                    cd.setArtifactId( getValue( dependency, "id", null ) );
                }

                cd.setVersion( getValue( dependency, "version", null ) );

                deps.add( cd );
            }

            project.setDependencies( deps );
View Full Code Here

TOP

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

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.