Code example for Method

Methods: getModifiersgetNamegetParameterTypesgetReturnType

0
			superClass= superClass.getSuperclass();
		} 
	} 
 
	private void addPerformanceTestMethod(Method m, Vector names, Class theClass) {
		String name= m.getName();
		if (names.contains(name))
			return; 
		if (!isPublicMeasureMethod(m)) {
			if (isMeasureMethod(m))
				addTest(warning("Test method isn't public: "+m.getName())); //$NON-NLS-1$
			return; 
		} 
		names.addElement(name);
		addTest(createPerformanceTest(theClass, name));
	} 
 
	private boolean isPublicMeasureMethod(Method m) {
		return isMeasureMethod(m) && Modifier.isPublic(m.getModifiers());
	 } 
 
	private boolean isMeasureMethod(Method m) {
		String name= m.getName();
		Class[] parameters= m.getParameterTypes();
		Class returnType= m.getReturnType();
		return parameters.length == 1 && name.startsWith("measure") && returnType.equals(Void.TYPE) && PerformanceMeter.class.isAssignableFrom(parameters[0]); //$NON-NLS-1$
	 } 
 
	public PerfTestSuite(Class theClass) {
		this(theClass, theClass.getName());