import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;

/**
 * Demonstrates how to run unit tests from Java code.
 * @author Malte Prieß
 */
public class TestRunner {

	public static void main(String[] args) {

		 Result result = JUnitCore.runClasses(MyMathTest.class);

	      for (Failure failure : result.getFailures()) {
	         System.out.println(failure.toString());
	      }
			
	      System.out.println("Test was successfull? " + 
	      ( result.wasSuccessful() ? "Yes" : "No" ) );
	      
	}

}
