【发布时间】:2014-10-13 15:49:06
【问题描述】:
我的所有测试都有班级跑者:
import org.junit.*;
import org.junit.rules.TestName;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
@RunWith(Suite.class)
@Suite.SuiteClasses({
Test1.class,
Test2.class,
Test3.class,
Test4.class,
Test5.class
})
public class AllTestRunner {
...
@Before
public void method1() {}
@After
public void method2() {}
我需要为SuiteClasses 的每个班级中的每个@Test 运行method1() 和method2()。
但它不起作用,可能是我做某事。错了吗?
感谢您的帮助,对不起我的英语。
【问题讨论】:
-
你能分享你的进口吗?
-
@wrongAnswer 完成 :)
标签: java testing junit automated-tests