public TestSuite(final Class theClass) { fName= theClass.getName(); try { getTestConstructor(theClass); } catch (NoSuchMethodException e) { addTest(warning("Class "+theClass.getName()+" has no public constructor TestCase(String name) or TestCase()")); return; }  if (!Modifier.isPublic(theClass.getModifiers())) { addTest(warning("Class "+theClass.getName()+" is not public")); return; }  Class superClass= theClass; Vector names= new Vector(); while (Test.class.isAssignableFrom(superClass)) { Method[] methods= superClass.getDeclaredMethods(); for (int i= 0; i < methods.length; i++) { addTestMethod(methods[i], names, theClass); } superClass= superClass.getSuperclass(); } if (fTests.size() == 0) addTest(warning("No tests found in "+theClass.getName()));
public TestSuite() {
	public TestSuite(final Class theClass) {		fName= theClass.getName();		try {			getTestConstructor(theClass); // Avoid generating multiple error messages		} catch (NoSuchMethodException e) {			addTest(warning("Class "+theClass.getName()+" has no public constructor TestCase(String name) or TestCase()"));			return;		}		if (!Modifier.isPublic(theClass.getModifiers())) {			addTest(warning("Class "+theClass.getName()+" is not public"));			return;		}		Class superClass= theClass;		Vector names= new Vector();		while (Test.class.isAssignableFrom(superClass)) {			Method[] methods= superClass.getDeclaredMethods();			for (int i= 0; i < methods.length; i++) {				addTestMethod(methods[i], names, theClass);			}			superClass= superClass.getSuperclass();		}		if (fTests.size() == 0)			addTest(warning("No tests found in "+theClass.getName()));	}