continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r351726 - in /maven/continuum/trunk/continuum-web/src: main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java test/java/org/apache/maven/continuum/web/validation/CronExpressionValidatorTest.java
Date Fri, 02 Dec 2005 13:56:09 GMT
Author: evenisse
Date: Fri Dec  2 05:56:01 2005
New Revision: 351726

URL: http://svn.apache.org/viewcvs?rev=351726&view=rev
Log:
PR: CONTINUUM-494

Allow to create schedule with year.

Modified:
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
    maven/continuum/trunk/continuum-web/src/test/java/org/apache/maven/continuum/web/validation/CronExpressionValidatorTest.java

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java?rev=351726&r1=351725&r2=351726&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
Fri Dec  2 05:56:01 2005
@@ -36,7 +36,7 @@
         try
         {
             String[] cronParams = StringUtils.split( cronExpression );
-            if ( cronParams.length != 6 )
+            if ( cronParams.length < 6 || cronParams.length > 7 )
             {
                 return false;
             }

Modified: maven/continuum/trunk/continuum-web/src/test/java/org/apache/maven/continuum/web/validation/CronExpressionValidatorTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/test/java/org/apache/maven/continuum/web/validation/CronExpressionValidatorTest.java?rev=351726&r1=351725&r2=351726&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/test/java/org/apache/maven/continuum/web/validation/CronExpressionValidatorTest.java
(original)
+++ maven/continuum/trunk/continuum-web/src/test/java/org/apache/maven/continuum/web/validation/CronExpressionValidatorTest.java
Fri Dec  2 05:56:01 2005
@@ -36,8 +36,46 @@
 
         assertTrue( validator.validate( "0 0,15,30,45 * * * ?" ) );
 
+        assertTrue( validator.validate( "0 0 12 * * ?" ) );
+
+        assertTrue( validator.validate( "0 15 10 ? * *" ) );
+
+        assertTrue( validator.validate( "0 15 10 * * ?" ) );
+
+        assertTrue( validator.validate( "0 15 10 * * ? *" ) );
+
+        assertTrue( validator.validate( "0 15 10 * * ? 2005" ) );
+
+        assertTrue( validator.validate( "0 * 14 * * ?" ) );
+
+        assertTrue( validator.validate( "0 0/5 14 * * ?" ) );
+
+        assertTrue( validator.validate( "0 0/5 14,18 * * ?" ) );
+
+        assertTrue( validator.validate( "0 0-5 14 * * ?" ) );
+
+        assertTrue( validator.validate( "0 10,44 14 ? 3 WED" ) );
+
+        assertTrue( validator.validate( "0 15 10 ? * MON-FRI" ) );
+
+        assertTrue( validator.validate( "0 15 10 15 * ?" ) );
+
+        assertTrue( validator.validate( "0 15 10 L * ?" ) );
+
+        assertTrue( validator.validate( "0 15 10 ? * 6L" ) );
+
+        assertTrue( validator.validate( "0 15 10 ? * 6L" ) );
+
+        assertTrue( validator.validate( "0 15 10 ? * 6L 2002-2005" ) );
+
+        assertTrue( validator.validate( "0 15 10 ? * 6#3" ) );
+
         assertFalse( validator.validate( "0 0" ) );
 
         assertFalse( validator.validate( "0 0 * * * *" ) );
+
+        assertFalse( validator.validate( "a a a a a a" ) );
+
+        assertFalse( validator.validate( "0 0 0 ? 0 A" ) );
     }
 }



Mime
View raw message