1 package org.junit.internal.requests; 2 3 import java.util.Comparator ; 4 5 import org.junit.runner.Description; 6 import org.junit.runner.Request; 7 import org.junit.runner.Runner; 8 import org.junit.runner.manipulation.Sorter; 9 10 public class SortingRequest extends Request { 11 private final Request fRequest; 12 private final Comparator <Description> fComparator; 13 14 public SortingRequest(Request request, Comparator <Description> comparator) { 15 fRequest= request; 16 fComparator= comparator; 17 } 18 19 @Override 20 public Runner getRunner() { 21 Runner runner= fRequest.getRunner(); 22 new Sorter(fComparator).apply(runner); 23 return runner; 24 } 25 } 26 | Popular Tags |