Service Virtualization

Expand all | Collapse all

Error while using cron to schedule a testcase

Jump to Best Answer
  • 1.  Error while using cron to schedule a testcase

    Posted 06-12-2018 05:17 PM

    Hi There,

     

    I'm trying to schedule a test-case using Cron settings and getting error as below. Can somebody please help, what is missing here ? FYI, using DevTest 1.x version.

     

     

    ============================================================================

    | Exception:

    ============================================================================

    | Message:     Unexpected end of expression.

    ----------------------------------------------------------------------------

    | Trapped Exception: Unexpected end of expression.

    | Trapped Message:   java.text.ParseException: Unexpected end of expression.

    ----------------------------------------------------------------------------

    STACK TRACE

    java.text.ParseException: Unexpected end of expression.

    at org.quartz.CronExpression.buildExpression(CronExpression.java:437)

    at org.quartz.CronExpression.<init>(CronExpression.java:255)

    at org.quartz.CronTrigger.setCronExpression(CronTrigger.java:460)

    at org.quartz.CronTrigger.<init>(CronTrigger.java:426)

    at org.quartz.CronTrigger.<init>(CronTrigger.java:329)



  • 2.  Re: Error while using cron to schedule a testcase
    Best Answer

    Posted 06-12-2018 10:41 PM

    Hi,

        I am getting same error if I validate the same cron expression through below link. Can you please use below cron expression generator to generate cron script accordingly. 

    Free Online Cron Expression Generator and Describer - FreeFormatter.com 

        If you want to schedule test to run every half an hour using cron expression, please give it as 0 */30 * ? * * . Hope cron expression generator helps in identifying correct cron pattern.

     

    Thanks & Regards,

    Srikanth Gajawada



  • 3.  Re: Error while using cron to schedule a testcase

    Posted 06-13-2018 12:12 AM

    Hi NagaRaj,

     

    I got same error messages in registry.log file just after deplying to CVS with the Spec value is "30 * * * *" and the statuses of the service of CVS were "Expired" and "Inactive" in DevTest 10.2.

     

    I changed the Spec value to "30 * * ? * *" or "* 30 * ? * *", then still I got same error messages in the registry.log but the statuses of service of CVS became "Completed" and "Active" and the test case ran periodically.
    Results in detail:
    Spec "30 * * ? * *": the test ran every HH:MM:30 .
    Spec "* 30 * ? * *": the test ran every HH:30:00 .

     

    Please read about A Cron Expressions in this site:
    http://docwiki.embarcadero.com/Connect/en/Writing_a_CRON_Expression
    I created the values for the "Spec:" field based on this URL.

     

    Thank you,

     

    P.S.
    I think the error messages in registry.log can be ignore if the test runs as scheduled.



  • 4.  Re: Error while using cron to schedule a testcase

    Posted 06-13-2018 12:47 AM

    Able to get correct Cron format using below linka dn scheduled TC successfully.

    Free Online Cron Expression Generator and Describer - FreeFormatter.com 

     



  • 5.  Re: Error while using cron to schedule a testcase

    Posted 06-13-2018 04:15 AM

    Hi NagaRaj,

     

    Did the s answer from Srikanth answered your question? (We hope so).
    If it did please mark it as the right answer.
    When your question is not answered or you still have additional questions please let us know.

     

    Thank you,



  • 6.  Re: Error while using cron to schedule a testcase

    Posted 06-13-2018 01:24 PM

    Done