title: How do I control order of test execution within a single integration test file?
body: <p>I’m using Maven 3.0.3, Failsafe plugin v2.17 and JUnit 4.11. Currently I have an integration test with tests in the following order</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  public class MyTests {
  
      @Test
      public final void testAdd() {
          …
      }
  
      @Test
      public final void testUpdate() {
          …
      }
  
      @Test
      public final void testDelete() {
          …
      }
  </code></pre>
  
  <p>Currently when I run the tests through Maven as part of a “mvn clean install” run, the “testDelete” is getting run before the “testAdd” or “testUpdate”.  If I change the name to “testZZZDelete”, then it gets run last but I don’t like that.</p>
  
  <p>How do I get the tests to run in the order that I specify them in the file?  My failsafe configuration is like so:</p>
  
  <pre><code>&lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.17&lt;/version&gt;
          &lt;configuration&gt;
                  &lt;reuseForks&gt;true&lt;/reuseForks&gt;
                  &lt;argLine&gt;-Xmx4096m -XX:MaxPermSize=512M ${itCoverageAgent}&lt;/argLine&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
                  &lt;execution&gt;
                          &lt;goals&gt;
                                  &lt;goal&gt;integration-test&lt;/goal&gt;
                                  &lt;goal&gt;verify&lt;/goal&gt;
                          &lt;/goals&gt;
                  &lt;/execution&gt;
          &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>