Android 单元测试详解(二):一键运行所有测试类测试方法(

2018-12-06  本文已影响0人  Android小悟空

使用 Suite.Class 可以手动构建包含许多类测试的组件,示例:

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
  TestFeatureLogin.class,
  TestFeatureLogout.class,
  TestFeatureNavigate.class,
  TestFeatureUpdate.class
})

public class FeatureTestSuite {
  // the class remains empty,
  // used only as a holder for the above annotations
}

参考资料:https://github.com/junit-team/junit4/wiki/Aggregating-tests-in-suites

上一篇 下一篇

猜你喜欢

热点阅读