java - TestNG/Junit configure output style in console -
when write , execute test, feel distracting see lot of noise testng writes on terminal this:
[testng] =============================================== [testng] mynamespace.test [testng] tests run: 4, failures: 0, skips: 0 [testng] =============================================== [testng] [testng] this:foo(super=foo(param=abc1234567, name=null, param=null), id=-314151617) [testng] passed: testaverycoolthing on testconstructor(mynamespace.sometest) lines , lines this...
i used (not junit/testng) have test output this:
.......f....e................................. .............................................. ..............................................
so every test passing, write simple dot (it's passing, i'm happy) , failures , errors equivalent letter , later show me output failing tests. achievable testng/junit?
just read docs. need override methods testlisteneradapter
: (taken docs):
here listener displays "." each passed test, "f" each failure , "s" each skip:
public class dottestlistener extends testlisteneradapter { private int m_count = 0; @override public void ontestfailure(itestresult tr) { log("f"); } @override public void ontestskipped(itestresult tr) { log("s"); } @override public void ontestsuccess(itestresult tr) { log("."); } private void log(string string) { system.out.print(string); if (++m_count % 40 == 0) { system.out.println(""); } }
}
Comments
Post a Comment