Package org.apache.continuum.model.project

Examples of org.apache.continuum.model.project.ProjectGroupSummary


      Map<Integer, ProjectGroupSummary> summaries = projectDao.getProjectsSummary();

      assertNotNull( summaries );
      assertEquals( "check size of project summaries", 2, summaries.size() );

      ProjectGroupSummary summary = summaries.get( testProjectGroup2.getId() );
      assertEquals( "check id of project group", testProjectGroup2.getId(), summary.getProjectGroupId() );
      assertEquals( "check number of errors", 1, summary.getNumberOfErrors() );
      assertEquals( "check number of successes", 0, summary.getNumberOfSuccesses() );
      assertEquals( "check number of failures", 0, summary.getNumberOfFailures() );
      assertEquals( "check number of projects", 2, summary.getNumberOfProjects() );

      summary = summaries.get( defaultProjectGroup.getId() );
      assertEquals( "check id of project group", defaultProjectGroup.getId(), summary.getProjectGroupId() );
        assertEquals( "check number of errors", 0, summary.getNumberOfErrors() );
        assertEquals( "check number of successes", 2, summary.getNumberOfSuccesses() );
        assertEquals( "check number of failures", 0, summary.getNumberOfFailures() );
        assertEquals( "check number of projects", 2, summary.getNumberOfProjects() );

  }
View Full Code Here


    {
        Map<Integer, ProjectGroupSummary> map = new HashMap<Integer, ProjectGroupSummary>();

        for ( ProjectSummaryResult result : results )
        {
            ProjectGroupSummary summary;
            int projectGroupId = result.getProjectGroupId();
            int size = new Long( result.getSize() ).intValue();
            int state = result.getProjectState();

            if ( map.containsKey( projectGroupId ) )
            {
                summary = map.get( projectGroupId );
            }
            else
            {
                summary = new ProjectGroupSummary( projectGroupId );
            }

            summary.addProjects( size );

            if ( state == 2 )
            {
                summary.addNumberOfSuccesses( size );
            }
            else if ( state == 3 )
            {
                summary.addNumberOfFailures( size );
            }
            else if ( state == 4 )
            {
                summary.addNumberOfErrors( size );
            }

            map.put( projectGroupId, summary );
        }
        return map;
View Full Code Here

TOP

Related Classes of org.apache.continuum.model.project.ProjectGroupSummary

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.