Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You should be familiar with JUnit as it is what OpenMRS uses for unit testing. For my test, I used JUnit4. Please see The unit testing tutorial and The module unit testing tutorial for more information. It is assumed for the sake of this tutorial that you have read and understand those.

...

The above line is needed so that we can clean up after we finish testing. That should be the first method in your test class. Now let's write our first test method, I'm testing my AJAX Servlet which is responsible for validation/generation of the controller/view for the Groovy Forms Module /wiki/spaces/AR/pages/18513993.

I am only going to post one test method here, for the full class see this link. It should give you the overall gist. Assume for the sake of this test method that a static import exists for assertTrue and assertEquals (as that is the case in my test class.)

...

Hop onto IRC; my nick is r0bby, and I'll be happy to answer any questions, my contact info is also available on my Unlicensed user Robby O'Connor, feel free to contact me with questions.

...