continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1412410 - in /continuum/trunk: continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org...
Date Thu, 22 Nov 2012 02:29:56 GMT
Author: brett
Date: Thu Nov 22 02:29:54 2012
New Revision: 1412410

URL: http://svn.apache.org/viewvc?rev=1412410&view=rev
Log:
[CONTINUUM-2620] adjust validation to allow commonly used punctuation in environment variable
values

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction-saveInstallation-validation.xml
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java?rev=1412410&r1=1412409&r2=1412410&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
Thu Nov 22 02:29:54 2012
@@ -54,6 +54,8 @@ public class InstallationTest
 
     private String varNameNoBE;
 
+    private String varNameOptions;
+
     @BeforeMethod
     protected void setUp()
         throws Exception
@@ -66,12 +68,13 @@ public class InstallationTest
         mavenName = getProperty( "INSTALL_TOOL_MAVEN_NAME" );
         mavenPath = getProperty( "INSTALL_TOOL_MAVEN_PATH" );
         varNameNoBE = "var_without_build_environment";
+        varNameOptions = "var_with_options";
     }
 
     @AfterClass
     public void cleanup()
     {
-        for ( String installation : Arrays.asList( jdkName, varName, mavenName, varNameNoBE
) )
+        for ( String installation : Arrays.asList( jdkName, varName, mavenName, varNameNoBE,
varNameOptions ) )
         {
             removeInstallation( installation, false );
             removeBuildEnvironment( installation, false );
@@ -117,6 +120,14 @@ public class InstallationTest
         addInstallation( varNameNoBE, varVariableName, varPath, false, false, true );
     }
 
+    public void testAddInstallationVariableWithOtherOptions()
+    {
+        String varVariableName = "JAVA_OPTS";
+        String varPath = "-XX:+CompressedOops";
+        goToAddInstallationVariable();
+        addInstallation( varNameOptions, varVariableName, varPath, false, false, true );
+    }
+
     public void testAddInstallationVariableWithoutBuildEnvironmentWithInvalidValues()
     {
         String varName = "!@#$<>?etc";

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction-saveInstallation-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction-saveInstallation-validation.xml?rev=1412410&r1=1412409&r2=1412410&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction-saveInstallation-validation.xml
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction-saveInstallation-validation.xml
Thu Nov 22 02:29:54 2012
@@ -42,7 +42,7 @@
       <message key="installation.varValue.required"/>
     </field-validator>
     <field-validator type="regex">
-      <param name="expression"><![CDATA[(?:[~A-Za-z0-9_.:=${}\\/\-]|\s|[()])*]]></param>
+      <param name="expression"><![CDATA[(?:[~A-Za-z0-9_.:=${}\\/\-+]|\s|[()])*]]></param>
       <message key="installation.varValue.invalid"/>
     </field-validator>
     <field-validator type="installationValidator">

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=1412410&r1=1412409&r2=1412410&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Thu Nov 22 02:29:54 2012
@@ -128,7 +128,7 @@ public class ContinuumServiceImpl
 
     private static final String INSTALLATION_VARNAME_VALID_EXPRESSION = "[A-Za-z][A-Za-z0-9_]*";
 
-    private static final String INSTALLATION_VARVALUE_VALID_EXPRESSION = "[A-Za-z0-9_.:=${}/\\s\\\\-]*";
+    private static final String INSTALLATION_VARVALUE_VALID_EXPRESSION = "(?:[~A-Za-z0-9_.:=${}\\\\/\\-+]|\\s|[()])*";
 
     private static final String INSTALLATION_TYPE_VALID_EXPRESSION = "jdk|maven2|maven1|ant|envvar";
 

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java?rev=1412410&r1=1412409&r2=1412410&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java
Thu Nov 22 02:29:54 2012
@@ -36,6 +36,7 @@ import org.apache.maven.continuum.xmlrpc
 import org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary;
 import org.apache.maven.continuum.xmlrpc.project.ReleaseListenerSummary;
 import org.apache.maven.continuum.xmlrpc.server.ContinuumServiceImpl;
+import org.apache.maven.continuum.xmlrpc.system.Installation;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.jmock.Expectations;
@@ -457,9 +458,6 @@ public class ContinuumServiceImplTest
                 group = createProjectGroup( name, groupId, description );
                 one( continuum ).getProjectGroupByGroupId( groupId );
                 will( returnValue( group ) );
-//
-//                one( continuum ).getProjectGroup( projectGroupId );
-//                will( returnValue( group ) );
             }
         } );
 
@@ -517,6 +515,27 @@ public class ContinuumServiceImplTest
         context.assertIsSatisfied();
     }
 
+    public void testInstallationEnvironmentVariableWithOtherOptions()
+        throws ContinuumException
+    {
+        context.checking( new Expectations()
+        {
+            {
+                one( continuum ).getInstallationService();
+            }
+        } );
+
+        Installation installation = new Installation();
+        installation.setName( "name" );
+        installation.setType( "envvar" );
+        installation.setVarName( "JAVA_OPTS" );
+        installation.setVarValue( "-XX:+CompressedOops" );
+
+        continuumService.addInstallation( installation );
+
+        context.assertIsSatisfied();
+    }
+
     private static ProjectGroup createProjectGroup( String name, String groupId, String description
)
     {
         ProjectGroup group = new ProjectGroup();



Mime
View raw message