What do these icons mean in the TestNG console?

When I run TestNG on my whole project (using IntelliJ IDEA 8.1.4), one of the tests gets marked with the following icon, and remains open, even though it doesn't seem to fail.
testng-output.png
Can anyone explain what this means?

Thanks,
-- Avi

5 comments
Comment actions Permalink

Help --> Help Topics
     Go to IntelliJ IDEA / Reference / Tool Window Reference / Run Tool Window / Test Results Tab

Alternatively you can search for Test Status Icons in Help and that page will be on the top of the list.

There's a list on that page with all the icons and there meanings.

0
Comment actions Permalink

Thank you. That explains that what I am looking at is a "Test Terminated" icon. Now, is there any way to figure out why the test was terminated? Or how tests in general may be terminated?

0
Comment actions Permalink

The JVM itself terminating will cause this. For example a System.exit() call (in either the test itself or the tested code) will cause this. There may be other ways it occurs such as the test runner terminating for what ever reason. The below JUnit example uses a System.exit() call to cause a similar result:

public class Example
{
    public int add(int a, int b)
    {
        if (a == b)
        {
            System.exit(1);
        }
        return a + b;
    }


    public int multiply(int a, int b)
    {
        return a * b;
    }
}


===========================================================


import static org.junit.Assert.*;

import org.junit.Test;

public class ExampleTest
{
    @Test
    public void testMultiply()
    {
        int expected = 4;
        int actual = new Example().multiply(2, 2);
        assertEquals("Wrong product returned", expected, actual);
    }


    @Test
    public void testAdd()
    {
        int expected = 4;
        int actual = new Example().add(2, 2);
        assertEquals("Wrong sum returned", expected, actual);
    }
}

0
Comment actions Permalink

Thanks. My methond seems to be completing normally, though, and I can't figure out why this would be marked "Terminated".

0
Comment actions Permalink

Might also be a threading issue in terms of the timing of threads completing. Not sure if your app is multi-threaded.

0

Please sign in to leave a comment.