No announcement yet.

Testing Mirth Channels

  • Filter
  • Time
  • Show
Clear All
new posts

  • Testing Mirth Channels

    I was wondering if anyone has automated testing individual mirth channels or done anything to unit test the javascript, perhaps there are some tools out there that I don't know about. I've looked around the forums but I can't say I've seen a whole lot. If anyone has some first-hand experience with this or some ideas, I'd appreciate the help.


  • #2
    Re:Testing Mirth Channels

    The term unit testing can mean different things to different people in different situations. For the purpose of this response, I will define it as the testing of a single channel.

    There are three (3) components to unit testing: input; output; and verification.

    For the input, I create a Unit Test Channel that is a FileReader (to read the test messages) and some sort of an output. The output must match the input of the channel you are testing. In my case, it is a LLP Sender as the channel being tested is a LLP Listener. To send the messages to the channel being tested, you just drop the files in the directory being monitored by the FileReader.

    For the output, the channel being tested must output in a format that is compatible for verification (the next step). To do this you could, for example, add a Destination that writes a file that can be verified. Alternatively, you could create another channel responsible for capturing the output of the channel being tested, and write it to a file.

    For verification, the easiest thing to do (so far for me) is to compare the output file to either the input file or some other control file (useful if the processing modifies the input message). You could do this with a shell script and the MD5SUM command (for example).

    In my opinion, the key is to leverage Mirth for the Input and Output steps, and then use your operating system to verify, and automate the process.

    If you want to do Integration Testing, you can then chain your channels together.

    This doesn't help if you want to test on a smaller scale (that is, just test the Javascript).

    I hope this helps.