junitparams - Parameterised tests for JUnit

http://code.google.com/p/junitparams/

 

This project adds a new runner to JUnit and provides much easier and readable parameterised tests for JUnit >=4.5.

 

For example:

@Test
@Parameters({ 
            "17, false", 
            "22, true" })
public void personIsAdult(int age, boolean valid) throws Exception {
    assertThat(new Person(age).isAdult(), is(valid));
}

 



Share this article: