1 package org.junit.runner.manipulation; 2 3 import org.junit.runner.Description; 4 import org.junit.runner.Request; 5 import org.junit.runner.Runner; 6 7 16 public abstract class Filter { 17 20 public static Filter ALL= new Filter() { 21 @Override 22 public boolean shouldRun(Description description) { 23 return true; 24 } 25 26 @Override 27 public String describe() { 28 return "all tests"; 29 } 30 }; 31 32 36 public abstract boolean shouldRun(Description description); 37 38 44 public void apply(Runner runner) throws NoTestsRemainException { 45 if (runner instanceof Filterable) { 46 Filterable filterable= (Filterable)runner; 47 filterable.filter(this); 48 } 49 } 50 51 55 public abstract String describe(); 56 } 57 | Popular Tags |