本文整理汇总了Java中org.junit.runner.manipulation.Sorter类的典型用法代码示例。如果您正苦于以下问题:Java Sorter类的具体用法?Java Sorter怎么用?Java Sorter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Sorter类属于org.junit.runner.manipulation包,在下文中一共展示了Sorter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SorterUtil
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
/**
* 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;
}
}
示例2: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
public void sort(Sorter sorter) {
fSorter = sorter;
for (FrameworkMethod each : getOriginalFilteredChildren()) {
sortChild(each);
}
Collections.sort(getOriginalFilteredChildren(), comparator());
}
示例3: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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);
}
}
示例4: comparator
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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));
}
};
}
示例5: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
@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);
}
}
示例6: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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));
}
});
}
示例7: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
public void sort(Sorter sorter) {
fSorter = sorter;
for (T each : getFilteredChildren()) {
sortChild(each);
}
Collections.sort(getFilteredChildren(), comparator());
}
示例8: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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);
}
}
示例9: comparator
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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));
}
};
}
示例10: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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);
}
}
示例11: comparator
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
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));
}
};
}
示例12: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
@Override
public void sort(Sorter sorter) {
fSorter = sorter;
for (FrameworkMethod each : getFilteredChildren()) {
sortChild(each);
}
Collections.sort(getFilteredChildren(), comparator());
assumptionSort(getFilteredChildren());
}
示例13: getSorter
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
public Sorter getSorter() {
// TODO: implement the better sorter
return Sorter.NULL;
}
示例14: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
@Override
public void sort(final Sorter sorter) {
super.sort(sorter);
descriptionOutdated = true;
}
示例15: sort
import org.junit.runner.manipulation.Sorter; //导入依赖的package包/类
@Override
public void sort(Sorter newSorter) {
super.sort(newSorter);
this.sorter = newSorter;
}