title: Junit External Resource @Rule Order
body: <p>I want to use multiple external resources in my test class, but I have a problem with ordering of external resources. </p>
  
  <p>Here is code snippet :</p>
  
  <pre><code>public class TestPigExternalResource {
  
       // hadoop external resource, this should start first
       @Rule
       public HadoopSingleNodeCluster cluster = new HadoopSingleNodeCluster();
  
       // pig external resourcem, this should wait until hadoop external resource starts
       @Rule
       public  PigExternalResource pigExternalResource = new PigExternalResource(); 
  
       ...  
  }
  </code></pre>
  
  <p>The problem is it tries to start pig before hadoop started, therefore I could not connect local hadoop single node cluster. </p>
  
  <p>Is there any way to order rules of junit?</p>
  
  <p>thanks</p>