java - How to run entire JUnit Test Suite from within code -


In eclipse, with JUnit 4, you can right click on a project or package and run as JUnit test Click, and all the JUNET tests within that group, what is the method to do this same thing from within the code?

You can use the packages in Janet as follows:

 < Code> public static zero main (string [] args) {list test = new array list (); Tests.add (TestOne.class); Tests.add (TestTwo.class); (Class test: test) {runTests (test); }} Private static zero runtext (class test) {Results Results = JUnitCore.RunClasses (test); (For failure failure: result.getFailures ()) {System.out.println (failure.toString ()); }}    

Comments

Post a Comment

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -