Getting "junit.framework.AssertionFailedError: Forked Java VM exited abnormally" Exception
Asked Answered
I

1

5

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);
    }
}
Ideology answered 10/3, 2012 at 13:18 Comment(9)
Have you placed any code calling exit or shutdown in your test suite?Elviraelvis
Is it JUnit4 or JUnit3? If JUnit4, make sure you're not inheriting from TestCase and that you are using the @Test annotation.Shamanism
@ Alexander : No, not calling exit or shutdown.Ideology
@Ben Using JUnit4 and not inheriting TestCaseIdeology
@KhoyendraPande: Have you verified that it's not inheriting from TestCase, that it is using the @Test annotation, and that it's not using the @Ignore annotation? I realize these might seem obvious, but sometimes those are the things easiest to miss.Shamanism
@BenHocking : Yeah not inheriting TestCaseIdeology
Posting some code would definitely help us too help you.Lambency
@Lambency : I have added my code, plz check. ThxIdeology
The error tell about YahooBusinessDataTest. Your code pasted above does not have 'yahoo'. Are you sure you are running the correct test?Gond
C
0

This looks like a bug in Netbeans - See Bug 204729

Callboard answered 20/3, 2012 at 6:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.