title: YML file to run JUnit tests
body: <p>I am learning how to set up a CI server, part of it is making a .yml file. All I want to do is for it to build my simple Java project and run the Junit tests giving me the results. I have tried a bunch of different ways to implement this but nothing is working. </p>
  
  <p>.yml </p>
  
  <pre><code>language: java
  jdk:
   - oraclejdk7
  script: java TestRunner
  </code></pre>
  
  <p>TestRunner.java</p>
  
  <pre><code>import org.junit.runner.JUnitCore;
  import org.junit.runner.Result;
  import org.junit.runner.notification.Failure;
  
  public class TestRunner {
     public static void main(String[] args) {
        Result result = JUnitCore.runClasses(ForwardingListTest.class);
  
        for (Failure failure : result.getFailures()) {
           System.out.println(failure.toString());
        }     
        System.out.println(result.wasSuccessful());
     }
  }
  </code></pre>
  
  <p>The CI server is giving me <code>Error: Could not find or load main class TestRunner</code> error, which does not make sense because TestRunner has a main method. </p>
  
  <p>Any help on how I can fix the .yml file to execute junit test would be great.</p>