Return-Path: Delivered-To: apmail-continuum-commits-archive@www.apache.org Received: (qmail 11676 invoked from network); 8 Jan 2010 06:30:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jan 2010 06:30:11 -0000 Received: (qmail 15340 invoked by uid 500); 8 Jan 2010 06:30:11 -0000 Delivered-To: apmail-continuum-commits-archive@continuum.apache.org Received: (qmail 15285 invoked by uid 500); 8 Jan 2010 06:30:11 -0000 Mailing-List: contact commits-help@continuum.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@continuum.apache.org Delivered-To: mailing list commits@continuum.apache.org Received: (qmail 15276 invoked by uid 99); 8 Jan 2010 06:30:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 06:30:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 06:30:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9943623889D5; Fri, 8 Jan 2010 06:29:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@continuum.apache.org From: ctan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100108062947.9943623889D5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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() ) );