/** * Creates a new instance of {@link SorterUtil}. */ private SorterUtil() { final String propertySorter = System.getProperty(PROPERTY_SORTER, EMPTY); if (SORTER_ALPHANUMERIC.equalsIgnoreCase(propertySorter)) { sorter = new Sorter(new Comparator<Description>() { public int compare(final Description o1, final Description o2) { return o1.getDisplayName().compareTo(o2.getDisplayName()); } }); } else { sorter = Sorter.NULL; } }
public void sort(Sorter sorter) { fSorter = sorter; for (FrameworkMethod each : getOriginalFilteredChildren()) { sortChild(each); } Collections.sort(getOriginalFilteredChildren(), comparator()); }
public void sort(Sorter sorter) { synchronized (fChildrenLock) { for (T each : getFilteredChildren()) { sorter.apply(each); } List<T> sortedChildren = new ArrayList<T>(getFilteredChildren()); Collections.sort(sortedChildren, comparator(sorter)); fFilteredChildren = Collections.unmodifiableCollection(sortedChildren); } }
private Comparator<? super T> comparator(final Sorter sorter) { return new Comparator<T>() { public int compare(T o1, T o2) { return sorter.compare(describeChild(o1), describeChild(o2)); } }; }
@Override public void sort(Sorter sorter) { // it is not sure that the custom runner support sorting so sorting is done // here too. if (mRunner instanceof Sortable) { Sortable sortableRunner = (Sortable) mRunner; sortableRunner.sort(sorter); } }
public void sort(final Sorter sorter) { Collections.sort(fTestMethods, new Comparator<Method>() { public int compare(Method o1, Method o2) { return sorter.compare(methodDescription(o1), methodDescription(o2)); } }); }
public void sort(Sorter sorter) { fSorter = sorter; for (T each : getFilteredChildren()) { sortChild(each); } Collections.sort(getFilteredChildren(), comparator()); }
public void sort(Sorter sorter) { synchronized (childrenLock) { for (FrameworkMethod each : getFilteredChildren()) { sorter.apply(each); } List<FrameworkMethod> sortedChildren = new ArrayList<FrameworkMethod>(getFilteredChildren()); Collections.sort(sortedChildren, comparator(sorter)); filteredChildren = Collections.unmodifiableCollection(sortedChildren); } }
private Comparator<? super FrameworkMethod> comparator(final Sorter sorter) { return new Comparator<FrameworkMethod>() { public int compare(FrameworkMethod o1, FrameworkMethod o2) { return sorter.compare(describeChild(o1), describeChild(o2)); } }; }
public void sort(Sorter sorter) { synchronized (childrenLock) { for (Runner each : getFilteredChildren()) { sorter.apply(each); } List<Runner> sortedChildren = new ArrayList<Runner>(getFilteredChildren()); Collections.sort(sortedChildren, comparator(sorter)); filteredChildren = Collections.unmodifiableCollection(sortedChildren); } }
private Comparator<? super Runner> comparator(final Sorter sorter) { return new Comparator<Runner>() { public int compare(Runner o1, Runner o2) { return sorter.compare(describeChild(o1), describeChild(o2)); } }; }
@Override public void sort(Sorter sorter) { fSorter = sorter; for (FrameworkMethod each : getFilteredChildren()) { sortChild(each); } Collections.sort(getFilteredChildren(), comparator()); assumptionSort(getFilteredChildren()); }
public Sorter getSorter() { // TODO: implement the better sorter return Sorter.NULL; }
@Override public void sort(final Sorter sorter) { super.sort(sorter); descriptionOutdated = true; }
@Override public void sort(Sorter newSorter) { super.sort(newSorter); this.sorter = newSorter; }
public void sort(Sorter sorter) { sorter.apply(fRunner); }
public void sort(Sorter sorter) { fSorter= sorter; for (T each : getFilteredChildren()) sortChild(each); Collections.sort(getFilteredChildren(), comparator()); }
@Override public Runner getRunner() { Runner runner = fRequest.getRunner(); new Sorter(fComparator).apply(runner); return runner; }
public void sort(Sorter sorter) { if (getTest() instanceof Sortable) { Sortable adapter = (Sortable) getTest(); adapter.sort(sorter); } }
public void sort(Sorter sorter) { // }