1
votes

I have 5 test classes and each testclasses include 2 @Test

example:

    class1:
    @Test
    public void c1_test1(){
    //...
    }
    @Test
    public void c1_test2(){
    //...
    }

    class2:
    @Test
    public void c2_test1(){
    //...
    }
    @Test
    public void c2_test2(){
    //...
    }
    ...

I want to get tests result after all Test Suite(All test classes) run Such As:

Class1: c1_test1 : failed Class1: c1_test2 : success

Class2: c2_test1 : failed class2: c2_test2 : success

tried RunListener class but I got results after test level,but how to get results after suite level. Is it possible in Junit?

1
What do you use for running your tests?Boris van Katwijk
I use maven, junit and selenium. I want to get test results and send email whole tests result. @BorisvanKatwijkRBA
Do you want to code a reporter or use one? If it's the latter, maybe stackoverflow.com/questions/2846493/… could be of help.Boris van Katwijk

1 Answers

1
votes

Its possible to implement a listener in a way that it will store the results in some "predefined" file or series of files so that after all the tests will be done the result will appear in a file.

Another option is to use the output of the build tool, for example in maven, when you work with surefire/failsafe plugins it produces a "surefire-reports" where the same information is accessible. If you use it - check the "target" folder.