diff options
Diffstat (limited to 'testing/newsrc')
-rw-r--r-- | testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java index d4e46973d..9ecd5d885 100644 --- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -31,6 +31,7 @@ import org.apache.commons.digester.Digester; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.LocalVariable; import org.aspectj.apache.bcel.classfile.LocalVariableTable; +import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; import org.aspectj.tools.ajc.AjcTestCase; @@ -54,7 +55,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { public XMLBasedAjcTestCase() { } - + /** * You must define a suite() method in subclasses, and return the result of calling this method. (Don't you hate static methods * in programming models). For example: @@ -317,6 +318,18 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { return repos.loadClass(clazzname); } + protected Method getMethodStartsWith(JavaClass jc, String prefix) { + Method[] meths = jc.getMethods(); + for (int i = 0; i < meths.length; i++) { + Method method = meths[i]; + System.out.println(method); + if (method.getName().startsWith(prefix)) { + return method; + } + } + return null; + } + /** * Sort it by name then start position */ |