Getting “junit.framework.AssertionFailedError: Forked Java VM exited abnormally” Exception

江枫思渺然 提交于 2019-12-10 17:36:18

问题


I have a java program for JUnit test which I have written in netbeans IDE where I am testing a class with single thread. When I am going to compile this its working fine and showing results 100% success, but when I am trying to run this program I am getting an exception that is -

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)

is its netbean problem or some thing else? is any one help me thanks.

My code is like this-

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:


This looks like a bug in Netbeans - See Bug 204729



来源:https://stackoverflow.com/questions/9646768/getting-junit-framework-assertionfailederror-forked-java-vm-exited-abnormally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!