From b34895092ae0708fa0a0a251505601186774a5a0 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 5 Aug 2011 16:23:27 +0000 Subject: [PATCH] minimalModel ON by default. demotion ON by default (for AJDT as well as LTW) --- tests/bugs1612/pr345515/Code.java | 26 ++ tests/multiIncremental/pr335810/One.java | 16 ++ .../org/aspectj/systemtest/ajc150/ajc150.xml | 2 +- .../ajc150/ataspectj/AtAjSyntaxTests.java | 237 +++++++++--------- .../org/aspectj/systemtest/ajc152/ajc152.xml | 4 +- .../org/aspectj/systemtest/ajc153/ajc153.xml | 10 +- .../ajc153/jdtlikehandleprovider.xml | 44 ++-- .../model/incremental-model-tests.xml | 4 +- .../tools/IncrementalCompilationTests.java | 1 + .../tools/MultiProjectIncrementalTests.java | 8 + .../systemtest/model/ModelTestCase.java | 14 +- .../org/aspectj/systemtest/model/model.xml | 22 +- 12 files changed, 222 insertions(+), 166 deletions(-) create mode 100644 tests/bugs1612/pr345515/Code.java create mode 100644 tests/multiIncremental/pr335810/One.java diff --git a/tests/bugs1612/pr345515/Code.java b/tests/bugs1612/pr345515/Code.java new file mode 100644 index 000000000..942a33770 --- /dev/null +++ b/tests/bugs1612/pr345515/Code.java @@ -0,0 +1,26 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + String string(); +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno2 { + String string() default "abc"; +} + + +public class Code { + + @Anno(string="hello") + int field; + + public static void main(String []argv) { + } + +} + +aspect X { + declare @field: @Anno(string=$1) * *: @Anno2(string=$1); +} diff --git a/tests/multiIncremental/pr335810/One.java b/tests/multiIncremental/pr335810/One.java new file mode 100644 index 000000000..e09e390cc --- /dev/null +++ b/tests/multiIncremental/pr335810/One.java @@ -0,0 +1,16 @@ +import java.util.List; + +public class One { + + @SuppressWarnings("rawtypes") + public void m(List l) { + + } + + @SuppressWarnings("unchecked") + public void m2(List input) { + List ls = (List)input; + System.out.println(ls); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 567c356e7..604738a57 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -1070,7 +1070,7 @@ - + diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjSyntaxTests.java b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjSyntaxTests.java index 4a8635081..10c3fd9ae 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjSyntaxTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjSyntaxTests.java @@ -11,130 +11,135 @@ *******************************************************************************/ package org.aspectj.systemtest.ajc150.ataspectj; +import java.io.File; + import junit.framework.Test; -import org.aspectj.testing.XMLBasedAjcTestCase; -import java.io.File; +import org.aspectj.testing.XMLBasedAjcTestCase; /** * A suite for @AspectJ aspects located in java5/ataspectj - * + * * @author Alexandre Vasseur */ public class AtAjSyntaxTests extends XMLBasedAjcTestCase { - public static Test suite() { - return XMLBasedAjcTestCase.loadSuite(AtAjSyntaxTests.class); - } - - protected File getSpecFile() { - return new File("../tests/src/org/aspectj/systemtest/ajc150/ataspectj/syntax.xml"); - } - - public void testSimpleBefore() { - runTest("SimpleBefore"); - } - - public void testSimpleAfter() { - runTest("SimpleAfter"); - } - - public void testSingletonAspectBindings() { - //Note AV: uncomment setReporting to get it in modules/tests folder - // org.aspectj.asm.AsmManager.setReporting("debug.txt",true,true,true,true); - runTest("singletonAspectBindings"); - // same stuff with AJ - //org.aspectj.asm.AsmManager.setReporting("debug-aj.txt",true,true,true,true); - //runTest("singletonAspectBindings2"); - - } - - public void testCflowTest() { - runTest("CflowTest"); - } - - public void testPointcutReferenceTest() { - runTest("PointcutReferenceTest"); - } - - public void testXXJoinPointTest() { - runTest("XXJoinPointTest"); - } - - public void testPrecedenceTest() { - runTest("PrecedenceTest"); - } - - public void testAfterXTest() { - runTest("AfterXTest"); - } - - public void testBindingTest() { - runTest("BindingTest"); - } - - public void testBindingTestNoInline() { - runTest("BindingTest no inline"); - } - - public void testPerClause() { - runTest("PerClause"); - } - - public void testAroundInlineMunger_XnoInline() { - runTest("AroundInlineMunger -XnoInline"); - } - - public void testAroundInlineMunger() { - runTest("AroundInlineMunger"); - } - - public void testAroundInlineMunger2() { - runTest("AroundInlineMunger2"); - } - - public void testDeow() { - runTest("Deow"); - } - - public void testSingletonInheritance() { - runTest("singletonInheritance"); - } - - public void testPerClauseInheritance() { - runTest("perClauseInheritance"); - } - - public void testIfPointcut() { - runTest("IfPointcutTest"); - } - - public void testIfPointcut2() { - runTest("IfPointcut2Test"); - } - - public void testMultipleBinding() { - runTest("MultipleBinding"); - } - - public void testBug104212() { - runTest("Bug104212"); - } - - public void testDeclareParentsInterface() { - runTest("DeclareParentsInterface"); - } - - public void testDeclareParentsImplements() { - runTest("DeclareParentsImplements"); - } - - public void testAbstractAspectNPE() { - runTest("AbstractAspectNPE"); - } - - public void testAbstractInherited() { - runTest("AbstractInherited"); - } + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(AtAjSyntaxTests.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc150/ataspectj/syntax.xml"); + } + + public void testSimpleBefore() { + runTest("SimpleBefore"); + } + + public void testSimpleAfter() { + runTest("SimpleAfter"); + } + + public void testSingletonAspectBindings() { + // Note AV: uncomment setReporting to get it in modules/tests folder + // org.aspectj.asm.AsmManager.setReporting("debug.txt",true,true,true,true); + runTest("singletonAspectBindings"); + // same stuff with AJ + // org.aspectj.asm.AsmManager.setReporting("debug-aj.txt",true,true,true,true); + // runTest("singletonAspectBindings2"); + + } + + public void testCflowTest() { + runTest("CflowTest"); + } + + public void testPointcutReferenceTest() { + runTest("PointcutReferenceTest"); + } + + public void testXXJoinPointTest() { + runTest("XXJoinPointTest"); + } + + public void testPrecedenceTest() { + runTest("PrecedenceTest"); + } + + public void testAfterXTest() { + runTest("AfterXTest"); + } + + public void testBindingTest() { + runTest("BindingTest"); + } + + public void testBindingTestNoInline() { + runTest("BindingTest no inline"); + } + + public void testPerClause() { + runTest("PerClause"); + } + + public void testAroundInlineMunger_XnoInline() { + runTest("AroundInlineMunger -XnoInline"); + } + + public void testAroundInlineMunger() { + try { + runTest("AroundInlineMunger"); + } finally { + System.out.println(ajc.getLastCompilationResult().getStandardError()); + } + } + + public void testAroundInlineMunger2() { + runTest("AroundInlineMunger2"); + } + + public void testDeow() { + runTest("Deow"); + } + + public void testSingletonInheritance() { + runTest("singletonInheritance"); + } + + public void testPerClauseInheritance() { + runTest("perClauseInheritance"); + } + + public void testIfPointcut() { + runTest("IfPointcutTest"); + } + + public void testIfPointcut2() { + runTest("IfPointcut2Test"); + } + + public void testMultipleBinding() { + runTest("MultipleBinding"); + } + + public void testBug104212() { + runTest("Bug104212"); + } + + public void testDeclareParentsInterface() { + runTest("DeclareParentsInterface"); + } + + public void testDeclareParentsImplements() { + runTest("DeclareParentsImplements"); + } + + public void testAbstractAspectNPE() { + runTest("AbstractAspectNPE"); + } + + public void testAbstractInherited() { + runTest("AbstractInherited"); + } } diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index ecd73f106..c060cd614 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -766,10 +766,10 @@ - + - + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index 174c35627..5d23b0f1d 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -16,7 +16,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -835,7 +835,7 @@ - + @@ -869,11 +869,11 @@ - + - + diff --git a/tests/src/org/aspectj/systemtest/ajc153/jdtlikehandleprovider.xml b/tests/src/org/aspectj/systemtest/ajc153/jdtlikehandleprovider.xml index fa4854194..2ba1b993b 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/jdtlikehandleprovider.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/jdtlikehandleprovider.xml @@ -117,23 +117,23 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/tests/src/org/aspectj/systemtest/incremental/model/incremental-model-tests.xml b/tests/src/org/aspectj/systemtest/incremental/model/incremental-model-tests.xml index 3f00f0803..71e706209 100644 --- a/tests/src/org/aspectj/systemtest/incremental/model/incremental-model-tests.xml +++ b/tests/src/org/aspectj/systemtest/incremental/model/incremental-model-tests.xml @@ -75,7 +75,7 @@ - + @@ -87,7 +87,7 @@ - + diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java index a9f45ef6c..c3e44bcbc 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java @@ -180,6 +180,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental public void testModelStructure_333123() throws Exception { String p = "pr333123"; initialiseProject(p); + configureNonStandardCompileOptions(p, "-Xset:minimalModel=false"); build(p); checkWasFullBuild(); printModel(p); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 8c37e68d8..bd8b718d4 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -410,6 +410,8 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa public void testQualifiedInnerTypeRefs_269082() throws Exception { String p = "pr269082"; initialiseProject(p); + configureNonStandardCompileOptions(p, "-Xset:minimalModel=false"); + build(p); printModel(p); @@ -1294,6 +1296,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa public void testImportHandles() { String p = "Imports"; initialiseProject(p); + configureNonStandardCompileOptions(p, "-Xset:minimalModel=false"); build(p); IProgramElement root = getModelFor(p).getHierarchy().getRoot(); @@ -1732,6 +1735,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa public void testHandleQualification_pr265993() throws IOException { String p = "pr265993"; initialiseProject(p); + configureNonStandardCompileOptions(p, "-Xset:minimalModel=false"); build(p); IProgramElement root = getModelFor(p).getHierarchy().getRoot(); // dumptree(getModelFor(p).getHierarchy().getRoot(), 0); @@ -2276,6 +2280,8 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa public void testBuildingTwoProjectsAndVerifyingModel() { initialiseProject("P1"); initialiseProject("P2"); + configureNonStandardCompileOptions("P1", "-Xset:minimalModel=false"); + configureNonStandardCompileOptions("P2", "-Xset:minimalModel=false"); build("P1"); checkForNode(getModelFor("P1"), "pkg", "C", true); @@ -2295,6 +2301,8 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa public void testBuildingTwoProjectsAndVerifyingStuff() { initialiseProject("P1"); initialiseProject("P2"); + configureNonStandardCompileOptions("P1", "-Xset:minimalModel=false"); + configureNonStandardCompileOptions("P2", "-Xset:minimalModel=false"); build("P1"); checkForNode(getModelFor("P1"), "pkg", "C", true); diff --git a/tests/src/org/aspectj/systemtest/model/ModelTestCase.java b/tests/src/org/aspectj/systemtest/model/ModelTestCase.java index 2cf4666a7..0e443c3d3 100644 --- a/tests/src/org/aspectj/systemtest/model/ModelTestCase.java +++ b/tests/src/org/aspectj/systemtest/model/ModelTestCase.java @@ -133,9 +133,9 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase { private void compareModel(File expectedF) { if (debugTest) System.out.println("comparing with model in file " + expectedF.getAbsolutePath()); - List fileContents = new ArrayList(); + List fileContents = new ArrayList(); try { - String sandboxDir = ajc.getSandboxDirectory().getAbsolutePath(); + // String sandboxDir = ajc.getSandboxDirectory().getAbsolutePath(); String modelOutput = modelFilename; // Load the file with the expected output BufferedReader expect = new BufferedReader(new FileReader(expectedF)); @@ -144,13 +144,13 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase { while ((expectedLine = expect.readLine()) != null) { fileContents.add(expectedLine); } - List expectedFileContents = new ArrayList(); + List expectedFileContents = new ArrayList(); expectedFileContents.addAll(fileContents); // Load the file with the output from this test run BufferedReader found = new BufferedReader(new FileReader(new File(modelOutput))); String foundLine = null; - List foundFileContents = new ArrayList(); + List foundFileContents = new ArrayList(); while ((foundLine = found.readLine()) != null) { // int i = foundLine.indexOf(sandboxDir); // if (i == -1) { @@ -168,7 +168,7 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase { } // iterate over what we found - for (Iterator iter = foundFileContents.iterator(); iter.hasNext();) { + for (Iterator iter = foundFileContents.iterator(); iter.hasNext();) { String line = (String) iter.next(); if (debugTest) System.err.println("looking at model entry: " + line); @@ -177,7 +177,7 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase { if (debugTest) { System.err.println("couldn't find: " + line); - for (Iterator iterator = fileContents.iterator(); iterator.hasNext();) { + for (Iterator iterator = fileContents.iterator(); iterator.hasNext();) { String element = (String) iterator.next(); System.err.println("compared with: " + element); } @@ -192,7 +192,7 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase { } if (debugTest && !fileContents.isEmpty()) { - for (Iterator iter = fileContents.iterator(); iter.hasNext();) { + for (Iterator iter = fileContents.iterator(); iter.hasNext();) { String element = (String) iter.next(); System.err.println("remaining: " + element); } diff --git a/tests/src/org/aspectj/systemtest/model/model.xml b/tests/src/org/aspectj/systemtest/model/model.xml index c4ce0bcb1..811b78254 100644 --- a/tests/src/org/aspectj/systemtest/model/model.xml +++ b/tests/src/org/aspectj/systemtest/model/model.xml @@ -11,15 +11,15 @@ - + - + - + @@ -37,13 +37,13 @@ - + - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -81,18 +81,18 @@ - + - + - + @@ -102,7 +102,7 @@ - + -- 2.39.5