• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package junitparams;
2 
3 import static org.assertj.core.api.Assertions.assertThat;
4 import static org.junit.Assert.fail;
5 
6 import org.junit.*;
7 import org.junit.runner.*;
8 
9 @RunWith(JUnitParamsRunner.class)
10 public class IgnoringTest {
11 
12     @Test
13     @Ignore
ignoreMeNoParams()14     public void ignoreMeNoParams() {
15         fail("Should be ignored");
16     }
17 
18     @Test
19     @Ignore
20     @Parameters("")
ignoreMeWithParams()21     public void ignoreMeWithParams() {
22         fail("Should be ignored");
23     }
24 
25     @Test
dontIgnoreMeNoParams()26     public void dontIgnoreMeNoParams() {
27     }
28 
29     @Test
30     @Parameters("")
dontIgnoreMeWithParams(String a)31     public void dontIgnoreMeWithParams(String a) {
32         assertThat(a).isEqualTo("");
33     }
34 
35     @Test
36     @Ignore
37     @Parameters(method = "someMethod")
shouldNotTryToInvokeMethodWhenTestIgnored(Object a)38     public void shouldNotTryToInvokeMethodWhenTestIgnored(Object a) {
39         fail("Should be ignored");
40     }
41 
someMethod()42     private Object[] someMethod() {
43         fail("Should not be called");
44         return null;
45     }
46 }
47