Eclipse notification when all JUnit tests run

Running my tests lately has taken quite a lot of time (about 1-2 minutes), and I usually get distracted by something, waiting for them to complete.

Is there a way to get Eclipse to give me a notification (like playing a sound or something else) when all tests are complete? I looked through all the possible settings in the JUnit launch configuration, but did not find anything that I could use.

Creating a test with a name xxx.XLastTestthat makes this task a workaround, but I find it a little ugly (it won’t work if the tests run at the same time, and I don’t even want to see it in our CI).

Any advice is appreciated.

+3
source share
2 answers

- , . . TestRunListener.

- , Eclipse, .

+4

. CI , "".

@RunWith( Suite.class )
@SuiteClasses( { Test1.class, Test2.class } )
public class AllTests {
    @AfterClass
    public static void notifySleepyDeveloper() {
        JOptionPane.showConfirmDialog(null, "Tests are finished", "Test Suite", JOptionPane.PLAIN_MESSAGE);
    }
}
+2

All Articles