From f54f44a104806b06ab72b223c55d71476c95415d Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 21 Jan 2013 17:56:20 -0800 Subject: Allow code generation hints for generated compiler names --- .../newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'testing') 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 */ -- cgit v1.2.3