This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit d4ef4584e5298a3f0f6cc3d958dfa4be2f35f97a
Author: Volker Lamp <vl...@apache.org>
AuthorDate: Mon May 30 21:53:29 2022 +0200

    TAP5-2723: Added test case to prove the bug report is valid.
---
 .../groovy/ioc/specs/CronExpressionSpec.groovy     | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tapestry-ioc/src/test/groovy/ioc/specs/CronExpressionSpec.groovy 
b/tapestry-ioc/src/test/groovy/ioc/specs/CronExpressionSpec.groovy
index 58bef3e82..0e0ef1838 100644
--- a/tapestry-ioc/src/test/groovy/ioc/specs/CronExpressionSpec.groovy
+++ b/tapestry-ioc/src/test/groovy/ioc/specs/CronExpressionSpec.groovy
@@ -2,6 +2,8 @@ package ioc.specs
 
 import org.apache.tapestry5.ioc.internal.services.cron.CronExpression
 import spock.lang.Ignore
+import spock.lang.Issue
+import spock.lang.PendingFeature
 import spock.lang.Specification
 import spock.lang.Unroll
 
@@ -100,5 +102,25 @@ class CronExpressionSpec extends Specification {
     where:
     expr << ["0 43 9 ? * 5L"]
   }
+  
+  @Issue("https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2723";)
+  @PendingFeature(reason = "TAP5-2723 not yet fixed.")
+  def "getNextValidTimeAfter(#after) should be #expected for #expr"()
+  {
+         given:
+         def e = new CronExpression(expr)
+         e.setTimeZone(TimeZone.getTimeZone("UTC"))
+         
+         expect:
+         e.getNextValidTimeAfter(new Date(after)) == new Date(expected)
+         
+         where:
+         expr               | after         || expected
+         "0/5 * * ? * * *"  | 0             || 5000
+         "0/5 * * ? * * *"  | 5000          || 10000
+         "0 55 8 L-9 * ? *" | 1653939024971 || 1655801700000
+         
+  }
+
 
 }
\ No newline at end of file

Reply via email to