2 Replies Latest reply: Jan 7, 2014 12:00 PM by peter@project44.be RSS

    How to wait for ExecPlaceRequest

    peter@project44.be Community Member



      I am trying to write a "tester" plugin (CC) that will test the "real" plugin using SendMessage to send messages to it. Things like kSelectorAIToolMouseDown etc.


      This is working in the sense that the group art is indeed being drawn, but the problem is I need to synchronize the test plugin code on the drawing code / results and I have not found a good way to do that.


      E.g. the "real" plugin invokes an ExecPlaceRequest to draw art as the result of a mouse up event, but that is not immediately visible for the tester plugin and the tester plugin should wait for that.


      So I guess I have two questions


      - Is this a good approach to write tests for a AI plugin?

      - How can I synchronize my tester plugin and make it only continue when all actions/updates/etc as the result of processing a message are finished.


      All tips warmly welcomed!





        • 1. Re: How to wait for ExecPlaceRequest
          A. Patterson Community Member

          This is probably simplistic, but why not send a notifier out when its completed?

          • 2. Re: How to wait for ExecPlaceRequest
            peter@project44.be Community Member

            Thanks for the reply. I'd rather not touch the actual plugin though just to make it testable




            What I managed to get working is


            - Split the test in different steps (create document, draw plugin art, save document)

            - Between each step reinvoke the menu command that starts the test and by maintaining a state loop through the different test steps

            - In between I added a wait step, which executes






            Not sure which of the three statements did the trick, and/or whether it is just by going through the menu reinvocation that makes everything work, but this way the test now runs ok. I have not a clue though how "stable" this "hack/solution" is.