/* 
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 */
package net.grinder.script;

/**
 * {@link Test} extension to be distinguishable from {@link org.junit.Test} in JUnit4 tests.
 * 
 * <pre>
 * request = new HTTPRequest();
 * GTest(1, &quot;Test&quot;).record(request);
 * </pre>
 * 
 * @author JunHo Yoon
 * @since 3.2
 */
public class GTest extends Test {

	/** UID. */
	private static final long serialVersionUID = 8370116882992463352L;

	/**
	 * Constructor.
	 * 
	 * @param number
	 *            the test number
	 * @param description
	 *            test description
	 */
	public GTest(int number, String description) {
		super(number, description);
	}

}

@@ -604,16 +604,52 @@
 ipt;%0D%0A%0D%0A
+import java.lang.reflect.Method;%0D%0A%0D%0A
 /**%0D%0A * 
@@ -1246,11 +1246,1187 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09/**%0D%0A%09 * Instrument the supplied %7B@code target%7D object's method which has the given name. Subsequent%0D%0A%09 * calls to %7B@code target%7D's given method will be recorded against the statistics for this%0D%0A%09 * %7B@code Test%7D.%0D%0A%09 * %0D%0A%09 * @param target%0D%0A%09 *            Object to instrument.%0D%0A%09 * @param methodName%0D%0A%09 *            method name to instrument%0D%0A%09 * @throws NonInstrumentableTypeException%0D%0A%09 *             If %7B@code target%7D could not be instrumented.%0D%0A%09 * @since 3.2.1%0D%0A%09 */%0D%0A%09public final void record(Object target, String methodName) throws NonInstrumentableTypeException %7B%0D%0A%09%09record(target, new MethodNameFilter(methodName));%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Method name filter.%0D%0A%09 * %0D%0A%09 * @author junoyoon%0D%0A%09 * @since 3.2.1%0D%0A%09 */%0D%0A%09static class MethodNameFilter implements InstrumentationFilter %7B%0D%0A%09%09private String methodName;%0D%0A%0D%0A%09%09/**%0D%0A%09%09 * Constructor.%0D%0A%09%09 * %0D%0A%09%09 * @param methodName%0D%0A%09%09 *            method name%0D%0A%09%09 */%0D%0A%09%09public MethodNameFilter(String methodName) %7B%0D%0A%09%09%09this.methodName = methodName;%0D%0A%09%09%7D%0D%0A%0D%0A%09%09@Override%0D%0A%09%09public boolean matches(Object item) %7B%0D%0A%09%09%09if (item instanceof Method) %7B%0D%0A%09%09%09%09return ((Method) item).getName().equals(methodName);%0D%0A%09%09%09%7D%0D%0A%09%09%09return false;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A
 %7D%0D%0A

Embed method name filter for record