Example #1
0
 public virtual Result runMain(JUnitSystem system, params string[] args)
 {
   system.@out().println(new StringBuilder().append("JUnit version ").append(junit.runner.Version.id()).toString());
   ArrayList arrayList1 = new ArrayList();
   ArrayList arrayList2 = new ArrayList();
   string[] strArray = args;
   int length = strArray.Length;
   for (int index = 0; index < length; ++index)
   {
     string name = strArray[index];
     ClassNotFoundException notFoundException1;
     try
     {
       ((List) arrayList1).add((object) Class.forName(name, JUnitCore.__\u003CGetCallerID\u003E()));
       continue;
     }
     catch (ClassNotFoundException ex)
     {
       int num = 1;
       notFoundException1 = (ClassNotFoundException) ByteCodeHelper.MapException<ClassNotFoundException>((Exception) ex, (ByteCodeHelper.MapFlags) num);
     }
     ClassNotFoundException notFoundException2 = notFoundException1;
     system.@out().println(new StringBuilder().append("Could not find class: ").append(name).toString());
     Failure failure = new Failure(Description.createSuiteDescription(name, new Annotation[0]), (Exception) notFoundException2);
     ((List) arrayList2).add((object) failure);
   }
   this.addListener((RunListener) new TextListener(system));
   Result result = this.run((Class[]) ((List) arrayList1).toArray((object[]) new Class[0]));
   Iterator iterator = ((List) arrayList2).iterator();
   while (iterator.hasNext())
   {
     Failure failure = (Failure) iterator.next();
     result.getFailures().add((object) failure);
   }
   return result;
 }
Example #2
0
 public TextListener(JUnitSystem system)
   : this(system.@out())
 {
 }
Example #3
0
 public static void runMainAndExit(JUnitSystem system, params string[] args)
 {
   Result result = new JUnitCore().runMain(system, args);
   system.exit(!result.wasSuccessful() ? 1 : 0);
 }