Adding a ProcessListener every time a junit test is run

I'd like to write a plugin that involves doing something whenever a JUnit test completes. It looks like I could do this with a ProcessListener, but I'm not sure what the best way to register a ProcessListener for every JUnit process is.

What I've come up with so far is to have a RunContentListener on each open project. That listener would in turn register a ProcessListener in its contentSelected method whenever it encounters a JUnitProcessHandler. I think this would work okay, except that I found a bug related to RunContentListener ( http://www.jetbrains.net/jira/browse/IDEA-6375 ) so it doesn't always work.

I am curious if anyone has any alternate ways to attach a ProcessListener to every junit process. Thanks for any suggestions.

1 comment

Hi,

I'm looking to try almost exactly the same thing as you are in my plug-in, did you find a better way to install a ProcessListener?

Thanks

0

Please sign in to leave a comment.