You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by jv...@apache.org on 2005/05/21 03:25:47 UTC
svn commit: r171179 -
/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Author: jvanzyl
Date: Fri May 20 18:25:46 2005
New Revision: 171179
URL: http://svn.apache.org/viewcvs?rev=171179&view=rev
Log:
o matching the interface for failed and error projects.
Modified:
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=171179&r1=171178&r2=171179&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Fri May 20 18:25:46 2005
@@ -28,6 +28,7 @@
import org.apache.maven.continuum.project.MavenOneProject;
import org.apache.maven.continuum.project.MavenTwoProject;
import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
import org.apache.maven.continuum.scm.CheckOutScmResult;
@@ -36,11 +37,13 @@
import java.util.Collection;
import java.util.Properties;
import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl </a>
- * @version $Id: DefaultContinuum.java,v 1.7 2005/04/08 12:47:56 trygvis Exp $
+ * @version $Id$
*/
public class DefaultContinuum
extends AbstractLogEnabled
@@ -50,13 +53,52 @@
private ContinuumCore core;
// ----------------------------------------------------------------------
- //
+ // Projects
// ----------------------------------------------------------------------
public Collection getProjects()
throws ContinuumException
{
return core.getProjects();
+ }
+
+ // TODO: i realize these are horribly inefficient and I will correct using JDO
+ // properly after the alpha-2 release.
+
+ public Collection getProjectsWithFailures()
+ throws ContinuumException
+ {
+ List list = new ArrayList();
+
+ for ( Iterator i = core.getProjects().iterator(); i.hasNext(); )
+ {
+ ContinuumProject p = (ContinuumProject) i.next();
+
+ if ( p.getState() == ContinuumProjectState.FAILED )
+ {
+ list.add( p );
+ }
+ }
+
+ return list;
+ }
+
+ public Collection getProjectsWithErrors()
+ throws ContinuumException
+ {
+ List list = new ArrayList();
+
+ for ( Iterator i = core.getProjects().iterator(); i.hasNext(); )
+ {
+ ContinuumProject p = (ContinuumProject) i.next();
+
+ if ( p.getState() == ContinuumProjectState.FAILED )
+ {
+ list.add( p );
+ }
+ }
+
+ return list;
}
public ContinuumBuild getLatestBuildForProject( String id )