}
@Test
public void get_method_location() throws Exception
{
ClassFactory factory = new ClassFactoryImpl();
Class target = LineNumberBean.class;
Method m = target.getMethod("fred");
// 21 is the line containing the close brace
assertEquals(
factory.getMethodLocation(m).toString(),
"org.apache.tapestry.ioc.internal.services.LineNumberBean.fred() (at LineNumberBean.java:25)");
m = target.getMethod("betty", String.class, int.class);
// 25 is the line of the return statement
assertEquals(
factory.getMethodLocation(m).toString(),
"org.apache.tapestry.ioc.internal.services.LineNumberBean.betty(String, int) (at LineNumberBean.java:29)");
m = target.getDeclaredMethod("wilma", int[].class, Double[][][].class);
assertEquals(
factory.getMethodLocation(m).toString(),
"org.apache.tapestry.ioc.internal.services.LineNumberBean.wilma(int[], Double[][][]) (at LineNumberBean.java:34)");
}