Java unit test for different input data

there are prameterized tests: http://www.mkyong.com/unittest/junit-4-tutorial-6-parameterized-test/ and http://ourcraft.wordpress.com/2008/08/27/writing-a-parameterized-junit-test/.

alternatively, you can make your test case abstract and subclass it with each subclass setting up the url.


Happen to me sometime, and them I found this awesome idea called Parameterized Test, for instance: http://www.mkyong.com/unittest/junit-4-tutorial-6-parameterized-test/ in this way you can all the same tests couple of time with different argument.

Tags:

Java

Junit

Junit4