title: How to test/validate many spring context?
body: <p>I have created a java component which it will be use by other people.
  And I would like to perform unit-testing to verify many spring configurations.</p>
  
  <p>What I've done today : One class test by configuration file</p>
  
  <ul>
  <li>config 01 : Config01Test.java</li>
  <li>config 02 : Config02Test.java</li>
  <li><p>config 03 : Config03Test.java</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = {"/spring/config01.xml" })
  @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
  public class Config01Test{
  }
  
  @RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = {"/spring/config02.xml" })
  @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
  public class Config02Test{
  
  @RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = {"/spring/config03.xml" })
  @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
  public class Config03Test{}
  </code></pre></li>
  </ul>
  
  <p>But I was wondered if it we could done it in one java class.
  As for example load a different spring context for each test :
  (with a Junit Annotation ... like @LoadSpringContext( blablabla ) </p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)  
  @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) 
  public class ConfigTest{
  
      @LoadSpringContext(locations = {"/spring/config01.xml")
      public testConfig01(){
        // implement test
      }
  
      @LoadSpringContext(locations = {"/spring/config02.xml")
      public testConfig02(){
        // implement test
      }
  
      @LoadSpringContext(locations = {"/spring/config03.xml")
      public testConfig03(){
        // implement test
      }
  }
  </code></pre>
  
  <p>Thanks,</p>