}
//3.获取测试方法上的 @Order 注解,并对所有的测试方法重新排序
Collections.sort(toRunMethodList, new Comparator<FrameworkMethod>() {
@Override
public int compare(final FrameworkMethod m1, final FrameworkMethod m2) {
TestOrder o1 = m1.getAnnotation(TestOrder.class);
TestOrder o2 = m2.getAnnotation(TestOrder.class);
if (o1 == null || o2 == null) {
return 0;
}
return o1.value() - o2.value();
}
});
return toRunMethodList;
}