2012-03-27 130 views
0

我需要使用JUnit 3,我知道在JUnit 4中有一种方法在API中从Java中的常规方法启动JUnit测试(结果r = org。 junit.runner.JUnitCore.runClasses(MyTestClass.class))。但是我怎么能在JUnit 3中做到这一点,并获得结果呢?Junit 3,从java方法开始测试

编辑: 我现在正在这样做:TestRunner.run(MyTestClass.class); 但我没有得到任何结果..

回答

1
+0

我需要从方法开始测试。我用速度代码调用该方法。所以我不能使用Ant或Shell。我想要一些反馈如何测试.. – Gynnad 2012-03-27 08:52:03

+0

只需看看跑步者正在做什么。 – 2012-03-27 09:10:32

+0

谢谢!我现在得到一些东西,而不是我想要的确切结果。但我想我会在那里我想要的;-) \t \t int failures = junit.textui.TestRunner.run(runner.getTest(MyTestClass.class.getName()))。failureCount(); (结果现在是1,但它需要3) – Gynnad 2012-03-27 09:45:22