From: aclement Date: Thu, 4 Dec 2008 02:04:55 +0000 (+0000) Subject: 249216: handle changes X-Git-Tag: V1_6_3rc1~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c2a2fc097355c1f7c6940d71e266110bfc3cef12;p=aspectj.git 249216: handle changes --- diff --git a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java index 87ac9b321..cc5e25a6c 100644 --- a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java @@ -28,6 +28,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase { +// public void testAtAspectJDecp_pr164016() { +// runTest("ataspectj decp"); +// } + public void testGetMethodNull_pr154427() { runTest("getMethod returning null"); } @@ -40,12 +44,38 @@ public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("mixed styles"); } - /* - * public void testHandles_pr249216c24() { runTest("handles - escaped square brackets"); IHierarchy top = - * AsmManager.lastActiveStructureModel.getHierarchy(); IProgramElement itd = findElementAtLine(top.getRoot(), 4); // - * System.out.println(itd.getHandleIdentifier()); assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[String;>;", - * itd.getHandleIdentifier()); } - */ + public void testHandles_pr249216c24() { + runTest("handles - escaped square brackets"); + IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); + IProgramElement ipe = null; + ipe = findElementAtLine(top.getRoot(), 4);// public java.util.List Ship.i(List[][] u) + assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[Qjava.util.List\\;", ipe.getHandleIdentifier()); + + ipe = findElementAtLine(top.getRoot(), 7);// public java.util.List Ship.i(Set[][] u) + assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[Qjava.util.Set\\;", ipe.getHandleIdentifier()); + + // public java.util.Set i(java.util.Set[][] u) + ipe = findElementAtLine(top.getRoot(), 10); + assertEquals("<{Handles.java}Handles~i~\\[\\[Qjava.util.Set\\;", ipe.getHandleIdentifier()); + + ipe = findElementAtLine(top.getRoot(), 13);// public java.util.Set i(java.util.Set[][] u,int i) { + assertEquals("<{Handles.java}Handles~i~\\[\\[Qjava.util.Set\\;~I", ipe.getHandleIdentifier()); + + ipe = findElementAtLine(top.getRoot(), 16);// public java.util.Set i(java.util.Set[][] u,int i) { + assertEquals("<{Handles.java}Handles~i2~\\[\\[Qjava.util.Set\\<+QCollection\\;>;", ipe.getHandleIdentifier()); + + ipe = findElementAtLine(top.getRoot(), 19);// public java.util.Set i3(java.util.Set>[][] u) + assertEquals("<{Handles.java}Handles~i3~\\[\\[Qjava.util.Set\\<+QCollection\\<\\[QString;>;>;", ipe.getHandleIdentifier()); + + ipe = findElementAtLine(top.getRoot(), 22); + assertEquals("<{Handles.java}Handles~i4~Qjava.util.Set\\<+QCollection\\;>;", ipe.getHandleIdentifier()); + + ipe = findElementAtLine(top.getRoot(), 25); + assertEquals("<{Handles.java}Handles~i5~Qjava.util.Set\\<*>;", ipe.getHandleIdentifier()); + + } + public void testFQType_pr256937() { runTest("fully qualified return type"); IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index f3bd75376..d5760ad61 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -212,6 +212,18 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // Ajc.dumpAJDEStructureModel(getModelFor("pr253067"), "after inc build where first advised line is gone"); } + public void testHandles_DeclareAnno_pr249216_c9() { + String p = "pr249216"; + initialiseProject(p); + build(p); + IProgramElement root = getModelFor(p).getHierarchy().getRoot(); + IProgramElement code = findElementAtLine(root, 4); + // the @ should be escapified + assertEquals("=pr249216<{Deca.java}X`declare \\@type", code.getHandleIdentifier()); + // dumptree(getModelFor(p).getHierarchy().getRoot(), 0); + // Ajc.dumpAJDEStructureModel(getModelFor(p), "after inc build where first advised line is gone"); + } + public void testNullDelegateBrokenCode_pr251940() { String p = "pr251940"; initialiseProject(p);