diff options
author | aclement <aclement> | 2011-02-02 00:40:45 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-02-02 00:40:45 +0000 |
commit | 835f31af6fe633ace7c710e59c49316a373fba7b (patch) | |
tree | 9fcb2345a4074e222f063380daf4fe748352df4f | |
parent | c602bff8e9c0025a8042de9549f6df731c6d896d (diff) | |
download | aspectj-835f31af6fe633ace7c710e59c49316a373fba7b.tar.gz aspectj-835f31af6fe633ace7c710e59c49316a373fba7b.zip |
335682
-rw-r--r-- | tests/bugs1611/pr335682/foo.jar | bin | 0 -> 2482 bytes | |||
-rw-r--r-- | tests/bugs1611/pr335682/theSource.zip | bin | 0 -> 1293 bytes | |||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml | 3 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java | 62 |
5 files changed, 68 insertions, 1 deletions
diff --git a/tests/bugs1611/pr335682/foo.jar b/tests/bugs1611/pr335682/foo.jar Binary files differnew file mode 100644 index 000000000..ddc5728dc --- /dev/null +++ b/tests/bugs1611/pr335682/foo.jar diff --git a/tests/bugs1611/pr335682/theSource.zip b/tests/bugs1611/pr335682/theSource.zip Binary files differnew file mode 100644 index 000000000..aeb53c1a9 --- /dev/null +++ b/tests/bugs1611/pr335682/theSource.zip diff --git a/tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java b/tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java index 3468d5e48..aee6649d7 100644 --- a/tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java @@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testDeserialization_335682() { + runTest("pr335682"); + } + public void testNPEAddSerialVersionUID_bug335783() { runTest("pr335783"); } diff --git a/tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml b/tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml index 663ad68a0..afcd5a8e5 100644 --- a/tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml +++ b/tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml @@ -2,6 +2,9 @@ <suite> +<ajc-test dir="bugs1611/pr335682" title="pr335682"> + <compile inpath="foo.jar" outjar="bar.jar"/> +</ajc-test> <ajc-test dir="bugs1611/pr335783" title="pr335783"> <compile files="A.java" options="-1.5"/> <compile files="X.aj" options="-1.5 -Xlint:ignore" /> diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java index 29941da8e..247af6369 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java @@ -11,6 +11,7 @@ package org.aspectj.systemtest.incremental.tools; import java.io.File; +import java.util.List; import java.util.Set; import org.aspectj.ajde.core.AjCompiler; @@ -120,6 +121,65 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental assertContains("B.java:4:0::0 Unhandled exception type Exception", getErrorMessages(p).get(0)); } + /** + * Checking if we have the right information on the member nodes. + */ + public void testModelStructure_333123() throws Exception { + String p = "pr333123"; + initialiseProject(p); + build(p); + checkWasFullBuild(); + printModel(p); + + AspectJElementHierarchy model = (AspectJElementHierarchy) getModelFor(p).getHierarchy(); + + IProgramElement ipe = null; + // fieldInt [field] 10 hid:=pr333123<a.b{Code.java[Code^fieldInt + // fieldString [field] 12 hid:=pr333123<a.b{Code.java[Code^fieldString + // fieldCode [field] 14 hid:=pr333123<a.b{Code.java[Code^fieldCode + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldInt"); + assertEquals("I", ipe.getCorrespondingTypeSignature()); + assertEquals("int", ipe.getCorrespondingType(true)); + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldString"); + assertEquals("Ljava/lang/String;", ipe.getCorrespondingTypeSignature()); + assertEquals("java.lang.String", ipe.getCorrespondingType(true)); + // assertEquals("Ljava/lang/String;", ipe.getBytecodeSignature()); + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldCode"); + assertEquals("La/b/Code;", ipe.getCorrespondingTypeSignature()); + assertEquals("a.b.Code", ipe.getCorrespondingType(true)); + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldList"); + // assertEquals("La/b/Code;", ipe.getBytecodeSignature()); + assertEquals("Ljava/util/List<La/b/Code;>;", ipe.getCorrespondingTypeSignature()); + assertEquals("java.util.List<a.b.Code>", ipe.getCorrespondingType(true)); + + // method(java.lang.String) [method] 4 hid:=pr333123<a.b{Code.java[Code~method~QString; + // getInt() [method] 6 hid:=pr333123<a.b{Code.java[Code~getInt + // transform(a.b.Code,java.lang.String,long) [method] 8 hid:=pr333123<a.b{Code.java[Code~transform~QCode;~QString;~J + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~method~QString;"); + assertEquals("(Ljava/lang/String;)V", ipe.getBytecodeSignature()); + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~getInt"); + assertEquals("()I", ipe.getBytecodeSignature()); + + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~transform~QCode;~QString;~J"); + assertEquals("(La/b/Code;Ljava/lang/String;J)La/b/Code;", ipe.getBytecodeSignature()); + + List<char[]> paramSigs = ipe.getParameterSignatures(); + assertEquals("La/b/Code;", new String(paramSigs.get(0))); + assertEquals("Ljava/lang/String;", new String(paramSigs.get(1))); + assertEquals("J", new String(paramSigs.get(2))); + + assertEquals("a.b.Code", ipe.getCorrespondingType(true)); + assertEquals("La/b/Code;", ipe.getCorrespondingTypeSignature()); + + ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~transform2~QList\\<QString;>;"); + assertEquals("(Ljava/util/List;)Ljava/util/List;", ipe.getBytecodeSignature()); + paramSigs = ipe.getParameterSignatures(); + assertEquals("Ljava/util/List<Ljava/lang/String;>;", new String(paramSigs.get(0))); + assertEquals("java.util.List<a.b.Code>", ipe.getCorrespondingType(true)); + assertEquals("Ljava/util/List<La/b/Code;>;", ipe.getCorrespondingTypeSignature()); + + } + // changing method return type parameterization public void testModifiedMethodReturnTypeGenericTypeParameterShouldTriggerError_318884_3() throws Exception { String p = "pr318884_3"; @@ -276,7 +336,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental IProgramElement ipe = model.findElementForHandleOrCreate("=PR278496_1<a.b.c{Code.java", false); assertNull(ipe); } - + // inner classes public void testDeletion_278496_9() throws Exception { String p = "PR278496_9"; |