continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r786635 - in /continuum/trunk/continuum-webapp-test/src/test: resources/testng.properties testng/config/testng.xml testng/org/apache/continuum/web/test/QueueTest.java
Date Fri, 19 Jun 2009 19:27:28 GMT
Author: wsmoak
Date: Fri Jun 19 19:27:27 2009
New Revision: 786635

URL: http://svn.apache.org/viewvc?rev=786635&view=rev
Log:
[CONTINUUM-2271] Add tests for build agents and improve build queue tests
Submitted by: Tin Pardo

Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java

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=786635&r1=786634&r2=786635&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Fri Jun 19
19:27:27 2009
@@ -234,3 +234,14 @@
 # Project User
 PROJECTUSER_DEFAULTPROJECTGROUP_USERNAME=projectuser
 PROJECTUSER_DEFAULTPROJECTGROUP_FULLNAME=Project User - Default Project Group
+
+########################
+# buildAgents group 
+########################
+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/trunk/continuum-webapp-test/src/test/testng/config/testng.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml?rev=786635&r1=786634&r2=786635&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml Fri Jun 19 19:27:27
2009
@@ -55,6 +55,7 @@
 				<include name="buildEnvironment" />
 				<include name="buildDefinitionTemplate" />
 				<include name="userroles"/>
+				<include name="agent"/>
 			</run>
 		</groups>
 		<packages>

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java?rev=786635&r1=786634&r2=786635&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
Fri Jun 19 19:27:27 2009
@@ -21,6 +21,8 @@
 
 import org.apache.continuum.web.test.parent.AbstractBuildQueueTest;
 import org.testng.annotations.Test;
+import org.apache.continuum.web.test.ScheduleTest;
+
 
 /**
  * @author José Morales Martínez
@@ -32,15 +34,61 @@
     public class QueueTest
         extends AbstractBuildQueueTest
     {
-
+    
 	public void testAddBuildQueue()
     {
         setMaxBuildQueue( 2 );
         String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
         addBuildQueue( BUILD_QUEUE_NAME, true );
     }
-
-    @Test( dependsOnMethods = { "testAddBuildQueue" } )
+	
+	@Test( dependsOnMethods = { "testAddBuildQueue" } ) //"testDeleteBuildQueue" } )
+    public void testQueuePageWithoutBuild()
+    {
+        clickAndWait( "link=Queues"  );
+        assertPage( "Continuum - Build Queue" );
+        assertTextPresent( "Nothing is building" );
+        assertTextNotPresent( "Project Name* Build Definition" );
+        assertTextPresent( "Current Build" );
+	    assertTextPresent( "Build Queue" );
+	    assertTextPresent( "Current Checkout" );
+	    assertTextPresent( "Checkout Queue " );
+	    assertTextPresent( "Current Prepare Build" );
+	    assertTextPresent( "Prepare Build Queue" );
+       
+    }    
+	
+	@Test( dependsOnMethods = { "testAddBuildQueue", "testAddSchedule" } )
+    public void testAddBuildQueueToSchedule()
+  {
+	    ScheduleTest sched = new ScheduleTest();
+	  
+	    String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
+        String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
+        String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
+        String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
+        String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
+        String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+        String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
+        String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+        String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
+        String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
+        String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
+        
+        String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
+        
+     		  
+      sched.goToEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND,
SCHEDULE_EXPR_MINUTE,
+              SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
+              SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD );	
+	  getSelenium().removeSelection("saveSchedule_availableBuildQueues", "label=DEFAULT_BUILD_QUEUE");
+	  getSelenium().addSelection("saveSchedule_availableBuildQueues", "label="+BUILD_QUEUE_NAME);
+	  getSelenium().click("//input[@value='->']");
+	  submit();
+      
+  }
+	
+	@Test( dependsOnMethods = { "testAddBuildQueue" } )
     public void testAddNotAllowedBuildQueue()
     {
         setMaxBuildQueue( 1 );
@@ -57,8 +105,8 @@
         addBuildQueue( BUILD_QUEUE_NAME, false );
         assertTextPresent( "Build queue name already exists." );
     }
-
-    //@Test( dependsOnMethods = { "testAddAlreadyExistBuildQueue" } )
+    
+    @Test( dependsOnMethods = { "testAddAlreadyExistBuildQueue" } )
     public void testAddEmptyBuildQueue()
     {
         setMaxBuildQueue( 3 );
@@ -66,7 +114,7 @@
         assertTextPresent( "You must define a name" );
     }
 
-    @Test( dependsOnMethods = { "testAddBuildQueue", "testAddAlreadyExistBuildQueue" } )
+    @Test( dependsOnMethods = { "testAddBuildQueueToSchedule" } ) 
     public void testDeleteBuildQueue()
     {
         goToBuildQueuePage();
@@ -74,18 +122,18 @@
         removeBuildQueue( BUILD_QUEUE_NAME );
         assertTextNotPresent( BUILD_QUEUE_NAME );
     }
-
-
+    
+       
     @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
     public void testQueuePageWithProjectCurrentlyBuilding()
         throws Exception
-    {
+    {   
     	//build a project
         String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
         String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
         String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
         buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION,
M2_PROJ_GRP_NAME );
-
+        
         //check queue page while building
     	clickAndWait( "link=Queues" );
 	    assertPage( "Continuum - Build Queue" );
@@ -103,21 +151,5 @@
 	    waitForElementPresent( "//img[@alt='Success']" );
 	    Thread.sleep( 10000 );
     }
-
-    //@Test( dependsOnMethods = { "testDeleteBuildQueue" } )
-    public void testQueuePageWithoutBuild()
-    {
-        clickAndWait( "link=Queues"  );
-        assertPage( "Continuum - Build Queue" );
-        assertTextPresent( "Nothing is building" );
-        assertTextNotPresent( "Project Name* Build Definition" );
-        assertTextPresent( "Current Build" );
-	    assertTextPresent( "Build Queue" );
-	    assertTextPresent( "Current Checkout" );
-	    assertTextPresent( "Checkout Queue " );
-	    assertTextPresent( "Current Prepare Build" );
-	    assertTextPresent( "Prepare Build Queue" );
-
-    }
-
-}
+    
+ }



Mime
View raw message