I used it in the Polling tests to verify the polling log contains certain strings. Perhaps a bit excessive, but I wanted to make sure that polling was functionally working. I could have mocked the Logger and TaskListener classes, but the TestHangler gives me more flexibility and allows me to use it for any tests where I want to peek into a TaskListener log.
Code changed in jenkins
User: Paul Allen
Path:
src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java
src/test/java/org/jenkinsci/plugins/p4/DefaultEnvironment.java
src/test/java/org/jenkinsci/plugins/p4/client/PollingTest.java
http://jenkins-ci.org/commit/p4-plugin/3d037546b4230d57c5a3045182bde967aab38e23
Log:
Skip probing disabled Jobs.
Includes minor updates to Polling tests.
JENKINS-50634