【发布时间】:2012-01-31 10:10:08
【问题描述】:
我已经按照描述使用每个方法使用一个内部类来组织我的 junit 测试:
Here, in a haacked article (about nunit testing),和
Here, in this SO question
public class TestMyThing {
public static class TestMyThingMethodOne {
@Test
public void testMethodOneDoesACertainBehaviour() {
// terse, clear testing code goes here
}
@Test
public void testMethodOneHasSomeOtherDesiredBehaviour() {
// more inspiring testing code here
}
}
public static class TestMyThingMethodTwo {
... etc
}
}
但是,当我尝试为此运行 junit 测试时,Eclipse 会询问我要运行哪个内部类测试,而我只能选择一个。有没有办法可以指定我希望每个内部类中的每个测试都运行 TestMyThing 类?
【问题讨论】: