continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r161931 - maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus maven/continuum/trunk/continuum-web/src/main/resources/templates/screens
Date Tue, 19 Apr 2005 17:38:24 GMT
Author: trygvis
Date: Tue Apr 19 10:38:23 2005
New Revision: 161931

URL: http://svn.apache.org/viewcvs?view=rev&rev=161931
Log:
o Made the ContinuumStateContentGenerator use the correct constant for the
  "Building" state and switched all the other ones to the correct
  ContinuumProjectState constant.
Fixing a issue in the ProjectBuild template where the build result was empty:
o Added getBuildResultForBuild() to Continuum.
o Added the buildResult to the view context.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java?view=diff&r1=161930&r2=161931
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
Tue Apr 19 10:38:23 2005
@@ -19,11 +19,11 @@
 import java.net.URL;
 import java.util.Iterator;
 import java.util.Properties;
-import java.util.List;
 
+import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
@@ -96,6 +96,9 @@
         throws ContinuumException;
 
     Iterator getBuildsForProject( String projectId )
+        throws ContinuumException;
+
+    ContinuumBuildResult getBuildResultForBuild( String buildId )
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

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?view=diff&r1=161930&r2=161931
==============================================================================
--- 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
Tue Apr 19 10:38:23 2005
@@ -20,24 +20,24 @@
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.URL;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Iterator;
 import java.util.Properties;
-import java.util.List;
 
 import org.apache.maven.continuum.buildcontroller.BuildController;
 import org.apache.maven.continuum.builder.ContinuumBuilder;
+import org.apache.maven.continuum.builder.ant.AntBuilder;
+import org.apache.maven.continuum.builder.manager.BuilderManager;
 import org.apache.maven.continuum.builder.maven.m1.Maven1Builder;
 import org.apache.maven.continuum.builder.maven.m2.MavenShellBuilder;
 import org.apache.maven.continuum.builder.shell.ShellBuilder;
-import org.apache.maven.continuum.builder.ant.AntBuilder;
-import org.apache.maven.continuum.builder.manager.BuilderManager;
 import org.apache.maven.continuum.buildqueue.BuildQueue;
 import org.apache.maven.continuum.buildqueue.BuildQueueException;
+import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
@@ -413,6 +413,20 @@
         catch ( ContinuumStoreException e )
         {
             throw new ContinuumException( "Cannot retrieve builds for project with id = "
+ projectId, e );
+        }
+    }
+
+    public ContinuumBuildResult getBuildResultForBuild( String buildId )
+        throws ContinuumException
+    {
+        try
+        {
+            getLogger().info( "getBuildResultForBuild( String buildId )" );
+            return store.getBuildResultForBuild( buildId );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Cannot retrieve build result for build with id
= " + buildId, e );
         }
     }
 

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java?view=diff&r1=161930&r2=161931
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
Tue Apr 19 10:38:23 2005
@@ -1,13 +1,17 @@
 package org.codehaus.continuum.web.tool;
 
 import org.codehaus.plexus.formica.web.ContentGenerator;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id: StateContentGenerator.java,v 1.1 2005/04/04 14:05:38 jvanzyl Exp $
  */
 public class ContinuumStateContentGenerator
+    extends AbstractLogEnabled
     implements ContentGenerator
 {
     public String generate( Object item )
@@ -16,29 +20,35 @@
 
         int state = p.getState();
 
-        if ( state == 1 )
+        if ( state == ContinuumProjectState.NEW )
         {
             return "New";
         }
-        else if ( state == 2 )
+        else if ( state == ContinuumProjectState.OK )
         {
             return "<img src=\"/continuum/images/icon_success_sml.gif\" alt=\"Success\"/>";
         }
-        else if ( state == 3 )
+        else if ( state == ContinuumProjectState.FAILED )
         {
             return "<img src=\"/continuum/images/icon_error_sml.gif\" alt=\"Failed\"/>";
         }
-        else if ( state == 4 )
+        else if ( state == ContinuumProjectState.ERROR )
         {
             return "<img src=\"/continuum/images/icon_warning_sml.gif\" alt=\"Error\"/>";
         }
-        else if ( state == 5 )
+        else if ( state == ContinuumProjectState.BUILD_SIGNALED )
         {
             return "Build Queued";
         }
-        else
+        else if ( state == ContinuumProjectState.BUILDING )
         {
             return "Building";
+        }
+        else
+        {
+            getLogger().warn( "Unknown project state '" + state + "' Project id '" + p.getId()
+ "'." );
+
+            return "";
         }
     }
 }

Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?view=diff&r1=161930&r2=161931
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
Tue Apr 19 10:38:23 2005
@@ -127,12 +127,16 @@
             <id>ProjectBuild</id>
             <scalars>
               <scalar>
+                <id>project</id>
+                <expression>getProject(#projectId)</expression>
+              </scalar>
+              <scalar>
                 <id>build</id>
                 <expression>getBuild(#buildId)</expression>
               </scalar>
               <scalar>
-                <id>project</id>
-                <expression>getProject(#projectId)</expression>
+                <id>buildResult</id>
+                <expression>getBuildResultForBuild(#buildId)</expression>
               </scalar>
             </scalars>
           </view>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm?view=diff&r1=161930&r2=161931
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
Tue Apr 19 10:38:23 2005
@@ -13,13 +13,17 @@
     </table>
   </p>
 
+<hr>
+$buildResult<br>
+$buildResult.class.name
+<hr>
   <h4>Standard Output</h4>
   <p>
-    <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
1px"><code><pre>$build.buildResult.standardOutput</pre></code></div>
+    <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
1px"><code><pre>$buildResult.standardOutput</pre></code></div>
   </p>
 
   <h4>Standard Error</h4>
   <p>
-    <div style="width:100%; height:200px; overflow:auto; border-style: solid; border-width:
1px"><code><pre>$build.buildResult.standardError</pre></code></div>
+    <div style="width:100%; height:200px; overflow:auto; border-style: solid; border-width:
1px"><code><pre>$buildResult.standardError</pre></code></div>
   </p>
 </div>



Mime
View raw message