1 package org.junit.runner.manipulation; 2 3 import java.util.Comparator ; 4 5 import org.junit.runner.Description; 6 import org.junit.runner.Runner; 7 8 14 public class Sorter implements Comparator <Description> { 15 private final Comparator <Description> fComparator; 16 17 22 public Sorter(Comparator <Description> comparator) { 23 fComparator= comparator; 24 } 25 26 30 public void apply(Runner runner) { 31 if (runner instanceof Sortable) { 32 Sortable sortable = (Sortable) runner; 33 sortable.sort(this); 34 } 35 } 36 37 38 public int compare(Description o1, Description o2) { 39 return fComparator.compare(o1, o2); 40 } 41 } 42 | Popular Tags |