Junit4测试套件 [英] Junit4 Test Suites

查看:118
本文介绍了Junit4测试套件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Junit4创建测试套件?

How do I create test suites with Junit4?

我看到的所有文档似乎都不适合我。如果我使用eclipse向导,它不会让我选择我创建的任何测试类。

All the documentation I've seen doesn't seem to be working for me. And if I use the eclipse wizard it doesn't give me an option to select any of the test classes I created.

推荐答案

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

@RunWith(Suite.class)
@Suite.SuiteClasses({TestClass1.class, TestClass2.class})
public class TestSuite {
  //nothing
}

这篇关于Junit4测试套件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆