continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r926487 - in /continuum/trunk: continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp-test/src/test/testng/org/apache/continuum/we...
Date Tue, 23 Mar 2010 07:42:01 GMT
Author: ctan
Date: Tue Mar 23 07:42:01 2010
New Revision: 926487

URL: http://svn.apache.org/viewvc?rev=926487&view=rev
Log:
[CONTINUUM-2381] remove build agent from overalldistributedbuildqueue map when disabled so
that an overalldistributedbuildqueue object will be created when re-enabled.

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=926487&r1=926486&r2=926487&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
Tue Mar 23 07:42:01 2010
@@ -278,6 +278,8 @@ public class DefaultDistributedBuildMana
 
                     container.release( overallDistributedBuildQueue );
 
+                    overallDistributedBuildQueues.remove( buildAgentUrl );
+
                     log.info( "remove distributed build queue for build agent '" + buildAgentUrl
+ "'" );
                 }
                 catch ( TaskQueueException e )

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java?rev=926487&r1=926486&r2=926487&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
Tue Mar 23 07:42:01 2010
@@ -40,11 +40,11 @@ public class BuildAgentsTest
         {
             enableDistributedBuilds();
             goToAddBuildAgent();
-            addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true, false );
+            addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true, true, false );
             goToAddBuildAgent();
-            addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true, true );
+            addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true, true, true
);
             goToAddBuildAgent();
-            addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true, false );
+            addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true, false, false
);
         }
         finally
         {
@@ -62,7 +62,7 @@ public class BuildAgentsTest
         {
             enableDistributedBuilds();
             goToAddBuildAgent();
-            addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false, false ) ;
+            addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false, false, false
) ;
             assertTextPresent( "Build agent already exists" );
         }
         finally
@@ -99,9 +99,9 @@ public class BuildAgentsTest
         {
             enableDistributedBuilds();
             goToBuildAgentPage();
-            String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
-            removeBuildAgent( BUILD_AGENT_NAME3 );
-            assertTextNotPresent( BUILD_AGENT_NAME3 );
+            String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+            removeBuildAgent( BUILD_AGENT_NAME );
+            assertTextNotPresent( BUILD_AGENT_NAME );
         }
         finally
         {
@@ -118,7 +118,7 @@ public class BuildAgentsTest
     	{
     	    enableDistributedBuilds();
     	    goToAddBuildAgent();
-    	    addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false, false ) ;
+    	    addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false, false, false ) ;
     	    assertTextPresent( "Build agent url is required." );
     	}
     	finally
@@ -127,21 +127,60 @@ public class BuildAgentsTest
     	}
     }
 
+    @Test( dependsOnMethods = { "testProjectGroupAllBuildSuccessWithDistributedBuilds" }
)
+    public void testBuildSuccessWithDistributedBuildsAfterDisableEnableOfBuildAgent()
+        throws Exception
+    {
+        String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME2" );
+        String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION2" );
+        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+        String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
+        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
+
+        try
+        {
+            enableDistributedBuilds();
+
+            addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true
);
+            goToProjectGroupsSummaryPage();
+            assertLinkPresent( M2_PROJ_GRP_NAME );
+            
+            clickLinkWithText( M2_PROJ_GRP_NAME );
+
+            assertPage( "Continuum - Project Group" );
+
+            // disable then enable build agent
+            goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+            enableDisableBuildAgent( BUILD_AGENT_NAME, false );
+            goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+            enableDisableBuildAgent( BUILD_AGENT_NAME, true );
+
+            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME );
+        }
+        finally
+        {
+            disableDistributedBuilds();
+        }
+    }
+
 //TESTS FOR BUILD AGENT GROUPS
 
     @Test( dependsOnMethods = { "testAddBuildAgent", "testDeleteBuildAgent" } )
     public void testAddBuildAgentGroup()
         throws Exception
     {
-        String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
         String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+        String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
         String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
 
         try
         {
             enableDistributedBuilds();
             goToAddBuildAgentGroup();
-            addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME,
BUILD_AGENT_NAME2 }, new String[] {}, true );
+            addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2,
BUILD_AGENT_NAME3 }, new String[] {}, true );
         }
         finally
         {
@@ -153,19 +192,19 @@ public class BuildAgentsTest
     public void testEditBuildAgentGroup()
         throws Exception
     {
-        String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
         String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+        String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
         String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
 
         String newName = "new_agentgroupname";
         try
         {
             enableDistributedBuilds();
-            goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME,
BUILD_AGENT_NAME2 } );
+            goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2,
BUILD_AGENT_NAME3 } );
             addEditBuildAgentGroup( newName, new String[] {},
-                             new String[] { BUILD_AGENT_NAME2 }, true );
-            goToEditBuildAgentGroup( newName, new String[] { BUILD_AGENT_NAME } );
-            addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2
},
+                             new String[] { BUILD_AGENT_NAME3 }, true );
+            goToEditBuildAgentGroup( newName, new String[] { BUILD_AGENT_NAME2 } );
+            addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME3
},
                              new String[] {}, true );
         }
         finally
@@ -178,15 +217,15 @@ public class BuildAgentsTest
     public void testAddAnExistingBuildAgentGroup()
         throws Exception
     {
-        String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
         String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+        String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
         String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
 
         try
         {
             enableDistributedBuilds();
             goToAddBuildAgentGroup();
-           	addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME,
BUILD_AGENT_NAME2 }, new String[] {}, false );
+           	addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2,
BUILD_AGENT_NAME3 }, new String[] {}, false );
            	assertTextPresent( "Build agent group already exists." );
         }
         finally

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java?rev=926487&r1=926486&r2=926487&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
Tue Mar 23 07:42:01 2010
@@ -293,7 +293,10 @@ public class MavenTwoProjectTest
             //wait for project to finish checkout
             waitForProjectCheckout();
 
-            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME );
  
+            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME );
+
+            removeProjectGroup( M2_PROJ_GRP_NAME );
+            assertLinkNotPresent( M2_PROJ_GRP_NAME );
         }
         finally
         {

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java?rev=926487&r1=926486&r2=926487&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
Tue Mar 23 07:42:01 2010
@@ -55,7 +55,7 @@ public abstract class AbstractBuildAgent
         assertBuildAgentPage();
     }
 
-    public void addBuildAgent( String agentURL, String description, boolean success, boolean
enabled )
+    public void addBuildAgent( String agentURL, String description, boolean success, boolean
enabled, boolean pingOk )
     {
         setFieldValue( "saveBuildAgent_buildAgent_url", agentURL );
         setFieldValue("saveBuildAgent_buildAgent_description", description );
@@ -72,7 +72,15 @@ public abstract class AbstractBuildAgent
             assertBuildAgentPage();
             assertElementPresent( "link=" + agentURL );
             clickLinkWithText( agentURL );
-            assertTextPresent( new Boolean( enabled ).toString() );
+
+            if ( pingOk )
+            {
+                assertTextPresent( "true" );
+            }
+            else
+            {
+                assertTextPresent( "false" );
+            }
         }
         else
         {
@@ -98,15 +106,32 @@ public abstract class AbstractBuildAgent
         assertTextPresent( newDesc );
     }
 
+    public void enableDisableBuildAgent( String agentName, boolean enable )
+    {
+        assertFieldValue( agentName, "saveBuildAgent_buildAgent_url" );
+        
+        if ( enable )
+        {
+            checkField( "saveBuildAgent_buildAgent_enabled" );
+        }
+        else
+        {
+            uncheckField( "saveBuildAgent_buildAgent_enabled" );
+        }
+        submit();
+        assertBuildAgentPage();
+        assertTextPresent( new Boolean( enable ).toString() );
+    }
+
     public void goToAddBuildAgentGroup()
     {
-        String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
         String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+        String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
 
         goToBuildAgentPage();
         clickAndWait("editBuildAgentGroup_0"); //add button
         String[] options =
-            new String[] { "--- Available Build Agents ---", BUILD_AGENT_NAME, BUILD_AGENT_NAME2
};
+            new String[] { "--- Available Build Agents ---", BUILD_AGENT_NAME2, BUILD_AGENT_NAME3
};
         assertAddEditBuildAgentGroupPage( options, null );
     }
 



Mime
View raw message