我希望从 Java 测试中启动 GUI 应用程序 2 次。在这种情况下我们应该如何使用@annotation
?
public class Toto {
@BeforeClass
public static void setupOnce() {
final Thread thread = new Thread() {
public void run() {
//launch appli
}
};
try {
thread.start();
} catch (Exception ex) { }
}
}
public class Test extends toto {
@Test
public void test() {
setuptonce();
closeAppli();
}
@test
public void test2()
{
setuptonce();
}
}
要再次启动它,我应该使用哪个注释?@afterclass
?