continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r951289 - in /continuum/trunk: continuum-docs/src/site/apt/user_guides/managing_builddef/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/ conti...
Date Fri, 04 Jun 2010 06:00:23 GMT
Author: ctan
Date: Fri Jun  4 06:00:23 2010
New Revision: 951289

URL: http://svn.apache.org/viewvc?rev=951289&view=rev
Log:
[CONTINUUM-2532] 
- set always build to true and disable it when build fresh is checked
- set always build to false and enable it when build fresh is unchecked
- modify build definition selenium test for these changes
- document that checking 'Build Fresh' will always build the project


Modified:
    continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
    continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp

Modified: continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt?rev=951289&r1=951288&r2=951289&view=diff
==============================================================================
--- continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
(original)
+++ continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
Fri Jun  4 06:00:23 2010
@@ -25,7 +25,7 @@ Project Group Build Definition
     * You may have arguments for Maven, such as <<<--batch-mode --non-recursive>>>.
     Add your arguments in the <<Arguments>> text box or leave it empty.
 
-    * Check <<Build Fresh>> to do a fresh checkout from SCM before the build
process.
+    * Check <<Build Fresh>> to do a fresh checkout from SCM before the build
process. <<Build Fresh>> will always build the project.
     Check <<Always Build>> if you want to execute the goal every time you build
the project.
     If you want this build definition to be your default for building your project,
     check the <<Is it default?>> check box.
@@ -43,4 +43,4 @@ Project Group Build Definition
 
 [../../images/add_goal.png]
 
-    [[3]] Click <<Save>>.
\ No newline at end of file
+    [[3]] Click <<Save>>.

Modified: continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt?rev=951289&r1=951288&r2=951289&view=diff
==============================================================================
--- continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
(original)
+++ continuum/trunk/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
Fri Jun  4 06:00:23 2010
@@ -27,7 +27,7 @@ Project Build Definition
     * You may have arguments for Maven, such as <<<--batch-mode --non-recursive>>>.
     Add your arguments in the <<Arguments>> text box or leave it empty.
 
-    * Check <<Build Fresh>> to do a fresh checkout from SCM before the build
process.
+    * Check <<Build Fresh>> to do a fresh checkout from SCM before the build
process. <<BuildFresh>> will always build the project.
     Check <<Always Build>> if you want to execute the goal every time you build
the project.
     If you want this build definition to be your default for building your project,
     check the <<Is it default?>> check box.
@@ -45,4 +45,4 @@ Project Build Definition
 
 [../../images/add_goal.png]
 
-    [[4]] Click <<Save>>.
\ No newline at end of file
+    [[4]] Click <<Save>>.

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java?rev=951289&r1=951288&r2=951289&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
Fri Jun  4 06:00:23 2010
@@ -106,7 +106,7 @@ public class BuildDefinitionTest
         goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION
);
         clickButtonWithValue( "Add" );
         addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
-                                     BUILD_DESCRIPTION, true, true, true );
+                                     BUILD_DESCRIPTION, true, false, true );
     }
 
     @Test( dependsOnMethods = { "testAddProjectGroup2" } )
@@ -148,6 +148,9 @@ public class BuildDefinitionTest
         clickImgWithAlt( "Edit" );
         addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
                                      BUILD_DESCRIPTION, true, true, false );
+        clickImgWithAlt( "Edit" );
+        addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
+                                     BUILD_DESCRIPTION, false, true, false );
     }
 
     @Test( dependsOnMethods = { "testEditGroupBuildDefinition" } )

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=951289&r1=951288&r2=951289&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Fri Jun  4 06:00:23 2010
@@ -484,6 +484,16 @@ public abstract class AbstractContinuumT
         assertElementPresent( "buildDefinitionType" );
         assertTextPresent( "Build Environment" );
         assertElementPresent( "profileId" );
+
+        if ( isChecked( "buildFresh" ) )
+        {
+            assertDisabled( "alwaysBuild" );
+            assertIsChecked( "alwaysBuild" );
+        }
+        else
+        {
+            assertEnabled( "alwaysBuild" );
+        }
     }
 
     public void addEditGroupBuildDefinition(String groupName,String buildFile,String goals,String
arguments,
@@ -499,12 +509,29 @@ public abstract class AbstractContinuumT
 
         if ( buildFresh )
         {
-            checkField( "buildFresh" );
+            if ( isChecked( "buildFresh" ) )
+            {
+                uncheckField( "buildFresh" );
+            }
+
+            // need to do this for the onclick event
+            click( "buildFresh" );
+            assertDisabled( "alwaysBuild" );
+            assertIsChecked( "alwaysBuild" );
         }
         else
         {
-            uncheckField( "buildFresh" );
+            if ( !isChecked( "buildFresh" ) )
+            {
+                checkField( "buildFresh" );
+            }
+
+            // need to do this for the onclick event
+            click( "buildFresh" );
+            assertEnabled( "alwaysBuild" );
+            assertIsNotChecked( "alwaysBuild" );
         }
+
         if ( isElementPresent( "defaultBuildDefinition" ) )
         {
             if ( isDefault )

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=951289&r1=951288&r2=951289&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Fri Jun  4 06:00:23 2010
@@ -411,6 +411,11 @@ public abstract class AbstractSeleniumTe
         Assert.assertFalse( getSelenium().isChecked( locator ) );
     }
 
+    public void click( String locator )
+    {
+        getSelenium().click( locator );
+    }
+
     public void clickAndWait( String locator )
     {
         getSelenium().click( locator );
@@ -464,4 +469,14 @@ public abstract class AbstractSeleniumTe
     {
         getSelenium().waitForCondition( condition, maxProjectWaitTimeInMs );
     }
+
+    public void assertEnabled( String locator )
+    {
+        Assert.assertTrue( getSelenium().isEditable( locator ), "'" + locator + "' is disabled"
);
+    }
+
+    public void assertDisabled( String locator )
+    {
+        Assert.assertFalse( getSelenium().isEditable( locator ), "'" + locator + "' is enabled"
);
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp?rev=951289&r1=951288&r2=951289&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp Fri
Jun  4 06:00:23 2010
@@ -24,6 +24,21 @@
   <s:i18n name="localization.Continuum">
     <head>
         <title><s:text name="buildDefinition.page.title"/></title>
+        <script language="javascript">
+          function setAlwaysBuild()
+          {
+              if ( document.saveBuildDefinition.buildFresh.checked == true )
+              {
+                  document.saveBuildDefinition.alwaysBuild.checked = true;
+                  document.saveBuildDefinition.alwaysBuild.disabled = true;
+              }
+              else
+              {
+                  document.saveBuildDefinition.alwaysBuild.checked = false;
+                  document.saveBuildDefinition.alwaysBuild.disabled = false;
+              }
+          }
+        </script>
     </head>
     <body>
       <div id="axial" class="h3">
@@ -65,14 +80,21 @@
                     </s:else>
     
                     <s:textfield label="%{getText('buildDefinition.arguments.label')}"
name="arguments"/>
-                    <s:checkbox label="%{getText('buildDefinition.buildFresh.label')}"
name="buildFresh" value="buildFresh" fieldValue="true"/>
-                    <s:checkbox label="%{getText('buildDefinition.alwaysBuild.label')}"
name="alwaysBuild" />
+                    <s:checkbox label="%{getText('buildDefinition.buildFresh.label')}"
id="buildFresh" name="buildFresh" value="buildFresh" fieldValue="true" onclick="setAlwaysBuild();"/>
+                    <c:choose>
+                    <c:when test="${buildFresh == true}">
+                      <s:checkbox label="%{getText('buildDefinition.alwaysBuild.label')}"
id="alwaysBuild" name="alwaysBuild" value="true" disabled="true"/>
+                    </c:when>
+                    <c:otherwise>
+                      <s:checkbox label="%{getText('buildDefinition.alwaysBuild.label')}"
id="alwaysBuild" name="alwaysBuild"/>
+                    </c:otherwise>
+                    </c:choose>
                     <c:choose>
                     <c:when test="${defaultBuildDefinition == true}">
                       <s:label label="%{getText('buildDefinition.defaultForProject.label')}"
value="true"/>
                     </c:when>
                     <c:otherwise>
-                      <s:checkbox label="%{getText('buildDefinition.defaultForProject.label')}"
 name="defaultBuildDefinition" value="defaultBuildDefinition" fieldValue="true"/>
+                      <s:checkbox label="%{getText('buildDefinition.defaultForProject.label')}"
name="defaultBuildDefinition" value="defaultBuildDefinition" fieldValue="true"/>
                     </c:otherwise>
                     </c:choose>
                     <s:select label="%{getText('buildDefinition.schedule.label')}" name="scheduleId"
list="schedules"/>



Mime
View raw message