我有一个用于 JUnit 测试的 java 程序,我在 netbeans IDE 中编写了该程序,我正在使用单线程测试一个类。
当我要编译它时,它工作正常并显示结果 100% 成功,但是
当我尝试运行这个程序时,我收到一个异常 -
测试套件:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest
测试运行:1,失败:1,错误:0,经过的时间:0.057 秒
测试用例:警告(junit.framework.TestSuite$1):失败
glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest 中未找到测试
junit.framework.AssertionFailedError:在 glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest 中找不到测试
测试套件:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest
测试运行:1,失败:0,错误:1,已用时间:0 秒
测试用例:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest:null:导致错误
Forked Java VM 异常退出。请注意,报告中的时间并不反映虚拟机退出之前的时间。
junit.framework.AssertionFailedError:分叉的 Java VM 异常退出。请注意,报告中的时间并不反映虚拟机退出之前的时间。
在 org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
是netbean问题还是其他什么问题?有没有人帮帮我谢谢。
我的代码是这样的——
public class BusinessDataTest {
String url = "http://local.com/info-66122628-andy-richards-house-painting-mesa";
Integer[] locId = {1354};
String customerDetail ="Business Name";
public BusinessDataTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Test
public void testGetFullDataOfBusiness() {
System.out.println("getFullDataOfBusiness");
BusinessData instance = new BusinessData();
Integer expResult = 4;
Integer result = instance.getFullDataOfBusiness(url, customerDetail);
System.out.println("Result : " + result);
assertEquals(expResult, result);
}
}
这看起来像是 Netbeans 中的一个错误 - 请参阅错误 204729 http://netbeans.org/bugzilla/show_bug.cgi?id=204729
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)