gpt4 book ai didi

java - 获取 "junit.framework.AssertionFailedError: Forked Java VM exited abnormally"异常

转载 作者:搜寻专家 更新时间:2023-11-01 03:55:14 26 4
gpt4 key购买 nike

我有一个用于 JUnit 测试的 java 程序,它是在 netbeans IDE 中编写的,我正在其中测试一个具有单线程的类。当我要编译它时它工作正常并显示结果 100% 成功,但是当我试图运行这个程序时,我遇到了一个异常——

Testsuite: glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.057 sec

Testcase: warning(junit.framework.TestSuite$1): FAILED No tests found in glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest junit.framework.AssertionFailedError: No tests found in glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest

Testsuite: glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Testcase: glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest:null: Caused an ERROR Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit. junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit. at 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 中的错误 - 请参阅 Bug 204729

关于java - 获取 "junit.framework.AssertionFailedError: Forked Java VM exited abnormally"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9646768/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com