continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r957111 - in /continuum/trunk: continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/ continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ continuum-we...
Date Wed, 23 Jun 2010 05:11:01 GMT
Author: ctan
Date: Wed Jun 23 05:11:00 2010
New Revision: 957111

URL: http://svn.apache.org/viewvc?rev=957111&view=rev
Log:
[CONTINUUM-2454] fixed building of ant/shell project in distributed build
Submitted By: Gwen Harold 

with additional changes
- modified scm url of the sample project used for testing
- modified changes in buildProjectGroup of the selenium test



Modified:
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=957111&r1=957110&r2=957111&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
Wed Jun 23 05:11:00 2010
@@ -410,7 +410,7 @@ public class BuildProjectTaskExecutor
             return BuildAgentInstallationService.ANT_TYPE;
         }
 
-        return null;
+        return "";
     }
 
     private boolean shouldBuild( BuildContext context )
@@ -422,7 +422,12 @@ public class BuildProjectTaskExecutor
         map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, context.getTrigger() );
         map.put( ContinuumBuildAgentUtil.KEY_USERNAME, context.getUsername() );
         map.put( ContinuumBuildAgentUtil.KEY_SCM_CHANGES, getScmChanges( context.getScmResult()
) );
-        map.put( ContinuumBuildAgentUtil.KEY_MAVEN_PROJECT, getMavenProject( context ) );
+        
+        if( context.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR
) )
+        {
+            map.put( ContinuumBuildAgentUtil.KEY_MAVEN_PROJECT, getMavenProject( context
) );    
+        }
+        
         if ( context.getLatestUpdateDate() != null )
         {
             map.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, context.getLatestUpdateDate()
);

Modified: continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=957111&r1=957110&r2=957111&view=diff
==============================================================================
--- continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
(original)
+++ continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
Wed Jun 23 05:11:00 2010
@@ -218,7 +218,15 @@ public class DistributedBuildProjectTask
                 context.put( ContinuumBuildConstant.KEY_BUILD_DEFINITION_LABEL, buildDefinitionLabel
);
                 
                 context.put( ContinuumBuildConstant.KEY_BUILD_FILE, buildDef.getBuildFile()
);
-                context.put( ContinuumBuildConstant.KEY_GOALS, buildDef.getGoals() );
+                
+                if( buildDef.getGoals() == null )
+                {
+                    context.put( ContinuumBuildConstant.KEY_GOALS, "" ); 
+                }
+                else
+                {
+                    context.put( ContinuumBuildConstant.KEY_GOALS, buildDef.getGoals() );
  
+                }
 
                 if ( buildDef.getArguments() == null )
                 {

Modified: continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties?rev=957111&r1=957110&r2=957111&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Wed Jun 23
05:11:00 2010
@@ -128,6 +128,18 @@ SHELL_SCM_URL=http://localhost:9595/exam
 SHELL_SCM_USERNAME=
 SHELL_SCM_PASSWORD=
 
+SHELL_GROUP_NAME=Shell Group
+SHELL_GROUP_ID=Shell Group Id
+SHELL_GROUP_DESC=Shell Group Description
+
+SHELL_NAME_TWO=Shell Project Two
+SHELL_DESCRIPTION_TWO=This is a sample Shell Project used for testing
+SHELL_VERSION_TWO=1.0.0-SNAPSHOT
+SHELL_TAG_TWO=
+SHELL_SCM_URL_TWO=scm:svn:${svn.base.url}/trunk/shell/
+SHELL_SCM_USERNAME_TWO=
+SHELL_SCM_PASSWORD_TWO=
+
 ########################
 # projectGroup group 
 ########################

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java?rev=957111&r1=957110&r2=957111&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
Wed Jun 23 05:11:00 2010
@@ -77,4 +77,56 @@ public class ShellProjectTest
                     SHELL_SCM_PASSWORD, SHELL_TAG, false, null, null, false, "shell" );
         assertTextPresent( "Project name already exist" );
     }
+
+    @Test( dependsOnMethods = { "testAddBuildAgent" } )
+    public void testBuildShellProjectWithDistributedBuildsEnabled()
+       throws Exception
+    {
+        String SHELL_GROUP_NAME = getProperty( "SHELL_GROUP_NAME" );
+        String SHELL_GROUP_ID = getProperty( "SHELL_GROUP_ID" );
+        String SHELL_GROUP_DESC = getProperty( "SHELL_GROUP_DESC" );
+
+        String SHELL_NAME = getProperty( "SHELL_NAME_TWO" );
+        String SHELL_DESCRIPTION = getProperty( "SHELL_DESCRIPTION_TWO" );
+        String SHELL_VERSION = getProperty( "SHELL_VERSION_TWO" );
+        String SHELL_TAG = getProperty( "SHELL_TAG_TWO" );
+        String SHELL_SCM_URL = getProperty( "SHELL_SCM_URL_TWO" );
+        String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME_TWO" );
+        String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD_TWO" );
+
+        addProjectGroup( SHELL_GROUP_NAME, SHELL_GROUP_ID, SHELL_GROUP_DESC, true );
+
+        goToAddShellProjectPage();
+        addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME,
+                    SHELL_SCM_PASSWORD, SHELL_TAG, false, SHELL_GROUP_NAME, null, true, "shell"
);
+        assertProjectGroupSummaryPage( SHELL_GROUP_NAME, SHELL_GROUP_ID, SHELL_GROUP_DESC
);
+
+        goToProjectGroupsSummaryPage();
+        clickLinkWithText( SHELL_GROUP_NAME );
+        clickLinkWithText( "Build Definitions" );
+        clickLinkWithXPath( "//table[@id='ec_table']/tbody/tr/td[14]/a/img" );
+        
+        editBuildDefinitionShellType( "build.sh", "", "description", "shell", true );
+
+        enableDistributedBuilds();
+
+        goToProjectGroupsSummaryPage();
+
+        buildProjectGroup( SHELL_GROUP_NAME ,SHELL_GROUP_ID , SHELL_GROUP_DESC ,SHELL_NAME,
true );
+
+    }
+    
+    private void editBuildDefinitionShellType( String buildFile, String arguments, String
description, String buildDefinitionType, boolean alwaysBuild )
+    {
+        setFieldValue( "buildFile", buildFile);
+        setFieldValue( "arguments", arguments );
+        setFieldValue( "description", description );
+        setFieldValue( "buildDefinitionType", buildDefinitionType );
+        if( alwaysBuild )
+        {
+            checkField( "alwaysBuild" );
+        }
+        
+        submit();
+    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=957111&r1=957110&r2=957111&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Wed Jun 23 05:11:00 2010
@@ -405,15 +405,19 @@ public abstract class AbstractContinuumT
         clickLinkWithText( projectName );
         clickLinkWithText( "Builds" );
         clickLinkWithText( "Result" );
-        
+
+        assertPage( "Continuum - Build result" );
+        assertTextPresent( "Build result for " + projectName );
+
         if ( success )
         {
-            assertTextPresent( "BUILD SUCCESS" );
+            assertImgWithAlt( "Success" );
         }
         else
         {
-            assertTextPresent( "BUILD FAILURE" );
+            assertImgWithAlt( "Failed" );
         }
+
         clickLinkWithText( "Project Group Summary" );
     }
 



Mime
View raw message