<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Best practices for unit testing of TimerCatchingEvent in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84852#M57166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering what is the best approach to unit test a process with a TimerCatchingEvent. Let's say this event is scheduled to be a few days in the future, then I certainly don't want to Thread.sleep(veryBigNumber)…. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; For some background: our tests run with Arquillian inside a JBoss AS 7.1 container, so full JavaEE is available.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One option would be to just test a slightly different version of the business process, where the timer is set to just 1 second or something. Then we can sleep a while and check if the work is done or not. But this would mean that we need to keep two versions of the process around (potential for errors here).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The other thing I had on mind was to modify the job inside the DB manually, so the job executor will pick it up earlier. However I'm not sure how to do this properly… I imagine finding the execution from ACT_RU_EXECUTION, then going to ACT_RU_JOB and modify it directly via SQL. Or could I hijack some (internal) Activiti API for that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What are your thoughts? How are you doing this in your tests? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Peter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2012 10:13:01 GMT</pubDate>
    <dc:creator>naag</dc:creator>
    <dc:date>2012-08-07T10:13:01Z</dc:date>
    <item>
      <title>Best practices for unit testing of TimerCatchingEvent</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84852#M57166</link>
      <description>Hi all,I'm wondering what is the best approach to unit test a process with a TimerCatchingEvent. Let's say this event is scheduled to be a few days in the future, then I certainly don't want to Thread.sleep(veryBigNumber)…. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; For some background: our tests run with Arquillian inside a JBoss AS 7.1</description>
      <pubDate>Tue, 07 Aug 2012 10:13:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84852#M57166</guid>
      <dc:creator>naag</dc:creator>
      <dc:date>2012-08-07T10:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for unit testing of TimerCatchingEvent</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84853#M57167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;DON'T CHANGE THE PROCESS…!!! Use the management service to explicity execute the jobs…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 10:55:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84853#M57167</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2012-08-07T10:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for unit testing of TimerCatchingEvent</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84854#M57168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect! I didn't know that the management service would force the execution &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ops:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 11:31:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/best-practices-for-unit-testing-of-timercatchingevent/m-p/84854#M57168</guid>
      <dc:creator>naag</dc:creator>
      <dc:date>2012-08-07T11:31:26Z</dc:date>
    </item>
  </channel>
</rss>

