<?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: Unit Testing a Transition Listener in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/unit-testing-a-transition-listener/m-p/93059#M63648</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that a little more digging and I have found the answer, so thought I'd share with anyone else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The method I was using to get the values from the expressions was &lt;/SPAN&gt;&lt;CODE&gt;manualCommentExpression.getValue(execution)&lt;/CODE&gt;&lt;SPAN&gt;However, what I should have called was &lt;/SPAN&gt;&lt;CODE&gt;manualCommentExpression.getExpressionText()&lt;/CODE&gt;&lt;SPAN&gt; to get the text that has been configured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That left needing to set the Expression objects in the listener, in my unit test which I did by changing the access modifiers to protected so that they can be accessed via the unit test. The in the unit test I did the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;listener.manualCommentExpression = new FixedValue("This is my comment");&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2012 10:22:46 GMT</pubDate>
    <dc:creator>marcthomas2012</dc:creator>
    <dc:date>2012-08-16T10:22:46Z</dc:date>
    <item>
      <title>Unit Testing a Transition Listener</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unit-testing-a-transition-listener/m-p/93058#M63647</link>
      <description>Hi,I am currently building a workflow engine into our system using Activiti (which is great by the way). We are relying heavily on the use of listeners for triggering behaviour like adding data to our database etc.I have provided a cut down version of the listener below to show roughly what I'm doin</description>
      <pubDate>Thu, 16 Aug 2012 09:18:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unit-testing-a-transition-listener/m-p/93058#M63647</guid>
      <dc:creator>marcthomas2012</dc:creator>
      <dc:date>2012-08-16T09:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unit Testing a Transition Listener</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unit-testing-a-transition-listener/m-p/93059#M63648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that a little more digging and I have found the answer, so thought I'd share with anyone else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The method I was using to get the values from the expressions was &lt;/SPAN&gt;&lt;CODE&gt;manualCommentExpression.getValue(execution)&lt;/CODE&gt;&lt;SPAN&gt;However, what I should have called was &lt;/SPAN&gt;&lt;CODE&gt;manualCommentExpression.getExpressionText()&lt;/CODE&gt;&lt;SPAN&gt; to get the text that has been configured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That left needing to set the Expression objects in the listener, in my unit test which I did by changing the access modifiers to protected so that they can be accessed via the unit test. The in the unit test I did the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;listener.manualCommentExpression = new FixedValue("This is my comment");&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 10:22:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unit-testing-a-transition-listener/m-p/93059#M63648</guid>
      <dc:creator>marcthomas2012</dc:creator>
      <dc:date>2012-08-16T10:22:46Z</dc:date>
    </item>
  </channel>
</rss>

