title: InitializationError on JUnit test case on Travis CI
body: <p>I'm trying to figure out Travis CI to run my JUnit tests for a Selenium project. The unit tests work when I run them from my machine (in IntelliJ IDEA).</p>
  
  <p>Since the test class doesn't seem to miss anything, I'm wondering why the tests run perfectly fine on my machine, but fail on Travis CI. Is there something wrong with my setup?</p>
  
  <p>The .travis.yml file:</p>
  
  <pre><code>language: java
  
  jdk:
    - oraclejdk8
  
  script: ant test
  
  
  #before_install:
  # - cd java
  </code></pre>
  
  <p>The build file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="bromine" default="test"&gt;
      &lt;property name="dir.src" value="src"/&gt;
      &lt;property name="dir.test.src" value="tests"/&gt;
      &lt;property name="dir.build" value="build"/&gt;
      &lt;property name="dir.build.test" value="build/test"/&gt;
      &lt;property name="dir.classes" value="${dir.build}/classes"/&gt;
      &lt;property name="dir.jar" value="${dir.build}/jar"/&gt;
  
      &lt;path id="classpath.base"&gt;
          &lt;pathelement location="lib/selenium-server-standalone-3.0.0-beta2.jar"/&gt;
      &lt;/path&gt;
  
      &lt;path id="classpath.test"&gt;
          &lt;pathelement location="lib/junit-4.12.jar"/&gt;
          &lt;pathelement location="lib/hamcrest-core-1.3.jar"/&gt;
          &lt;pathelement location="${dir.build}"/&gt;
          &lt;path refid="classpath.base"/&gt;
      &lt;/path&gt;
  
      &lt;target name="test" depends="run, clean"/&gt;
  
      &lt;target name="compile"&gt;
          &lt;mkdir dir="${dir.build}"/&gt;
          &lt;javac srcdir="${dir.src}" destdir="${dir.build}" includeantruntime="false"&gt;
              &lt;classpath refid="classpath.base"/&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;target name="build" depends="compile"&gt;
          &lt;mkdir dir="${dir.build.test}"/&gt;
          &lt;javac srcdir="${dir.test.src}" destdir="${dir.build.test}" includeantruntime="false"&gt;
              &lt;classpath refid="classpath.test"/&gt;
          &lt;/javac&gt;
          &lt;echo message="Build done"/&gt;
      &lt;/target&gt;
  
      &lt;!-- Test and build all files  --&gt;
      &lt;!-- To run this: use "ant" (default) or "ant run" --&gt;
      &lt;target name="run" depends="build"&gt;
          &lt;junit printsummary="on" haltonfailure="yes"&gt;
              &lt;classpath&gt;
                  &lt;path refid="classpath.test"/&gt;
                  &lt;pathelement location="${dir.build.test}"/&gt;
              &lt;/classpath&gt;
              &lt;formatter type="brief" usefile="false"/&gt;
              &lt;batchtest&gt;
                  &lt;fileset dir="${dir.test.src}" includes="**/*Test*.java"/&gt;
              &lt;/batchtest&gt;
          &lt;/junit&gt;
      &lt;/target&gt;
  
      &lt;!-- delete all class files --&gt;
      &lt;!-- To run this: use "ant clean" --&gt;
      &lt;target name="clean"&gt;
          &lt;delete&gt;
              &lt;fileset dir="${basedir}" includes="**/*.class"/&gt;
          &lt;/delete&gt;
          &lt;echo message="Clean done"/&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The failing build output I get from Travis CI:</p>
  
  <pre><code>$ jdk_switcher use oraclejdk8
  Switching to Oracle JDK8 (java-8-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-8-oracle
  $ java -Xmx32m -version
  java version "1.8.0_31"
  Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
  Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
  $ javac -J-Xmx32m -version
  javac 1.8.0_31
  2.33s$ ant test
  Buildfile: /home/travis/build/Thibstars/Bromine/build.xml
  compile:
      [mkdir] Created dir: /home/travis/build/Thibstars/Bromine/build
      [javac] Compiling 21 source files to /home/travis/build/Thibstars/Bromine/build
  build:
      [mkdir] Created dir: /home/travis/build/Thibstars/Bromine/build/test
      [javac] Compiling 2 source files to /home/travis/build/Thibstars/Bromine/build/test
       [echo] Build done
  run:
      [junit] Running NavigatorTests
      [junit] Testsuite: NavigatorTests
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.028 sec
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.028 sec
      [junit] 
      [junit] Testcase: initializationError(NavigatorTests):  Caused an ERROR
      [junit] No runnable methods
      [junit] java.lang.Exception: No runnable methods
      [junit]     at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
      [junit] 
      [junit] 
  BUILD FAILED
  /home/travis/build/Thibstars/Bromine/build.xml:41: Test NavigatorTests failed
  Total time: 2 seconds
  The command "ant test" exited with 1.
  Done. Your build exited with 1.
  </code></pre>
  
  <p>The failing test:</p>
  
  <pre><code>import commands.InitTestFrameworkCommand;
  import navigation.Navigator;
  import navigation.NavigatorFactory;
  import org.junit.Rule;
  import org.testng.annotations.AfterClass;
  import org.testng.annotations.BeforeClass;
  import org.testng.annotations.Test;
  import rules.ScreenShotOnFailure;
  import sut.Environment;
  
  import java.net.MalformedURLException;
  import java.net.URL;
  
  import static org.junit.Assert.assertTrue;
  
  public class NavigatorTests {
  
      @Rule
      public ScreenShotOnFailure failure = new ScreenShotOnFailure();
  
      @BeforeClass
      public static void init() {
          new InitTestFrameworkCommand().execute();
          NavigatorFactory.createNavigator(new Environment("Google", "https://google.com"));
      }
  
      @Test
      public void shouldOpenGoogle() {
          try {
              Navigator.getInstance().navigateTo(new URL("https://google.com"));
          } catch (MalformedURLException e) {
              e.printStackTrace();
          }
  
          assertTrue(Navigator.getInstance().getUrl().startsWith("https://www.google."));
      }
  
      @AfterClass
      public static void tearDown() {
          NavigatorFactory.destroyNavigator();
      }
  }
  </code></pre>