title: Junit4 run a test class a fixed number of times and display results (eclipse)
body: <p>I want to be able to run a Test class a specified number of times. The class looks like :</p>
  
  <pre class="lang-java prettyprint-override"><code>@RunWith(Parameterized.class)
  public class TestSmithWaterman {
  
      private static String[] args;
      private static SmithWaterman sw;
      private Double[][] h;
      private String seq1aligned;
  
      @Parameters
      public static Collection&lt;Object[]&gt; configs() {
          // h and seq1aligned values 
      }
  
      public TestSmithWaterman(Double[][] h, String seq1aligned) {
          this.h = h;
          this.seq1aligned = seq1aligned;
      }
  
      @BeforeClass
      public static void init() {
          // run smith waterman once and for all
      }
  
      @Test
      @Repeat(value = 20) // does nothing
      // see http://codehowtos.blogspot.gr/2011/04/run-junit-test-repeatedly.html
      public void testCalculateMatrices() {
          assertEquals(h, sw.getH());
      }
  
      @Test
      public void testAlignSeq1() {
          assertEquals(seq1aligned, sw.getSeq1Aligned());
      }
  
      // etc
  }
  </code></pre>
  
  <p>Any of the tests above may fail (concurrency bugs - <strong>EDIT</strong> : the failures provide useful debug info) so I want to be able to run the class multiple times and preferably have the results grouped somehow. Tried the <a href="http://codehowtos.blogspot.gr/2011/04/run-junit-test-repeatedly.html" rel="nofollow noreferrer">Repeat annotation</a> - but this is test specific (and did not really make it work - see above) and struggled with the <a href="http://etutorials.org/Programming/Java+extreme+programming/Chapter+4.+JUnit/4.10+Repeating+Tests/" rel="nofollow noreferrer">RepeatedTest.class</a>, which cannot seem to transfer to Junit 4 - the closest I found on SO is <a href="https://stackoverflow.com/a/1835615/281545">this</a> - but apparently it is Junit3. In Junit4 my suite looks like :</p>
  
  <pre><code>@RunWith(Suite.class)
  @SuiteClasses({ TestSmithWaterman.class })
  public class AllTests {}
  </code></pre>
  
  <p>and I see no way to run this multiple times.
  <a href="https://stackoverflow.com/questions/1492856/easy-way-of-running-the-same-junit-test-over-and-over">Parametrized with empty options</a> is not an option really - as I need my params anyway</p>
  
  <p>So I am stuck hitting Control + F11 in eclipse again and again</p>
  
  <p>Help</p>
  
  <p>EDIT (2017.01.25): someone went ahead and flagged this as duplicate of the question whose accepted answer I explicitly say does not apply here</p>