From 4a07d09f36126bc829204644536ed29b864cef46 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Fri, 16 Dec 2016 16:32:49 -0800 Subject: reduced min Java version to 1.6 --- .../org/aspectj/testing/XMLBasedAjcTestCase.java | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'testing/newsrc') diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java index 6705a5847..18b9233dc 100644 --- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -24,10 +24,6 @@ import java.util.List; import java.util.Map; import java.util.Stack; -import junit.extensions.TestSetup; -import junit.framework.Test; -import junit.framework.TestSuite; - import org.apache.commons.digester.Digester; import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.JavaClass; @@ -39,6 +35,12 @@ import org.aspectj.apache.bcel.util.SyntheticRepository; import org.aspectj.tools.ajc.AjcTestCase; import org.aspectj.tools.ajc.CompilationResult; import org.aspectj.util.FileUtil; +import org.aspectj.weaver.ResolvedMember; +import org.aspectj.weaver.ResolvedType; + +import junit.extensions.TestSetup; +import junit.framework.Test; +import junit.framework.TestSuite; /** * Root class for all Test suites that are based on an AspectJ XML test suite file. Extends AjcTestCase allowing a mix of @@ -463,5 +465,23 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { return new File(getClass().getResource(resourceName).getFile()); } + protected Method findMethod(JavaClass jc, String string) { + for (Method m : jc.getMethods()) { + if (m.getName().equals(string)) { + return m; + } + } + return null; + } + + protected ResolvedMember findMethod(ResolvedType outerType, String string) { + for (ResolvedMember method: outerType.getDeclaredMethods()) { + if (method.getName().equals(string)) { + return method; + } + } + return null; + } + } -- cgit v1.2.3