The Wicket framework is not TDD-friendly

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

The Wicket framework is somewhat deceptive when it comes to testing, especially TDD. The wicket tester is pretty good for integration tests. However, when trying to test individual components in a TDD manner, you’ll get bitten by the “final” keyword that appears quite frequently among the Wicket components. Mockito won’t help you, my favorite subclass-and-override technique cannot be applied. So, you’re on your own, implementing extra methods in order to get the component under test, which leads to frustration and lack of focus.

2 Comments

  • 1
    Anonymous
    2009-03-31 - 06:56 | Permalink

    One pragmatic approach that lessen the execution time as a whole, is to add several assertions within the same wicket test method. Granted, you’ll break the recommendation that you should test one thing only in a test method.

  • 2
    Anonymous
    2010-07-11 - 05:10 | Permalink

    To mock classes with “final” stuff the JMockit framework can be used.
    http://code.google.com/p/jmockit

  • Leave a Reply

    Your email address will not be published. Required fields are marked *