You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Unit Test

Unit testining with wicket are done by mocking the application. This means that you do not have a webserver running. This section will be about how to get started using unit testing with wickets testing framework.

Simple example

public class AgencyPageTest extends TestCase {

	public void testBasicRender() {
         WicketTester tester=new WicketTester();
         tester.startPage(myPage.class);
         tester.assertRenderedPage(myPage.class);
	}
}

Above example makes sure that your myPage can render. This itself is a very powerfull test. And should be a minimum of test on all your pages (in this authors opinion).

More examples to come....

  • No labels