Home | History | Annotate | Download | only in junitparams
      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
     14     public void ignoreMeNoParams() {
     15         fail("Should be ignored");
     16     }
     17 
     18     @Test
     19     @Ignore
     20     @Parameters("")
     21     public void ignoreMeWithParams() {
     22         fail("Should be ignored");
     23     }
     24 
     25     @Test
     26     public void dontIgnoreMeNoParams() {
     27     }
     28 
     29     @Test
     30     @Parameters("")
     31     public void dontIgnoreMeWithParams(String a) {
     32         assertThat(a).isEqualTo("");
     33     }
     34 
     35     @Test
     36     @Ignore
     37     @Parameters(method = "someMethod")
     38     public void shouldNotTryToInvokeMethodWhenTestIgnored(Object a) {
     39         fail("Should be ignored");
     40     }
     41 
     42     private Object[] someMethod() {
     43         fail("Should not be called");
     44         return null;
     45     }
     46 }
     47