<?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 Re: Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it. in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34650#M14634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using Activiti Community or&amp;nbsp;Alfresco Process Services&amp;nbsp;(enterprise version)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2018 14:08:06 GMT</pubDate>
    <dc:creator>cjose</dc:creator>
    <dc:date>2018-04-20T14:08:06Z</dc:date>
    <item>
      <title>Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34647#M14631</link>
      <description>Hi,I need to write a testcase to test an asynchronous process mocking some of the service tasks in it. I am able to mock by extending from ActivitiTestCase class but the process doesnt wait until all jobs are done. And I am able to test async process with the help of PluggableActivitiTestCase class</description>
      <pubDate>Tue, 17 Apr 2018 14:03:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34647#M14631</guid>
      <dc:creator>durgaprasadb</dc:creator>
      <dc:date>2018-04-17T14:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34648#M14632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are async jobs/tasks in the process, you may need to query for jobs via the management service and complete the jobs in your test case for it to move to the next step. There are plenty of examples in the activiti repo under unit test cases.&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti" title="https://github.com/Activiti/Activiti" rel="nofollow noopener noreferrer"&gt;GitHub - Activiti/Activiti: Activiti is a light-weight workflow and Business Process Management (BPM) Platform targeted …&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 12:36:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34648#M14632</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2018-04-20T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34649#M14633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="" style="color: #262626; font-size: 13px;"&gt;&lt;DIV class="" style="padding: 4px 4px 4px 42px;"&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class="" style="margin-left: 4px; padding: 7px 0px 1px;"&gt;&lt;DIV class="" style="color: #263238;"&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;&lt;SPAN class="" dir="ltr"&gt;Thanks for your reply &lt;A __default_attr="148705" __jive_macro_name="user" _jive_internal="true" data-id="148705" data-objecttype="3" data-type="person" href="https://community.alfresco.com/people/cjose" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;&lt;SPAN class="" dir="ltr"&gt;My &lt;STRONG&gt;async&lt;/STRONG&gt; process doesnot have any user tasks for me to fetch and complete. All the tasks are service tasks and I need to mock those service tasks with some dummy classes to ensure the actual service is not hit.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;SPAN&gt;I looked into the activiti-engine test cases and I could find the below ones.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;SPAN&gt;- I could see &lt;STRONG&gt;synchronous&lt;/STRONG&gt; processes being tested with mock classes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;SPAN&gt;- I could see &lt;STRONG&gt;async process being tested by waiting for the jobs to be complete by using&amp;nbsp;waitForJobExecutorToProcessAllJobs()&lt;/STRONG&gt; method.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;&lt;STRONG&gt;I am looking for an example with combination of both&lt;/STRONG&gt; the above scenarios&amp;nbsp;and I could not find&amp;nbsp;one there. Can you please point one for me ? Thanks again.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt; &lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;Regards,&lt;/DIV&gt;&lt;DIV class="" data-tooltip="April 20, 2018 at 6:43:52 PM UTC+5:30" style="font-size: 13px; margin-left: 9px; margin-bottom: 6px; margin-right: 9px;" title="April 20, 2018 at 6:43:52 PM UTC+5:30"&gt;Durga Prasad.&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none;"&gt;&lt;DIV class="" style="border: 8px solid #ffffff;"&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: rgba(0, 0, 0, 0.54); font-size: 11px; padding-top: 6px;"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Srihari Kiran&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;•&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" title="4/20/18, 6:43 PM"&gt;34 mins&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #262626; font-size: 13px;"&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:57:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34649#M14633</guid>
      <dc:creator>durgaprasadb</dc:creator>
      <dc:date>2018-04-20T13:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34650#M14634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using Activiti Community or&amp;nbsp;Alfresco Process Services&amp;nbsp;(enterprise version)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:08:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34650#M14634</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2018-04-20T14:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34651#M14635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If enterprise, I have an example in this &lt;A _jive_internal="true" href="https://community.alfresco.com/community/bpm/blog/2017/10/13/alfresco-process-services-unit-testing-i#jive_content_id_Mock_Beans_for_OOTB_APS_BPMN_Stencils" rel="nofollow noopener noreferrer"&gt;blog&lt;/A&gt;&amp;nbsp;where I am using&amp;nbsp;org.mockito.Mockito to mock some classes. You could take a similar approach even with community version, but I don't have&amp;nbsp;an example handy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:12:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34651#M14635</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2018-04-20T14:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Hi,   I need to write a testcase to test an asynchronous process mocking some of the service tasks in it.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34652#M14636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to follow the below steps to be able to mock the service tasks of an async process.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Create a custom class to extend&amp;nbsp;AbstractActivitiTestCase class and add mock support to it. You may refer to&amp;nbsp;ActivitiTestCase class on how it was done.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Extend&amp;nbsp;PluggableActivitiTestCase and modify it to extend from the above created custom class.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) In your test case, extend from your Custom&lt;SPAN&gt;PluggableActivitiTestCase&lt;/SPAN&gt;&amp;nbsp;class.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 12:06:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/hi-i-need-to-write-a-testcase-to-test-an-asynchronous-process/m-p/34652#M14636</guid>
      <dc:creator>hari</dc:creator>
      <dc:date>2018-04-23T12:06:54Z</dc:date>
    </item>
  </channel>
</rss>

