]> source.dussan.org Git - aspectj.git/commitdiff
328121
authoraclement <aclement>
Thu, 28 Apr 2011 20:00:29 +0000 (20:00 +0000)
committeraclement <aclement>
Thu, 28 Apr 2011 20:00:29 +0000 (20:00 +0000)
tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java

index b57998dc11ed9fc51c3d2d972507b3f51e1cea21..c24b5bddc9adc79c5d16b556a3335d2c8f90b27a 100644 (file)
 package org.aspectj.systemtest.ajc151;
 
 import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
 
 import junit.framework.Test;
 
+import org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder;
 import org.aspectj.asm.AsmManager;
 import org.aspectj.asm.IHierarchy;
 import org.aspectj.asm.IProgramElement;
 import org.aspectj.systemtest.ajc150.GenericsTests;
 import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.weaver.UnresolvedType.TypeKind;
 
 public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
@@ -177,11 +181,12 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                GenericsTests.verifyClassSignature(ajc, "ConcreteAspect", "LAbstractAspect<LStudent;>;");
        }
 
-       public void testIProgramElementMethods_pr125295() {
+       public void testIProgramElementMethods_pr125295() throws IOException {
                runTest("new IProgramElement methods");
                IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy();
 
-               IProgramElement pe = top.findElementForType("pkg", "foo");
+               IProgramElement typeC = top.findElementForType("pkg", "C");
+               IProgramElement pe = top.findElementForSignature(typeC, IProgramElement.Kind.METHOD, "foo(int,java.lang.Object)");
                assertNotNull("Couldn't find 'foo' element in the tree", pe);
                // check that the defaults return the fully qualified arg
                assertEquals("foo(int,java.lang.Object)", pe.toLabelString());
@@ -192,7 +197,8 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                assertEquals("C.foo(int,Object)", pe.toLinkLabelString(false));
                assertEquals("foo(int,Object)", pe.toSignatureString(false));
 
-               IProgramElement pe2 = top.findElementForType("pkg", "printParameters");
+               IProgramElement typeA = top.findElementForType("pkg", "A");
+               IProgramElement pe2 = top.findElementForSignature(typeA,IProgramElement.Kind.METHOD,"printParameters(org.aspectj.lang.JoinPoint)");
                assertNotNull("Couldn't find 'printParameters' element in the tree", pe2);
                // the argument is org.aspectj.lang.JoinPoint, check that this is added
                assertFalse("printParameters method should have arguments", pe2.getParameterSignatures().isEmpty());