2 Replies Latest reply on Apr 28, 2009 12:01 AM by jamesrender

    Accessing ActionHandlers at runtime

      Hi there,

      I'm trying to write a junit testcase that runs a bpm definition.

      My difficulty is that the ActionHandlers I have call out to external systems.

      In an ideal world, I would be able to retrieve the actionhandlers in the test, and inject some Mock objects into the ActionHandler..

      any pointers?

      thanks

        • 1. Re: Accessing ActionHandlers at runtime
          kukeltje

          why not configure 'mock actionhandlers'?

          • 2. Re: Accessing ActionHandlers at runtime

            how would I add these mockhandlers at runtime?

            I've managed to navigate to the actionhandler classname via the processdefinition->node->event->action->delegation, so I could change the name of the class that is triggered to a mock one.

            However, I've been using jmock to avoid having to write mock classes in this way. It will be another class to maintain.

            In addition will replacing whole actionhandlers with mock code actually prove anything?

            I want to mock out the external calls made within an actionhandler, ideally avoiding if (test.mode) {} type code

            I was hoping that I'd be able to retrieve the ActionHandler object, call a method to pass it a jmock for a service call, then run the definition