简体   繁体   中英

How to programmatically add items to the junit view in eclipse

I found out how to programmaticaly open the junit view in eclipse

TestRunnerViewPart jViewPart = JUnitPlugin.showTestRunnerViewPartInActivePage();

And now what I want to do is programmatically add some classes in the junit view to run them as junit tests.

I looked in the eclipse.jdt.junit source code but could only find some private methods that might help but nothing else.

Any help or suggestions are appreciated. Thanks.

Maybe you want to have a look at the JUnit run configuration source code instead. That is the code which is executed when you actually run some unit test the normal way in Eclipse, and which in the end opens the Junit view for you.

I like the direction the answer from Bananeweizen, but it's just a link to source code which is barely scratching the surface here.

Try reading ( How does Eclipse actually run Junit tests? ) and its accepted answer for a more in depth explanation of what is going on in the Eclipse JUnit world.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM