title: Using JunitCore for tests in different projects
body: <p>Background:</p>
  
  <p>I am currently working on a project in eclipse that programatically executes JUnit tests that are pushed to a server.</p>
  
  <p>So far everything works but I would like to know the results of the tests (specifically any failures) so I can push them out to an email. Right now the tests just output to the console but that doesn't seem to give me much output to actually use.</p>
  
  <p>Right now I use the Runtime class to call the tests but that doesn't seem to have the functionality I need for getting results.
  I have looked into the JUnitCore class but can't call any tests outside of the current java project.</p>
  
  <hr>
  
  <p>So my main question would be how can I use JUnitCore to run junit tests in a specific JAR file? Or is there an easier way to approach this problem using a different class?</p>
  
  <p>This is the only thing I've been able to get to work:</p>
  
  <pre class="lang-java prettyprint-override"><code>RunTests()
      {
          junitCore = new JUnitCore();
  
          junitCore.run(AllTests.class);
      }
  </code></pre>
  
  <p>But I would like to do something along the lines of this:</p>
  
  <pre><code>RunTests()
      {
          junitCore = new JUnitCore();
  
          junitCore.run("C:\\$batch\\test\\hil research\\201507071307\\CommsTestRunner\\plugins\\TestSuite\\US35644.class");
      }
  </code></pre>
  
  <p>I would appreciate any suggestions to this problem I am having. I'm an EE and was just introduced to java last month so this has been quite the challenge for me.</p>