continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r897111 - in /continuum/branches/continuum-1.3.x/continuum-webapp/src: main/java/org/apache/maven/continuum/web/action/BuildResultAction.java test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
Date Fri, 08 Jan 2010 06:29:28 GMT
Author: ctan
Date: Fri Jan  8 06:28:43 2010
New Revision: 897111

URL: http://svn.apache.org/viewvc?rev=897111&view=rev
Log:
[CONTINUUM-2394] check if buildId == 0 to know if user is trying to view the current build
in a distributed build scenario and removed try/catch in getBuildResult

Modified:
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=897111&r1=897110&r2=897111&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
Fri Jan  8 06:28:43 2010
@@ -93,20 +93,11 @@
         // check if there are surefire results to display
         project = getContinuum().getProject( getProjectId() );
 
-        try
-        {
-            buildResult = getContinuum().getBuildResult( getBuildId() );
-        }
-        catch ( ContinuumException e )
-        {
-            buildResult = null;
-        }
-
         ConfigurationService configuration = getContinuum().getConfiguration();
 
         // view build result of the current build from the distributed build agent
         if ( configuration.isDistributedBuildEnabled() &&
-            project.getState() == ContinuumProjectState.BUILDING && buildResult ==
null )
+            project.getState() == ContinuumProjectState.BUILDING && getBuildId()
== 0 )
         {
             // if the project is currently building in distributed build agent, the build
result will be stored in the database after the build is finished. 
             // it's safe to assume that the build result will be null at this point
@@ -139,6 +130,8 @@
         }
         else
         {
+            buildResult = getContinuum().getBuildResult( getBuildId() );
+
             // directory contains files ?
             File surefireReportsDirectory =
                 configuration.getTestReportsDirectory( buildId, getProjectId() );

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java?rev=897111&r1=897110&r2=897111&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
Fri Jan  8 06:28:43 2010
@@ -66,7 +66,6 @@
         Project project = createProject( "stub-project" );
 
         continuum.expects( once() ).method( "getProject" ).will( returnValue( project ) );
-        continuum.expects( once() ).method( "getBuildResult" ).will( returnValue( null )
);
         continuum.expects( once() ).method( "getConfiguration" ).will( returnValue( (ConfigurationService)
configurationService.proxy()  ) );
         configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will(
returnValue( true ) );
         distributedBuildManager.expects( once() ).method( "getBuildResult" ).will( returnValue(
new HashMap<String, Object>() ) );



Mime
View raw message