continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r474396 - in /maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test: AddMavenOneProjectTestCase.java AddMavenTwoProjectTestCase.java AntTest.java SchedulesPageTest.java
Date Mon, 13 Nov 2006 17:06:29 GMT
Author: evenisse
Date: Mon Nov 13 09:06:28 2006
New Revision: 474396

URL: http://svn.apache.org/viewvc?view=rev&rev=474396
Log:
Format

Modified:
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java?view=diff&rev=474396&r1=474395&r2=474396
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
Mon Nov 13 09:06:28 2006
@@ -16,11 +16,6 @@
  * limitations under the License.
  */
 
-import org.codehaus.plexus.util.cli.Commandline;
-import org.codehaus.plexus.util.cli.CommandLineUtils;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.DefaultConsumer;
-
 import java.io.File;
 
 /**
@@ -61,7 +56,7 @@
         getSelenium().click( "//input[@type='submit']" );
         waitPage();
 
-        if( validPom )
+        if ( validPom )
         {
             assertPage( "Continuum - Group Summary" );
             assertTextPresent( "Project Groups" );
@@ -74,7 +69,7 @@
     /**
      * test with valid pom file
      */
-   /* public void testValidPomFile()
+    /* public void testValidPomFile()
     {
         File pomFile = new File( getBasedir(), "src/test/resources/unit/valid-maven-project/project.xml");
         submitAddMavenOneProjectPage( "", pomFile.getAbsolutePath(), false );
@@ -86,7 +81,7 @@
      */
     public void testValidPomUrl()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/valid-project.xml");
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/valid-project.xml"
);
         submitAddMavenOneProjectPage( "file:/" + pomFile.getAbsolutePath(), "", true );
         assertTextPresent( "Maven One Project" );
     }
@@ -107,18 +102,20 @@
      */
     public void testMissingElementInPom()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml");
+        File pomFile = new File( getBasedir(),
+                                 "src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml"
);
         submitAddMavenOneProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "Missing repository element in the POM." );
     }
 
-    
+
     /**
      * test with <extend> element present in pom file
      */
     public void testWithExtendElementPom()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/extend-element-project.xml");
+        File pomFile =
+            new File( getBasedir(), "src/test/resources/unit/maven-one-projects/extend-element-project.xml"
);
         submitAddMavenOneProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "Cannot use a POM with an extend element." );
     }
@@ -128,7 +125,8 @@
      */
     public void testUnparseableXmlContent()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/unparseable-content-project.xml");
+        File pomFile =
+            new File( getBasedir(), "src/test/resources/unit/maven-one-projects/unparseable-content-project.xml"
);
         submitAddMavenOneProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "The XML content of the POM can not be parsed." );
     }
@@ -138,7 +136,7 @@
      */
     public void testMalformedPomUrl()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/valid-project.xml");
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/valid-project.xml"
);
         submitAddMavenOneProjectPage( pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "The URL provided is malformed." );
     }
@@ -148,7 +146,7 @@
      */
     public void testInaccessiblePomUrl()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/valid-project.xml");
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-one-projects/valid-project.xml"
);
         submitAddMavenOneProjectPage( "file://" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "The specified host is either unknown or inaccessible." );
     }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java?view=diff&rev=474396&r1=474395&r2=474396
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
Mon Nov 13 09:06:28 2006
@@ -44,7 +44,7 @@
         getSelenium().click( "//input[@type='submit']" );
         waitPage();
 
-        if( validPom )
+        if ( validPom )
         {
             assertPage( "Continuum - Group Summary" );
             assertTextPresent( "Project Groups" );
@@ -57,17 +57,18 @@
      */
     public void testMultiModuleProject()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/multi-module-maven-project/pom.xml");
-        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", true);
+        File pomFile =
+            new File( getBasedir(), "src/test/resources/unit/maven-two-projects/multi-module-maven-project/pom.xml"
);
+        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", true );
         assertTextPresent( "Maven Two Multi-Module Project" );
         assertTextPresent( "maven.two.multi.module.project" );
 
         clickLinkWithText( "Maven Two Multi-Module Project" );
-        assertTextPresent( "Summary");
-        assertTextPresent( "Summary");
-        assertTextPresent( "Maven Two Multi-Module Project");
-        assertTextPresent( "Maven Two Multi-Module Project Module 1");
-        assertTextPresent( "Maven Two Multi-Module Project Module 2");
+        assertTextPresent( "Summary" );
+        assertTextPresent( "Summary" );
+        assertTextPresent( "Maven Two Multi-Module Project" );
+        assertTextPresent( "Maven Two Multi-Module Project Module 1" );
+        assertTextPresent( "Maven Two Multi-Module Project Module 2" );
     }
 
     /**
@@ -86,7 +87,8 @@
      */
     public void testMissingScmElementPom()
     {
-        File pomFile= new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml");
+        File pomFile =
+            new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml"
);
         submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "Missing scm element in the POM." );
         assertElementPresent( "m2PomUrl" );
@@ -98,9 +100,10 @@
      */
     public void testCannotAccessResource()
     {
-        File pomFile= new File( getBasedir(), "src/test/resources/unit/maven-two-projects/valid-pom.xml");
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/valid-pom.xml"
);
         submitAddMavenTwoProjectPage( "file://" + pomFile.getAbsolutePath(), "", false );
-        assertTextPresent( "The specified resource cannot be accessed. Please try again later
or contact your administrator." );
+        assertTextPresent(
+            "The specified resource cannot be accessed. Please try again later or contact
your administrator." );
         assertElementPresent( "m2PomUrl" );
         assertElementPresent( "m2PomFile" );
     }
@@ -110,21 +113,23 @@
      */
     public void testMissingConnectionElement()
     {
-        File pomFile= new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml");
+        File pomFile =
+            new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml"
);
         submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "Missing connection sub-element in the scm element in the POM."
);
         assertElementPresent( "m2PomUrl" );
         assertElementPresent( "m2PomFile" );
     }
 
-        /**
+    /**
      * Test when the parent pom is missing or not yet added in continuum
      */
     public void testMissingParentPom()
     {
-        File pomFile= new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-parent-pom.xml");
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-parent-pom.xml"
);
         submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
-        assertTextPresent( "Missing artifact trying to build the POM. Check that its parent
POM is available or add it first in Continuum." );
+        assertTextPresent(
+            "Missing artifact trying to build the POM. Check that its parent POM is available
or add it first in Continuum." );
         assertElementPresent( "m2PomUrl" );
         assertElementPresent( "m2PomFile" );
     }
@@ -134,7 +139,8 @@
      */
     public void testNotifiers()
     {
-        File pomFile= new File( getBasedir(), "src/test/resources/unit/maven-two-projects/specified-notifiers-pom.xml");
+        File pomFile =
+            new File( getBasedir(), "src/test/resources/unit/maven-two-projects/specified-notifiers-pom.xml"
);
         submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", true );
         assertTextPresent( "Maven Two Notifiers Project" );
 
@@ -154,20 +160,20 @@
      */
     public void testMissingModules()
     {
-        File pomFile= new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-modules-pom.xml");
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-modules-pom.xml"
);
         submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
         assertTextPresent( "Unknown error trying to build POM." );
         assertElementPresent( "m2PomUrl" );
         assertElementPresent( "m2PomFile" );
     }
-    
+
     /**
      * Test valid pom
      */
     public void testValidPom()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/valid-pom.xml");
-        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", true);
+        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/valid-pom.xml"
);
+        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", true );
         assertTextPresent( "Maven Two Project" );
         assertTextPresent( "maven.two.project" );
     }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java?view=diff&rev=474396&r1=474395&r2=474396
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
Mon Nov 13 09:06:28 2006
@@ -39,12 +39,12 @@
         setFieldValue( "projectName", "Foo" );
         setFieldValue( "projectVersion", "1.0-SNAPSHOT" );
         setFieldValue( "projectScmUrl",
-                            "https://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-test-projects/ant/"
);
+                       "https://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-test-projects/ant/"
);
         clickButtonWithValue( "Add" );
         assertGroupSummaryPage();
         assertTextPresent( "Default Project Group" );
-        clickLinkWithText( "Default Project Group");
-        assertTextPresent( "Foo");
+        clickLinkWithText( "Default Project Group" );
+        assertTextPresent( "Foo" );
 
         //TODO Add more tests (values in Default Project Group, values in project view, notifiers,
build defintions, delete, build,...)
     }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java?view=diff&rev=474396&r1=474395&r2=474396
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
Mon Nov 13 09:06:28 2006
@@ -17,320 +17,319 @@
  */
 
 
-import java.util.HashMap;
-
 import org.apache.maven.shared.web.test.XPathExpressionUtil;
 
+import java.util.HashMap;
+
 /**
- * 
- * 
+ *
+ *
  *
  */
 public class SchedulesPageTest
-    extends AbstractAuthenticatedAccessTestCase   
-{     
+    extends AbstractAuthenticatedAccessTestCase
+{
     // Add Edit Page fields
     final public static String FIELD_NAME = "name";
-    
+
     final public static String FIELD_DESCRIPTION = "description";
-    
+
     final public static String FIELD_SECOND = "second";
-    
+
     final public static String FIELD_MINUTE = "minute";
-    
+
     final public static String FIELD_HOUR = "hour";
-    
+
     final public static String FIELD_DAYOFMONTH = "dayOfMonth";
-    
+
     final public static String FIELD_MONTH = "month";
-    
+
     final public static String FIELD_DAYOFWEEK = "dayOfWeek";
-    
+
     final public static String FIELD_YEAR = "year";
-    
+
     final public static String FIELD_MAXJOBEXECUTIONTIME = "maxJobExecutionTime";
-    
+
     final public static String FIELD_DELAY = "delay";
-    
-    
+
+
     // field values
     final public static String SCHEDULES_PAGE_TITLE = "Continuum - Schedules";
-    
+
     final public static String DEFAULT_SCHEDULE = "DEFAULT_SCHEDULE";
-    
+
     final public static String DEFAULT_SCHEDULE_DESCRIPTION = "Run hourly";
-    
+
     final public static String DEFAULT_CRONVALUE = "0 0 * * * ?";
-    
+
     final public static String DEFAULT_DELAY = "0";
-    
+
     final public static String DEFAULT_MAXJOBEXECUTIONTIME = "0";
-        
+
     final public static String EDIT_SCHEDULE_PAGE_TITLE = "Continuum - Edit Schedule";
-    
+
     final public static String SCHEDULE_NAME = "Test Schedule";
-        
+
     final public static String SCHEDULE_NAME_EDIT = "Test Schedule Edit";
-    
+
     final public static String SCHEDULE_DESCRIPTION = "Test Description";
-    
+
     final public static String SECOND = "1";
-    
+
     final public static String MINUTE = "2";
-    
+
     final public static String HOUR = "3";
-    
+
     final public static String DAYOFMONTH = "?";
-    
+
     final public static String MONTH = "4";
-    
+
     final public static String DAYOFWEEK = "5";
-    
+
     final public static String YEAR = "2020";
-    
+
     final public static String MAXJOBEXECUTIONTIME = "6";
-    
-    final public static String DELAY = "7";         
-        
+
+    final public static String DELAY = "7";
+
     public void setUp()
         throws Exception
     {
-        super.setUp();        
-                
-        clickLinkWithText( "Schedules" );        
+        super.setUp();
+
+        clickLinkWithText( "Schedules" );
     }
-    
+
     public String getUsername()
     {
-        return this.adminUsername;        
+        return this.adminUsername;
     }
-    
+
     public String getPassword()
     {
         return this.adminPassword;
     }
-    
+
     public void testInitialSchedulesPage()
         throws Exception
-    {       
-        assertInitialSchedulesPage();     
+    {
+        assertInitialSchedulesPage();
     }
-    
+
     public void testBasicScheduleAddAndDelete()
         throws Exception
-    {   
+    {
         // add schedule
         clickButtonWithValue( "Add" );
-        
-        inputSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, 
-                       SECOND, MINUTE, HOUR, DAYOFMONTH, MONTH, DAYOFWEEK, YEAR, 
+
+        inputSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SECOND, MINUTE, HOUR, DAYOFMONTH,
MONTH, DAYOFWEEK, YEAR,
                        MAXJOBEXECUTIONTIME, DELAY, true );
-        
-        String cronSchedule = SECOND;         
-        cronSchedule += " " + MINUTE; 
+
+        String cronSchedule = SECOND;
+        cronSchedule += " " + MINUTE;
         cronSchedule += " " + HOUR;
-        cronSchedule += " " + DAYOFMONTH;  
-        cronSchedule += " " + MONTH; 
+        cronSchedule += " " + DAYOFMONTH;
+        cronSchedule += " " + MONTH;
         cronSchedule += " " + DAYOFWEEK;
         cronSchedule += " " + YEAR;
-        
-        String[] columnValues = { SCHEDULE_NAME, SCHEDULE_DESCRIPTION, DELAY, cronSchedule,

-                                  MAXJOBEXECUTIONTIME };
-        
-        assertTrue( "Can not add schedule" , 
+
+        String[] columnValues = {SCHEDULE_NAME, SCHEDULE_DESCRIPTION, DELAY, cronSchedule,
MAXJOBEXECUTIONTIME};
+
+        assertTrue( "Can not add schedule",
                     getSelenium().isElementPresent( XPathExpressionUtil.matchTableRowOrderedValues(
columnValues ) ) );
-        
+
         // delete schedule after adding
         deleteSchedule( SCHEDULE_NAME );
-        
+
         assertDefaultSchedule();
-        
+
         assertFalse( "Can not delete schedule",
-                     getSelenium().isElementPresent( XPathExpressionUtil.matchTableRowOrderedValues(
columnValues ) ) );                
-    }    
-    
+                     getSelenium().isElementPresent( XPathExpressionUtil.matchTableRowOrderedValues(
columnValues ) ) );
+    }
+
     public void testEditSchedule()
         throws Exception
-    {    
+    {
         clickButtonWithValue( "Add" );
-        
-        inputSchedule( SCHEDULE_NAME_EDIT, SCHEDULE_DESCRIPTION, 
-                       SECOND, MINUTE, HOUR, DAYOFMONTH, MONTH, DAYOFWEEK, YEAR, 
-                       MAXJOBEXECUTIONTIME, DELAY, true );
 
-        String cronSchedule = SECOND;         
-        cronSchedule += " " + MINUTE; 
+        inputSchedule( SCHEDULE_NAME_EDIT, SCHEDULE_DESCRIPTION, SECOND, MINUTE, HOUR, DAYOFMONTH,
MONTH, DAYOFWEEK,
+                       YEAR, MAXJOBEXECUTIONTIME, DELAY, true );
+
+        String cronSchedule = SECOND;
+        cronSchedule += " " + MINUTE;
         cronSchedule += " " + HOUR;
-        cronSchedule += " " + DAYOFMONTH;  
-        cronSchedule += " " + MONTH; 
+        cronSchedule += " " + DAYOFMONTH;
+        cronSchedule += " " + MONTH;
         cronSchedule += " " + DAYOFWEEK;
         cronSchedule += " " + YEAR;
-        
-        String[] columnValues = { SCHEDULE_NAME, SCHEDULE_DESCRIPTION, DELAY, cronSchedule,
MAXJOBEXECUTIONTIME };
+
+        String[] columnValues = {SCHEDULE_NAME, SCHEDULE_DESCRIPTION, DELAY, cronSchedule,
MAXJOBEXECUTIONTIME};
 
         // edit the schedule        
-        clickLinkWithXPath( XPathExpressionUtil.columnElementWithSiblingColumnValues( XPathExpressionUtil.ANCHOR,

-                                                                                      5,
"Edit", columnValues) );
-        
-        inputSchedule( SCHEDULE_NAME_EDIT + "modified", SCHEDULE_DESCRIPTION + "updated",

-                       "2", "3", "4", "?", "6", "7", "2021", 
-                       "8", "9", false );
-        
+        clickLinkWithXPath( XPathExpressionUtil.columnElementWithSiblingColumnValues( XPathExpressionUtil.ANCHOR,
5,
+                                                                                      "Edit",
columnValues ) );
+
+        inputSchedule( SCHEDULE_NAME_EDIT + "modified", SCHEDULE_DESCRIPTION + "updated",
"2", "3", "4", "?", "6", "7",
+                       "2021", "8", "9", false );
+
         // after we save the schedule we should be brought back to the schedules page
         assertPage( SCHEDULES_PAGE_TITLE );
-        
+
         assertDefaultSchedule();
-        
-        cronSchedule = "2 3 4 ? 6 7 2021";         
-        
-        String[] editedColumnValues = { SCHEDULE_NAME_EDIT + "modified", SCHEDULE_DESCRIPTION
+ "updated", "9", cronSchedule, "8" };
-        
-        assertTrue( "Can not edit schedule" , 
-                    getSelenium().isElementPresent( XPathExpressionUtil.matchTableRowOrderedValues(
editedColumnValues ) ) );
-                                
+
+        cronSchedule = "2 3 4 ? 6 7 2021";
+
+        String[] editedColumnValues =
+            {SCHEDULE_NAME_EDIT + "modified", SCHEDULE_DESCRIPTION + "updated", "9", cronSchedule,
"8"};
+
+        assertTrue( "Can not edit schedule", getSelenium().isElementPresent(
+            XPathExpressionUtil.matchTableRowOrderedValues( editedColumnValues ) ) );
+
         // check if the active state has been saved
-        clickLinkWithXPath( XPathExpressionUtil.columnElementWithSiblingColumnValues( XPathExpressionUtil.ANCHOR,

-                                                                                      5,
"Edit", editedColumnValues) );
-        
+        clickLinkWithXPath( XPathExpressionUtil.columnElementWithSiblingColumnValues( XPathExpressionUtil.ANCHOR,
5,
+                                                                                      "Edit",
editedColumnValues ) );
+
         assertEquals( "Can disable the schedule", CHECKBOX_UNCHECK, getFieldValue( "active"
) );
 
         //house keeping
-        clickLinkWithText( "Schedules" );                
+        clickLinkWithText( "Schedules" );
         deleteSchedule( SCHEDULE_NAME_EDIT + "modified" );
     }
-        
+
     public void testScheduleAddEditPageInputValidation()
     {
         clickButtonWithValue( "Add" );
-        
+
         HashMap fields = new HashMap();
         boolean valid = false;
         boolean wait = false;
-        
+
         // test saving without editing anything from the initial edit page
         inputSchedule( fields, wait, valid );
-               
+
         assertEditSchedulePage();
-        
-        assertTrue( "Name field not validated", getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
-        assertTrue( "Description field not validated", getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']"
) );
-                
+
+        assertTrue( "Name field not validated",
+                    getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
+        assertTrue( "Description field not validated",
+                    getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']"
) );
+
         // go back to the schedules page
         clickLinkWithText( "Schedules" );
-        
+
         // start new schedule add session
         clickButtonWithValue( "Add" );
-        
+
         // test saving using alpha characters for the maxjobexecution and delay
         // with valid name and description  
         fields.put( FIELD_NAME, SCHEDULE_NAME );
         fields.put( FIELD_DESCRIPTION, SCHEDULE_DESCRIPTION );
         fields.put( FIELD_MAXJOBEXECUTIONTIME, "abcde" );
         fields.put( FIELD_DELAY, "abcde" );
-                
+
         inputSchedule( fields, wait, valid );
 
-        assertFalse( "Name field improperly validated", getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
-        assertFalse( "Description field improperly validated", getSelenium().isElementPresent(
"//tr/td[span='schedule.name.required']" ) );
+        assertFalse( "Name field improperly validated",
+                     getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
+        assertFalse( "Description field improperly validated",
+                     getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
         assertTrue( "MaxJobExecutionTime not validated", isTextPresent( "schedule.maxJobExecutionTime.invalid"
) );
-        assertTrue( "Delay not validated", isTextPresent( "schedule.delay.invalid" ) ); 

-        
+        assertTrue( "Delay not validated", isTextPresent( "schedule.delay.invalid" ) );
+
         assertEditSchedulePage();
     }
-    
-    
+
+
     public void assertInitialSchedulesPage()
     {
         assertPage( SCHEDULES_PAGE_TITLE );
-        
-        assertDefaultSchedule();        
+
+        assertDefaultSchedule();
     }
-    
+
     public void assertDefaultSchedule()
-    {        
-        String[] columnValues = { DEFAULT_SCHEDULE, DEFAULT_SCHEDULE_DESCRIPTION, DEFAULT_DELAY,
DEFAULT_CRONVALUE,
-                                  DEFAULT_MAXJOBEXECUTIONTIME };
-                    
-        assertTrue( "Default schedule not found" , 
+    {
+        String[] columnValues = {DEFAULT_SCHEDULE, DEFAULT_SCHEDULE_DESCRIPTION, DEFAULT_DELAY,
DEFAULT_CRONVALUE,
+            DEFAULT_MAXJOBEXECUTIONTIME};
+
+        assertTrue( "Default schedule not found",
                     getSelenium().isElementPresent( XPathExpressionUtil.matchTableRowOrderedValues(
columnValues ) ) );
     }
-    
+
     public void assertEditSchedulePage()
     {
-        assertPage( EDIT_SCHEDULE_PAGE_TITLE );     
-        
-        assertEditSchedulePageInputFields();        
+        assertPage( EDIT_SCHEDULE_PAGE_TITLE );
+
+        assertEditSchedulePageInputFields();
     }
-                
+
     public void assertEditSchedulePageInputFields()
     {
         assertElementPresent( "saveSchedule_id" );
         assertElementPresent( "id" );
         assertElementPresent( "saveSchedule_name" );
-        assertElementPresent( "name" );        
+        assertElementPresent( "name" );
         assertElementPresent( "saveSchedule_description" );
-        assertElementPresent( "description" );        
+        assertElementPresent( "description" );
         assertElementPresent( "saveSchedule_second" );
         assertElementPresent( "second" );
         assertElementPresent( "saveSchedule_minute" );
-        assertElementPresent( "minute" );        
+        assertElementPresent( "minute" );
         assertElementPresent( "saveSchedule_hour" );
-        assertElementPresent( "hour" );        
+        assertElementPresent( "hour" );
         assertElementPresent( "saveSchedule_dayOfMonth" );
-        assertElementPresent( "dayOfMonth" );        
+        assertElementPresent( "dayOfMonth" );
         assertElementPresent( "saveSchedule_month" );
-        assertElementPresent( "month" );        
+        assertElementPresent( "month" );
         assertElementPresent( "saveSchedule_dayOfWeek" );
-        assertElementPresent( "dayOfWeek" );        
+        assertElementPresent( "dayOfWeek" );
         assertElementPresent( "saveSchedule_year" );
-        assertElementPresent( "year" );        
+        assertElementPresent( "year" );
         assertElementPresent( "saveSchedule_maxJobExecutionTime" );
-        assertElementPresent( "maxJobExecutionTime" );        
+        assertElementPresent( "maxJobExecutionTime" );
         assertElementPresent( "saveSchedule_delay" );
-        assertElementPresent( "delay" );        
+        assertElementPresent( "delay" );
         assertElementPresent( "saveSchedule_active" );
-        assertElementPresent( "active" );        
+        assertElementPresent( "active" );
     }
-    
+
     public void deleteSchedule( String scheduleName )
     {
         // after we save the schedule we should be brought back to the schedules page
-        assertPage( SCHEDULES_PAGE_TITLE );        
-        
-        String[] columnValues = { scheduleName };
-        
-        clickLinkWithXPath( XPathExpressionUtil.columnElementWithSiblingColumnValues( XPathExpressionUtil.ANCHOR,

-                                                                                      5,
"Delete", columnValues ) );
-            
+        assertPage( SCHEDULES_PAGE_TITLE );
+
+        String[] columnValues = {scheduleName};
+
+        clickLinkWithXPath( XPathExpressionUtil.columnElementWithSiblingColumnValues( XPathExpressionUtil.ANCHOR,
5,
+                                                                                      "Delete",
columnValues ) );
+
         // deletion confirmation page
         assertPage( "Schedule Removal" );
-        
+
         clickButtonWithValue( "Delete" );
 
         // after we confirm the deletion we should be brought back to the schedules page
-        assertPage( SCHEDULES_PAGE_TITLE );                
+        assertPage( SCHEDULES_PAGE_TITLE );
     }
-    
 
-    public void inputSchedule( String scheduleName, String scheduleDescription, 
-                               String second, String minute, String hour, 
-                               String dayOfMonth, String month, String dayOfWeek, String
year, 
+
+    public void inputSchedule( String scheduleName, String scheduleDescription, String second,
String minute,
+                               String hour, String dayOfMonth, String month, String dayOfWeek,
String year,
                                String maxJobExecutionTime, String delay, boolean active )
     {
-        inputSchedule( scheduleName, scheduleDescription, second, minute, hour, dayOfMonth,
month,
-                       dayOfWeek, year, maxJobExecutionTime, delay, active, true );
+        inputSchedule( scheduleName, scheduleDescription, second, minute, hour, dayOfMonth,
month, dayOfWeek, year,
+                       maxJobExecutionTime, delay, active, true );
     }
-    
-    
-    public void inputSchedule( String scheduleName, String schedule_description, 
-                               String second, String minute, String hour, 
-                               String dayOfMonth, String month, String dayOfWeek, String
year, 
+
+
+    public void inputSchedule( String scheduleName, String schedule_description, String second,
String minute,
+                               String hour, String dayOfMonth, String month, String dayOfWeek,
String year,
                                String maxJobExecutionTime, String delay, boolean active,
boolean wait )
     {
-        assertEditSchedulePage();      
-        
+        assertEditSchedulePage();
+
         HashMap inputFields = new HashMap();
-        
+
         inputFields.put( "name", scheduleName );
         inputFields.put( "description", schedule_description );
         inputFields.put( "second", second );
@@ -342,26 +341,26 @@
         inputFields.put( "year", year );
         inputFields.put( "maxJobExecutionTime", maxJobExecutionTime );
         inputFields.put( "delay", delay );
-                
+
         if ( !active )
-        {    
+        {
             uncheckField( "active" );
         }
-        
-        inputSchedule( inputFields, wait, true );                
+
+        inputSchedule( inputFields, wait, true );
     }
 
-    public void inputSchedule( HashMap fields )    
+    public void inputSchedule( HashMap fields )
     {
         inputSchedule( fields, true, true );
     }
-    
+
     public void inputSchedule( HashMap fields, boolean wait, boolean valid )
     {
         setFieldValues( fields );
-        
+
         clickButtonWithValue( "Save", wait );
-        
+
         if ( valid )
         {
             // after we save the schedule we should be brought back to the schedules page
       
@@ -372,11 +371,11 @@
             assertEditSchedulePage();
         }
     }
-            
+
     public void tearDown()
-    {    
+    {
         logout();
-        
-        super.tearDown();              
-    }    
+
+        super.tearDown();
+    }
 }



Mime
View raw message