[FIXED JENKINS-19752] write in the correct outputstream
Junit 4
[JENKINS-19752] Test
Merge 11fe787 from mathieu-pousse/master #954