continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r915623 - in /continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test: resources/ testng/org/apache/continuum/web/test/ testng/org/apache/continuum/web/test/parent/
Date Wed, 24 Feb 2010 00:44:03 GMT
Author: ctan
Date: Wed Feb 24 00:44:02 2010
New Revision: 915623

URL: http://svn.apache.org/viewvc?rev=915623&view=rev
Log:
[CONTINUUM-2437] added selenium test

Modified:
    continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/resources/testng.properties
    continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
    continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
    continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
    continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/resources/testng.properties?rev=915623&r1=915622&r2=915623&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/resources/testng.properties
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/resources/testng.properties
Wed Feb 24 00:44:02 2010
@@ -48,6 +48,12 @@
 M2_SAME_LETTER_PROJ_GRP_DESCRIPTION=
 M2_SAME_LETTER_PROJ_GRP_SCM_ROOT_URL=scm:svn:http://svn.apache.org/repos/asf/continuum/sandbox/flat-example/flat-parent
 
+# Properties for testBuildMaven2ProjectWithTag
+M2_PROJ_WITH_TAG_POM_URL=https://svn.apache.org/repos/asf/continuum/sandbox/examples/continuum-2437-example/pom.xml
+M2_PROJ_WITH_TAG_PROJ_GRP_NAME=Continuum 2437 Example Project
+M2_PROJ_WITH_TAG_PROJ_GRP_ID=corg.apache.continuum.examples
+
+
 ########################
 # mavenOneProject group 
 ########################
@@ -271,10 +277,10 @@
 ########################
 # buildAgents group 
 ########################
+BUILD_AGENT_NAME2=http://localhost:9595/continuum-buildagent/xmlrpc
+BUILD_AGENT_DESCRIPTION2=Agent_description2
 BUILD_AGENT_NAME =Agent_url_name
 BUILD_AGENT_DESCRIPTION =Agent_description
-BUILD_AGENT_NAME2 =Second_Agent
-BUILD_AGENT_DESCRIPTION2 =Agent_description2
 BUILD_AGENT_NAME3 =Third_Agent
 BUILD_AGENT_DESCRIPTION3 =Agent_description3
 BUILD_AGENT_GROUPNAME =agent_groupname

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java?rev=915623&r1=915622&r2=915623&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
Wed Feb 24 00:44:02 2010
@@ -24,7 +24,7 @@
 import org.apache.continuum.web.test.parent.AbstractBuildAgentsTest;
 
 
-@Test( groups = { "agent" }, dependsOnMethods = { "testDeleteBuildDefinitionTemplate" } )
+@Test( groups = { "agent" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )//dependsOnMethods
= { "testDeleteBuildDefinitionTemplate" } )
 public class BuildAgentsTest
     extends AbstractBuildAgentsTest
 {
@@ -40,11 +40,11 @@
 
 		enableDistributedBuilds();
         goToAddBuildAgent();
-        addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true );
+        addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true, false );
         goToAddBuildAgent();
-        addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true );
+        addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true, true );
         goToAddBuildAgent();
-        addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true );
+        addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true, false );
         disableDistributedBuilds();
 	}
 
@@ -56,7 +56,7 @@
 
 		enableDistributedBuilds();
 		goToAddBuildAgent();
-		addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false ) ;
+		addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false, false ) ;
         assertTextPresent( "Build agent already exists" );
         disableDistributedBuilds();
     }
@@ -96,7 +96,7 @@
 
     	enableDistributedBuilds();
     	goToAddBuildAgent();
-		addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false ) ;
+		addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false, false ) ;
 		assertTextPresent( "Build agent url is required." );
 		disableDistributedBuilds();
     }
@@ -107,10 +107,13 @@
     public void testAddBuildAgentGroup()
     throws Exception
     {
+        String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+        String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
     	String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
     	enableDistributedBuilds();
     	goToAddBuildAgentGroup();
-		addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Agent_url_name", "Second_Agent"
}, new String[] {}, true );
+		addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME, BUILD_AGENT_NAME2
}, new String[] {}, true );
 		disableDistributedBuilds();
 	}
 
@@ -118,14 +121,17 @@
     public void testEditBuildAgentGroup()
         throws Exception
     {
+	    String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+	    String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
     	String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
         String newName = "new_agentgroupname";
         enableDistributedBuilds();
-        goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Agent_url_name",
"Second_Agent" } );
+        goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME,
BUILD_AGENT_NAME2 } );
         addEditBuildAgentGroup( newName, new String[] {},
-                         new String[] { "Second_Agent" }, true );
-        goToEditBuildAgentGroup( newName, new String[] { "Agent_url_name" } );
-        addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Second_Agent" },
+                         new String[] { BUILD_AGENT_NAME2 }, true );
+        goToEditBuildAgentGroup( newName, new String[] { BUILD_AGENT_NAME } );
+        addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2 },
                          new String[] {}, true );
         disableDistributedBuilds();
     }
@@ -134,11 +140,13 @@
     public void testAddAnExistingBuildAgentGroup()
     throws Exception
     {
+	    String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+	    String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
         String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
 
         enableDistributedBuilds();
     	goToAddBuildAgentGroup();
-	   	addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Agent_url_name", "Second_Agent"
}, new String[] {}, false );
+	   	addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME, BUILD_AGENT_NAME2
}, new String[] {}, false );
 	   	assertTextPresent( "Build agent group already exists." );
 	   	disableDistributedBuilds();
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java?rev=915623&r1=915622&r2=915623&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
Wed Feb 24 00:44:02 2010
@@ -273,6 +273,51 @@
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
 
+    public void testBuildMaven2ProjectWithTag()
+        throws Exception
+    {
+        String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
+        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
+        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
+        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
+        String M2_PROJ_GRP_DESCRIPTION = "";
+
+        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
+
+        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME
);
+
+        removeProjectGroup( M2_PROJ_GRP_NAME );
+        assertLinkNotPresent( M2_PROJ_GRP_NAME );
+    }
+
+    @Test( dependsOnMethods = { "testAddBuildAgent" } )
+    public void testBuildMaven2ProjectWithTagDistributedBuild()
+        throws Exception
+    {
+        String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
+        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
+        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
+        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
+        String M2_PROJ_GRP_DESCRIPTION = "";
+
+        enableDistributedBuilds();
+
+        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
+
+        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME
);
+
+        removeProjectGroup( M2_PROJ_GRP_NAME );
+        assertLinkNotPresent( M2_PROJ_GRP_NAME );
+
+        disableDistributedBuilds();
+    }
+
     private void addMaven2Project( String groupName )
         throws Exception
     {

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java?rev=915623&r1=915622&r2=915623&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
Wed Feb 24 00:44:02 2010
@@ -25,48 +25,12 @@
 public abstract class AbstractBuildAgentsTest
     extends AbstractContinuumTest
 {
-    public void enableDistributedBuilds()
-    {
-		ConfigurationTest config = new ConfigurationTest();
-	    config.goToConfigurationPage();
-        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
-        if ( !isChecked( "configuration_distributedBuildEnabled" ) )
-        {
-            checkField( "configuration_distributedBuildEnabled" );
-        }
-        clickAndWait( "configuration_" );
-        assertTextPresent( "true" );
-        assertTextPresent( "Distributed Builds" );
-        assertElementPresent( "link=Build Agents" );
-    }
-
-    public void disableDistributedBuilds()
-    {
-        ConfigurationTest config = new ConfigurationTest();
-        config.goToConfigurationPage();
-        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
-        if ( isChecked( "configuration_distributedBuildEnabled" ) )
-        {
-            uncheckField( "configuration_distributedBuildEnabled" );
-        }
-        submit();
-        assertTextPresent( "false" );
-        assertElementNotPresent( "link=Build Agents" );
-    }
-
-	public void goToBuildAgentPage()
-    {
-		clickAndWait("link=Build Agents");
-		assertPage("Continuum - Build Agents");
-	}
-
-	public void assertBuildAgentPage()
+    public void assertBuildAgentPage()
     {
 		assertPage("Continuum - Build Agents");
 		assertTextPresent("Build Agents");
 		assertTextPresent("Build Agent Groups");
 		assertButtonWithValuePresent( "Add" );
-
     }
 
 	public void goToAddBuildAgent()
@@ -102,23 +66,29 @@
         assertBuildAgentPage();
     }
 
-	public void addBuildAgent( String agentURL, String description, boolean success )
+	public void addBuildAgent( String agentURL, String description, boolean success, boolean
enabled )
 	{
 		setFieldValue( "saveBuildAgent_buildAgent_url", agentURL );
 	    setFieldValue("saveBuildAgent_buildAgent_description", description );
-	    checkField("saveBuildAgent_buildAgent_enabled");
+	    
+	    if ( enabled )
+	    {
+	        checkField("saveBuildAgent_buildAgent_enabled");
+	    }
+
 		submit();
-	    if ( success )
+
+		if ( success )
 	    {
 	        assertBuildAgentPage();
 	        assertElementPresent( "link=" + agentURL );
-
+	        clickLinkWithText( agentURL );
+	        assertTextPresent( new Boolean( enabled ).toString() );
 	    }
 	    else
 	    {
 	        assertAddEditBuildAgentPage();
 	    }
-
 	}
 
 	public void goToEditBuildAgent( String name, String description )
@@ -128,7 +98,6 @@
 	   assertAddEditBuildAgentPage();
 	   assertFieldValue( name, "saveBuildAgent_buildAgent_url" );
 	   assertFieldValue( description, "saveBuildAgent_buildAgent_description" );
-
 	}
 
 	public void addEditBuildAgent( String agentName, String newDesc )
@@ -138,16 +107,18 @@
 		submit();
 		assertBuildAgentPage();
 		assertTextPresent( newDesc );
-
 	}
 
 
 	public void goToAddBuildAgentGroup()
     {
+	    String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+	    String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+
 		goToBuildAgentPage();
 		clickAndWait("editBuildAgentGroup_0"); //add button
         String[] options =
-            new String[] { "--- Available Build Agents ---", "Agent_url_name", "Second_Agent"
};
+            new String[] { "--- Available Build Agents ---", BUILD_AGENT_NAME, BUILD_AGENT_NAME2
};
         assertAddEditBuildAgentGroupPage( options, null );
     }
 
@@ -181,8 +152,6 @@
 		{
 			assertAddEditBuildAgentGroupPage( null, null );
 		}
-
-
 	}
 
 	public void assertAddEditBuildAgentGroupPage( String[] availableBuildAgents, String[] usedBuildAgents
)
@@ -227,6 +196,4 @@
         clickButtonWithValue( "Delete" );
         assertBuildAgentPage();
     }
-
-
 }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=915623&r1=915622&r2=915623&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Wed Feb 24 00:44:02 2010
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.web.test.ConfigurationTest;
 import org.testng.Assert;
 
 /**
@@ -373,6 +374,10 @@
         int maxIt = 10;
         showProjectGroup( projectGroupName, groupId, description );
         clickButtonWithValue( "Build all projects" );
+
+        Thread.sleep( 10000 );
+        getSelenium().refresh();
+
         while ( isElementPresent( "//img[@alt='Building']" ) || isElementPresent( "//img[@alt='Updating']"
) )
         {
             Thread.sleep( 10000 );
@@ -384,6 +389,7 @@
             }
             currentIt++;
         }
+
         Thread.sleep( 10000 );
         clickLinkWithText( projectName );
         clickLinkWithText( "Builds" );
@@ -972,4 +978,43 @@
         assertTextPresent( "Default Maven 2 Build Definition" );
         assertTextPresent( "Default Shell Build Definition" );
     }
+
+    // ////////////////////////////////////
+    // DISTRIBUTED BUILD
+    // ////////////////////////////////////
+
+    public void enableDistributedBuilds()
+    {
+        ConfigurationTest config = new ConfigurationTest();
+        config.goToConfigurationPage();
+        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+        if ( !isChecked( "configuration_distributedBuildEnabled" ) )
+        {
+            checkField( "configuration_distributedBuildEnabled" );
+        }
+        clickAndWait( "configuration_" );
+        assertTextPresent( "true" );
+        assertTextPresent( "Distributed Builds" );
+        assertElementPresent( "link=Build Agents" );
+    }
+
+    public void disableDistributedBuilds()
+    {
+        ConfigurationTest config = new ConfigurationTest();
+        config.goToConfigurationPage();
+        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+        if ( isChecked( "configuration_distributedBuildEnabled" ) )
+        {
+            uncheckField( "configuration_distributedBuildEnabled" );
+        }
+        submit();
+        assertTextPresent( "false" );
+        assertElementNotPresent( "link=Build Agents" );
+    }
+
+    public void goToBuildAgentPage()
+    {
+        clickAndWait("link=Build Agents");
+        assertPage("Continuum - Build Agents");
+    }
 }



Mime
View raw message