Home > Test Driven Development, Wicket > Writing readable and maintainable integration tests (not only) in Wicket

Writing readable and maintainable integration tests (not only) in Wicket

Post moved to http://www.paulszulc.com/2009/writing-readable-and-maintainable-integration-tests-not-only-in-wicket/

Advertisements
  1. August 13, 2009 at 6:30 am

    Great article!

    Couple of questions:
    1) Any reason why you are using 3 helper classes instead of one?

    2) Can you post an example of a helper class, and how to instantiate it? For example, you need the WicketTester for all three classes. So, the WicketTester is probably an argument of the constructor.

    3) It looks like you only use 2 helper classes (and the WicketTester). Is this true?

    • paulszulc
      August 13, 2009 at 7:04 am

      Hi Mario,

      1. the only reason to use 3 helper classes and not one, is maintainability. If I put all of those methods into one helper class, then after a while it would be quite difficult to search through it. The main purpose of those helper class is reusability. If some developer writes method clickLoginLink(), then I won’t have to. So I have one helper class for each common action, one for clicking links and buttons, one for form filling and one for entering the application. This helps me maintaining those helper methods. So for example if my test needs to fill some form with data, I first go directly to FormFiller to see whether other developer didn’t write appropriate method already.

      2. I’m currently writing a post about test base template for Wicket testing, so stay tuned. The rule of thumb is to instantiate tester class and helper classes in init method (method annotated with @Before annotaion, if you are using JUNit).

      3. in this example, yes. I didn’t show usage of FormFiller helper class.

    • paulszulc
      August 19, 2009 at 6:38 am
  2. Mario Klaver
    August 19, 2009 at 6:43 am

    Thx, I will take a look at it.

  1. August 19, 2009 at 9:36 am
  2. August 25, 2009 at 8:49 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: