continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1491080 - in /continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/paren...
Date Sat, 08 Jun 2013 22:09:02 GMT
Author: batkinson
Date: Sat Jun  8 22:09:02 2013
New Revision: 1491080

URL: http://svn.apache.org/r1491080
Log:
[CONTINUUM-2709] Goals/phases aren't required when editing maven build types

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
    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/AbstractBuildDefinitionTemplateTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
Sat Jun  8 22:09:02 2013
@@ -34,5 +34,16 @@ public class ContinuumBuildExecutorConst
     public static final String ANT_BUILD_EXECUTOR = "ant";
 
     public static final String SHELL_BUILD_EXECUTOR = "shell";
+    
+    /**
+     * Determines whether the executor type is an m1 or m2 build.
+     * 
+     * @param type
+     * @return true if the excutor type will result in a maven 1 or 2+ build.
+     */
+    public static boolean isMaven( String type )
+    {
+        return MAVEN_ONE_BUILD_EXECUTOR.equals( type ) || MAVEN_TWO_BUILD_EXECUTOR.equals(
type );
+    }
 
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
Sat Jun  8 22:09:02 2013
@@ -96,6 +96,7 @@ public class BuildDefinitionTemplateTest
         goToAddBuildDefinitionTemplate();
         addEditBuildDefinitionTemplate( "", "", "", "", true, true, true, false );
         assertTextPresent( "BuildFile is required" );
+        assertTextPresent( "Goals are required" );
         assertTextPresent( "Description is required" );
     }
 

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=1491080&r1=1491079&r2=1491080&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
Sat Jun  8 22:09:02 2013
@@ -149,8 +149,10 @@ public class BuildDefinitionTest
         goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription
);
         clickButtonWithValue( "Add" );
         setFieldValue( "buildFile", "" );
+        setFieldValue( "goals", "" );
         clickButtonWithValue( "Save" );
         assertTextPresent( "Build file is required and cannot contain spaces only" );
+        assertTextPresent( "Goals are required" );
     }
 
     public void testAddGroupBuildDefinitionWithXSS()

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildDefinitionTemplateTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildDefinitionTemplateTest.java?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildDefinitionTemplateTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildDefinitionTemplateTest.java
Sat Jun  8 22:09:02 2013
@@ -144,7 +144,7 @@ public abstract class AbstractBuildDefin
         assertTextPresent( "Build Definition Template" );
         assertTextPresent( "POM filename*:" );
         assertElementPresent( "buildDefinition.buildFile" );
-        assertTextPresent( "Goals:" );
+        assertTextPresent( "Goals*:" );
         assertElementPresent( "buildDefinition.goals" );
         assertTextPresent( "Arguments:" );
         assertElementPresent( "buildDefinition.arguments" );

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=1491080&r1=1491079&r2=1491080&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
Sat Jun  8 22:09:02 2013
@@ -420,7 +420,7 @@ public abstract class AbstractContinuumT
         if ( MAVEN_PROJECT_TYPE.equals( type ) )
         {
             assertTextPresent( "POM filename*:" );
-            assertTextPresent( "Goals:" );
+            assertTextPresent( "Goals*:" );
         }
         else if ( ANT_PROJECT_TYPE.equals( type ) )
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
Sat Jun  8 22:09:02 2013
@@ -22,6 +22,7 @@ package org.apache.maven.continuum.web.a
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.Preparable;
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.exception.AuthenticationRequiredException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -577,4 +578,16 @@ public class ContinuumActionSupport
     {
         return getSecuritySystem().getUserManager().findUser( principal );
     }
+    
+    /**
+     * Convenience method to determine whether a build is a maven build. We could call the
static method directly, 
+     * but for struts2 validator access, we would need to enable static method invocation.
+     * 
+     * @param buildType
+     * @return true if the build type is will result in a maven 1 or 2+ build.
+     */
+    public boolean isMavenBuildType( String buildType )
+    {
+        return ContinuumBuildExecutorConstants.isMaven( buildType );
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml
Sat Jun  8 22:09:02 2013
@@ -33,6 +33,10 @@
     </field-validator>
   </field>
   <field name="goals">
+    <field-validator type="fieldexpression">
+      <param name="expression">not isMavenBuildType(buildDefinitionType) or goals.trim().length()
> 0</param>
+      <message key="buildDefinition.goals.required"/>
+    </field-validator>
     <field-validator type="regex">
       <param name="trim">true</param>
       <param name="regex"><![CDATA[[A-Za-z0-9_:\s.\-]*]]></param>

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties
Sat Jun  8 22:09:02 2013
@@ -19,5 +19,6 @@
 
 buildDefinition.buildFile.required = Build file is required and cannot contain spaces only.
 buildDefinition.buildFile.invalid = Build file contains invalid characters.
+buildDefinition.goals.required = Goals are required.
 buildDefinition.goals.invalid = Goals contains invalid characters.
 buildDefinition.arguments.invalid = Arguments contains invalid characters. 

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml
Sat Jun  8 22:09:02 2013
@@ -37,6 +37,10 @@
     </field-validator>
   </field>
   <field name="buildDefinition.goals">
+    <field-validator type="fieldexpression">
+      <param name="expression">not isMavenBuildType(buildDefinition.type) or buildDefinition.goals.trim().length()
> 0</param>
+      <message key="buildDefinition.goals.required"/>
+    </field-validator>
     <field-validator type="regex">
       <param name="regex"><![CDATA[[A-Za-z0-9_:\s\-]*]]></param>
       <message key="buildDefinition.goals.invalid"/>

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
Sat Jun  8 22:09:02 2013
@@ -23,5 +23,6 @@ buildDefinitionTemplate.name.invalid = N
 buildDefinition.buildFile.required = BuildFile is required
 buildDefinition.buildFile.invalid = BuildFile contains invalid characters
 buildDefinition.description.required = Description is required
+buildDefinition.goals.required = Goals are required
 buildDefinition.goals.invalid = Goals contain invalid characters
 buildDefinition.arguments.invalid = Arguments contain invalid characters

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp?rev=1491080&r1=1491079&r2=1491080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
Sat Jun  8 22:09:02 2013
@@ -61,7 +61,7 @@
                     <s:elseif test="buildDefinition.type == 'shell'">
                     </s:elseif>
                     <s:else>
-                      <s:textfield label="%{getText('buildDefinition.goals.maven.label')}"
name="buildDefinition.goals"/>
+                      <s:textfield label="%{getText('buildDefinition.goals.maven.label')}"
name="buildDefinition.goals" requiredLabel="true"/>
                     </s:else>
     
                     <s:textfield label="%{getText('buildDefinition.arguments.label')}"
name="buildDefinition.arguments"/>

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=1491080&r1=1491079&r2=1491080&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 Sat
Jun  8 22:09:02 2013
@@ -61,7 +61,7 @@
                     <s:elseif test="executor == 'shell' or buildDefinitionType == 'shell'">
                     </s:elseif>
                     <s:else>
-                      <s:textfield label="%{getText('buildDefinition.goals.maven.label')}"
name="goals"/>
+                      <s:textfield label="%{getText('buildDefinition.goals.maven.label')}"
name="goals" requiredLabel="true"/>
                     </s:else>
     
                     <s:textfield label="%{getText('buildDefinition.arguments.label')}"
name="arguments"/>



Mime
View raw message