]> source.dussan.org Git - aspectj.git/commitdiff
249216: handle changes
authoraclement <aclement>
Thu, 4 Dec 2008 02:04:55 +0000 (02:04 +0000)
committeraclement <aclement>
Thu, 4 Dec 2008 02:04:55 +0000 (02:04 +0000)
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index 87ac9b321802363a685887dad4184345b158b93e..cc5e25a6cf11d7c83fc604c7eb9d353692a4aa4b 100644 (file)
@@ -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<String> Ship.i(List<String>[][] u)
+               assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[Qjava.util.List\\<QString;>;", ipe.getHandleIdentifier());
+
+               ipe = findElementAtLine(top.getRoot(), 7);// public java.util.List<String> Ship.i(Set<String>[][] u)
+               assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[Qjava.util.Set\\<QString;>;", ipe.getHandleIdentifier());
+
+               // public java.util.Set<String> i(java.util.Set<String>[][] u)
+               ipe = findElementAtLine(top.getRoot(), 10);
+               assertEquals("<{Handles.java}Handles~i~\\[\\[Qjava.util.Set\\<QString;>;", ipe.getHandleIdentifier());
+
+               ipe = findElementAtLine(top.getRoot(), 13);// public java.util.Set<String> i(java.util.Set<String>[][] u,int i) {
+               assertEquals("<{Handles.java}Handles~i~\\[\\[Qjava.util.Set\\<QString;>;~I", ipe.getHandleIdentifier());
+
+               ipe = findElementAtLine(top.getRoot(), 16);// public java.util.Set<String> i(java.util.Set<String>[][] u,int i) {
+               assertEquals("<{Handles.java}Handles~i2~\\[\\[Qjava.util.Set\\<+QCollection\\<QString;>;>;", ipe.getHandleIdentifier());
+
+               ipe = findElementAtLine(top.getRoot(), 19);// public java.util.Set<String> i3(java.util.Set<? extends
+               // Collection<String[]>>[][] 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\\<QString;>;>;", 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();
index f3bd75376e4637b34d7ecb194b7b96afbe4b679c..d5760ad61379477e46347fc38ae8e175d58f8fdb 100644 (file)
@@ -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);