View Javadoc

1   package org.apache.mina.filter.logging;
2   
3   import junit.framework.JUnit4TestAdapter;
4   import junit.framework.Test;
5   import junit.textui.TestRunner;
6   
7   import java.util.Date;
8   
9   public class LoadTestMdcInjectionFilter {
10  
11      /**
12       * The MdcInjectionFilterTest is unstable, it fails sporadically (and only on Windows ?)
13       * This is a quick and dirty program to run the MdcInjectionFilterTest many times.
14       * To be removed once we consider DIRMINA-784 to be fixed
15       *
16       */
17      public static void main(String[] args) {
18          TestRunner runner = new TestRunner();
19  
20          try {
21              for (int i=0; i<50000; i++) {
22                  Test test = new JUnit4TestAdapter(MdcInjectionFilterTest.class);
23                  runner.doRun(test);
24                  System.out.println("i = " + i + " " + new Date());
25              }
26              System.out.println("done");
27          } catch (Exception e) {
28              e.printStackTrace();
29          }
30          System.exit(0);
31  
32      }
33  }