获取“junit.framework.AssertionFailedError:分叉的Java VM异常退出”异常

时间:2012-03-10 13:18:45

标签: java junit netbeans-6.9

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

  

Testsuite: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中找不到测试

     

Testsuite:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest   测试运行:1,失败:0,错误:1,经过的时间:0秒

     

测试用例:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest:null:导致错误   分叉的Java VM异常退出。请注意,报告中的时间不会反映VM退出之前的时间。   junit.framework.AssertionFailedError:分叉的Java VM异常退出。请注意,报告中的时间不会反映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);
    }
}

1 个答案:

答案 0 :(得分:0)

这看起来像是Netbeans中的一个错误 - 请参阅Bug 204729