tag | a8023571580ebb160439ce19cc26019c1659e22a | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu Dec 06 11:30:38 2018 -0800 |
object | d4c2ffb2d96d1d9549c25de1257c35cb3e05fd77 |
Android Wear 8.0.0 Release 2 (OWDS.181106.001)
commit | d4c2ffb2d96d1d9549c25de1257c35cb3e05fd77 | [log] [tgz] |
---|---|---|
author | Neil Fuller <nfuller@google.com> | Tue Sep 25 08:14:15 2018 -0700 |
committer | android-build-merger <android-build-merger@google.com> | Tue Sep 25 08:14:15 2018 -0700 |
tree | c2059c17ecad6859b8e2f9c376984d3f4cc92f77 | |
parent | 5d54d9630e6e5253a54c78681919281962eb5c6d [diff] | |
parent | f78c7816cdcfdb54dc43ffdd5f90589a7b150ff0 [diff] |
Compile against core public SDK APIs only am: f78c7816cd Change-Id: Iae74a12537287c70b84e20ca2c8bbee9f4d32964
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/