@Override public void run() { try { if (this.testClasses.length == 0) { System.out.println("No tests found"); } else { ClassLoader contextClassLoader = Thread.currentThread() .getContextClassLoader(); Class<?> delegateClass = contextClassLoader .loadClass(DelegateTestRunner.class.getName()); Class<?> resultClass = contextClassLoader .loadClass("org.junit.runner.Result"); Method runMethod = delegateClass.getMethod("run", Class[].class, resultClass); Object result = resultClass.newInstance(); runMethod.invoke(null, this.testClasses, result); boolean wasSuccessful = (Boolean) resultClass .getMethod("wasSuccessful").invoke(result); if (!wasSuccessful) { throw new RuntimeException("Tests Failed."); } } } catch (Exception ex) { ReflectionUtils.rethrowRuntimeException(ex); } }