1 28 29 package com.idaremedia.antx.ut; 30 31 import junit.framework.TestResult; 32 import junit.framework.TestSuite; 33 34 44 45 public final class HTCUtils 46 { 47 48 49 public static final String OK= "OK"; 50 51 public static final String NOT_OK= "NOT-OK"; 52 53 59 public static final void quickCheck(TestSuite tests) 60 { 61 try{ 62 TestResult r= new HAbortingResult(1,1); 63 tests.run(r); 64 if (r.wasSuccessful()) { 65 System.out.println(OK); 66 System.exit(0); 67 } else { 68 java.util.Enumeration e; 69 if (r.errorCount()>0) { 70 System.out.println("Had "+r.errorCount()+" Errors"); 71 e= r.errors(); 72 while (e.hasMoreElements()) { 73 System.out.println(e.nextElement()); 74 } 75 } 76 if (r.failureCount()>0) { 77 System.out.println("Had "+r.failureCount()+" Failures"); 78 e= r.failures(); 79 while (e.hasMoreElements()) { 80 System.out.println(e.nextElement()); 81 } 82 } 83 } 84 }catch(Exception anyx){} 85 System.out.println(NOT_OK); 86 System.exit(-1); 87 } 88 89 private HTCUtils() 91 {} 92 } 93 94 95 | Popular Tags |