continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbac...@apache.org
Subject svn commit: r795283 - in /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test: QueueTest.java ScheduleTest.java parent/AbstractScheduleTest.java
Date Sat, 18 Jul 2009 00:27:10 GMT
Author: mbaclay
Date: Sat Jul 18 00:27:09 2009
New Revision: 795283

URL: http://svn.apache.org/viewvc?rev=795283&view=rev
Log:
[CONTINUUM-2291] Fix for Selenium tests failures on Build Queues added to Schedule

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java

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=795283&r1=795282&r2=795283&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
Sat Jul 18 00:27:09 2009
@@ -80,8 +80,7 @@
       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().addSelection("saveSchedule_availableBuildQueuesIds", "label="+BUILD_QUEUE_NAME);
 	  getSelenium().click("//input[@value='->']");
 	  submit();
 

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java?rev=795283&r1=795282&r2=795283&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
Sat Jul 18 00:27:09 2009
@@ -30,6 +30,27 @@
 public class ScheduleTest
     extends AbstractScheduleTest
 {
+    public void testAddScheduleNoBuildQueueToBeUsed()
+    {
+        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" );
+        goToAddSchedule();
+        addEditSchedule( 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, false, false
);
+	assertTextPresent( "Used Build Queues cannot be empty" );
+    }
+
+    @Test( dependsOnMethods = { "testAddScheduleNoBuildQueueToBeUsed" } )
     public void testAddSchedule()
     {
         String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
@@ -46,13 +67,13 @@
         goToAddSchedule();
         addEditSchedule( 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, true );
+                         SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true, true
);
     }
 
     public void testAddInvalidSchedule()
     {
         goToAddSchedule();
-        addEditSchedule( "", "", "", "", "", "", "", "", "", "", "", false );
+        addEditSchedule( "", "", "", "", "", "", "", "", "", "", "", true, false );
         assertTextPresent( "Invalid cron expression value(s)" );
         assertTextPresent( "Name is required and cannot contain spaces only" );
         assertTextPresent( "Description is required and cannot contain spaces only" );
@@ -75,7 +96,7 @@
         goToAddSchedule();
         addEditSchedule( 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, false );
+                         SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true, false
);
         assertTextPresent( "A Schedule with the same name already exists" );
     }
 
@@ -107,11 +128,11 @@
         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 );
-        addEditSchedule( name, description, second, minute, hour, dayMonth, month, dayWeek,
year, maxTime, period, true );
+        addEditSchedule( name, description, second, minute, hour, dayMonth, month, dayWeek,
year, maxTime, period, false, true );
         goToEditSchedule( name, description, second, minute, hour, dayMonth, month, dayWeek,
year, maxTime, period );
         addEditSchedule( 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, true );
+                         SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, false, true
);
     }
 
     @Test( dependsOnMethods = { "testEditSchedule" } )

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java?rev=795283&r1=795282&r2=795283&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
Sat Jul 18 00:27:09 2009
@@ -84,8 +84,8 @@
         assertTextPresent( "Quiet Period (seconds):" );
         assertElementPresent( "delay" );
         assertTextPresent( "Add Build Queue" );
-        assertElementPresent( "availableBuildQueues" );
-        assertElementPresent( "selectedBuildQueues" );
+        assertElementPresent( "availableBuildQueuesIds" );
+        assertElementPresent( "selectedBuildQueuesIds" );
         assertElementPresent( "active" );
         assertTextPresent( "Enable/Disable the schedule" );
         assertButtonWithValuePresent( "Save" );
@@ -94,20 +94,41 @@
 
     public void addEditSchedule( String name, String description, String second, String minute,
String hour,
                                  String dayMonth, String month, String dayWeek, String year,
String maxTime,
-                                 String period, boolean success )
+                                 String period, boolean buildQueue, boolean success )
     {
-        setFieldValue( "name", name );
-        setFieldValue( "description", description );
-        setFieldValue( "second", second );
-        setFieldValue( "minute", minute );
-        setFieldValue( "hour", hour );
-        setFieldValue( "dayOfMonth", dayMonth );
-        setFieldValue( "month", month );
-        setFieldValue( "dayOfWeek", dayWeek );
-        setFieldValue( "year", year );
-        setFieldValue( "maxJobExecutionTime", maxTime );
-        setFieldValue( "delay", period );
-        submit();
+	if ( buildQueue ) 
+	{
+	        setFieldValue( "name", name );
+		setFieldValue( "description", description );
+		setFieldValue( "second", second );
+		setFieldValue( "minute", minute );
+		setFieldValue( "hour", hour );
+		setFieldValue( "dayOfMonth", dayMonth );
+		setFieldValue( "month", month );
+		setFieldValue( "dayOfWeek", dayWeek );
+		setFieldValue( "year", year );
+		setFieldValue( "maxJobExecutionTime", maxTime );
+		setFieldValue( "delay", period );
+		getSelenium().addSelection("saveSchedule_availableBuildQueuesIds", "label=DEFAULT_BUILD_QUEUE");
+		getSelenium().click("//input[@value='->']");
+		submit();
+	}
+	else
+	{
+		setFieldValue( "name", name );
+		setFieldValue( "description", description );
+		setFieldValue( "second", second );
+		setFieldValue( "minute", minute );
+		setFieldValue( "hour", hour );
+		setFieldValue( "dayOfMonth", dayMonth );
+		setFieldValue( "month", month );
+		setFieldValue( "dayOfWeek", dayWeek );
+		setFieldValue( "year", year );
+		setFieldValue( "maxJobExecutionTime", maxTime );
+		setFieldValue( "delay", period );
+		submit();
+	}
+
         if ( success )
         {
             assertSchedulePage();



Mime
View raw message