commit | 2a75dcb2fd1490ace0acf82e948aae2829b87e8d | [log] [tgz] |
---|---|---|
author | Paul Duffin <[email protected]> | Tue May 23 16:10:39 2017 +0100 |
committer | Paul Duffin <[email protected]> | Thu May 25 15:06:07 2017 +0100 |
tree | 97cfe8397d377608f64bbbf48251d3b989797b1c | |
parent | 67e1cb11019cf70266b6c0509b06a17ce0742429 [diff] |
Ignore tests that no longer work Previous changes caused tests that use @TestCaseName to start to fail but did not update the tests to ensure that they still run. Bug: 38419944 Test: run tests as described in Android.mk Change-Id: I2d5ed10bcf49fa114f73292bbe06fd70c158ae99
Parameterised tests that don't suck
@RunWith(JUnitParamsRunner.class) public class PersonTest { @Test @Parameters({"17, false", "22, true" }) public void personIsAdult(int age, boolean valid) throws Exception { assertThat(new Person(age).isAdult(), is(valid)); } }
See more examples
JUnitParams project adds a new runner to JUnit and provides much easier and readable parametrised tests for JUnit >=4.6.
Main differences to standard JUnit Parametrised runner:
JUnitParams is available as Maven artifact:
<dependency> <groupId>pl.pragmatists</groupId> <artifactId>JUnitParams</artifactId> <version>1.0.4</version> <scope>test</scope> </dependency>
If you want to see just one simple test class with all main ways to use JUnitParams see here: https://github.com/Pragmatists/junitparams/tree/master/src/test/java/junitparams/usage
You can also have a look at Wiki:Quickstart
Note: We are currently moving the project from Google Code to Github. Some information may still be accessible only at https://code.google.com/p/junitparams/