1 21 package db4ounit; 22 23 import java.io.*; 24 import java.lang.reflect.*; 25 26 29 public class TestPlatform { 30 public static void printStackTrace(Writer writer, Throwable t) { 31 java.io.PrintWriter printWriter = new java.io.PrintWriter (writer); 32 t.printStackTrace(printWriter); 33 printWriter.flush(); 34 } 35 36 public static Writer getStdOut() { 37 return new PrintWriter(System.err); 38 } 39 40 public static boolean isStatic(Method method) { 41 return Modifier.isStatic(method.getModifiers()); 42 } 43 44 public static boolean isPublic(Method method) { 45 return Modifier.isPublic(method.getModifiers()); 46 } 47 48 public static boolean hasParameters(Method method) { 49 return method.getParameterTypes().length > 0; 50 } 51 52 public static void emitWarning(String warning) { 53 System.err.println(warning); 54 } 55 } 56 | Popular Tags |