title: JUnit run suite
body: <p>I wrote a maven-JUnit project that I run through Eclipse.<br>
  I have package with five classes:<br>
  1. JunitTest1.java<br>
  2. JunitTest2.java<br>
  3. Adapter.java,<br>
  4. JunitTestSuite.java<br>
  5. TestRunner.java  </p>
  
  <p>The code in the JunitTestSuite class is  </p>
  
  <pre><code>import org.junit.runner.RunWith;
  import org.junit.runners.Suite;
  import org.junit.runners.Suite.SuiteClasses;
  
  @RunWith(Suite.class)
  @SuiteClasses({ JunitTest1.class, JunitTest2.class })
  public class JunitTestSuite  {
  }
  </code></pre>
  
  <p>the code in the TestRunner class is:  </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(JunitTestSuite.class);
  
    for (Failure failure : result.getFailures()) {
       System.out.println(failure.toString());
    }
    System.out.println(result.wasSuccessful());
     }  
   } 
  </code></pre>
  
  <p>When I run the project as Junit Test, there are 4 test running, the two tests under the suite and each of the tests separately; meaning that each test is ran twice. Any suggestions how to run only the suite?<br>
  thanks!<br>
  Orit</p>