diff options
59 files changed, 3537 insertions, 3348 deletions
diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java b/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java index d2081df15..0376836c1 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.ajde.core; @@ -61,7 +61,7 @@ public class TestCompilerConfiguration implements ICompilerConfiguration { public String getClasspath() { StringBuilder classpath = new StringBuilder(); classpath.append(projectPath); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { classpath.append(File.pathSeparator).append(LangUtil.getJrtFsFilePath()); } else { classpath.append(File.pathSeparator).append(System.getProperty("sun.boot.class.path")); diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java index a6fec514d..4dd195aed 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.utils; @@ -67,7 +67,7 @@ public class TestCompilerConfiguration implements ICompilerConfiguration { public String getClasspath() { String cp = projectPath + File.pathSeparator + System.getProperty("sun.boot.class.path") + File.pathSeparator + TestUtil.aspectjrtClasspath(); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { cp = LangUtil.getJrtFsFilePath()+File.pathSeparator+cp; } return cp; diff --git a/ajdoc/pom.xml b/ajdoc/pom.xml index fa24692c9..e92109017 100644 --- a/ajdoc/pom.xml +++ b/ajdoc/pom.xml @@ -35,13 +35,11 @@ <version>${project.version}</version> </dependency> <dependency> - - <!-- enables easy dependency on tools.jar --> - <groupId>com.github.olivergondza</groupId> - <artifactId>maven-jdk-tools-wrapper</artifactId> - <version>0.1</version> -</dependency> - + <!-- enables easy dependency on tools.jar --> + <groupId>com.github.olivergondza</groupId> + <artifactId>maven-jdk-tools-wrapper</artifactId> + <version>0.1</version> + </dependency> <dependency> <groupId>asm</groupId> <artifactId>asm</artifactId> @@ -49,5 +47,45 @@ <scope>system</scope> <systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath> </dependency> + + <!-- Dependencies needed for running tests in this module independently of complete reactor build --> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>org.eclipse.jdt.core</artifactId> + <version>1.0</version> + <scope>system</scope> + <systemPath>${project.basedir}/../org.eclipse.jdt.core/jdtcore-for-aspectj.jar</systemPath> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>org.aspectj.matcher</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>weaver</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>bcel-builder</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>runtime</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>testing-util</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> </project> diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java index 42d029e06..3e3a05c07 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -31,6 +31,7 @@ import org.aspectj.asm.AsmManager; import org.aspectj.asm.HierarchyWalker; import org.aspectj.asm.IProgramElement; import org.aspectj.asm.IRelationship; +import org.aspectj.util.LangUtil; import org.aspectj.util.TypeSafeEnum; /** @@ -38,6 +39,10 @@ import org.aspectj.util.TypeSafeEnum; */ class HtmlDecorator { + public static final String TYPE_NAME_LABEL = LangUtil.is15VMOrGreater() + ? "type-name-label" + : (LangUtil.is1dot8VMOrGreater() ? "typeNameLabel" : "strong"); + private static final String POINTCUT_DETAIL = "Pointcut Detail"; private static final String ADVICE_DETAIL = "Advice Detail"; private static final String DECLARE_DETAIL = "Declare Detail"; @@ -267,19 +272,14 @@ class HtmlDecorator { } } else { - // Java8: - // <pre>static class <span class="typeNameLabel">ClassA.InnerAspect</span> - classStartIndex = fileContents.toString().indexOf("class <span class=\"typeNameLabel\">"); - if (classStartIndex == -1) { - // Java7: 464604 - // <pre>public class <span class="strong">Azpect</span> - classStartIndex = fileContents.toString().indexOf("class <span class=\"strong\">"); - } + // Java15: <pre>static class <span class="type-name-label">ClassA.InnerAspect</span> + // Java8: <pre>static class <span class="typeNameLabel">ClassA.InnerAspect</span> + // Java7 (464604): <pre>public class <span class="strong">Azpect</span> + classStartIndex = fileContents.toString().indexOf("class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">"); int classEndIndex = fileContents.toString().indexOf("</span>", classStartIndex); if (classEndIndex != -1) { - // Convert it to "aspect <span class="typeNameLabel">ClassA.InnerAspect</span>" - String classLine = fileContents.toString().substring(classStartIndex, classEndIndex); - String aspectLine = "aspect"+fileContents.substring(classStartIndex+5,classEndIndex); + // Convert it to "aspect <span class="TYPE_NAME_LABEL">ClassA.InnerAspect</span>" + String aspectLine = "aspect" + fileContents.substring(classStartIndex + 5, classEndIndex); fileContents.delete(classStartIndex, classEndIndex); fileContents.insert(classStartIndex, aspectLine); } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java index 431018401..3e69f4887 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2005 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2005 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -25,8 +25,8 @@ import org.aspectj.util.LangUtil; public class AjdocOutputChecker { /** - * Checks whether the given html file contains the required String. - * + * Checks whether the given html file contains the required String. + * * @param htmlFile * @param requiredString * @return true if the file contains the given string or @@ -53,12 +53,12 @@ public class AjdocOutputChecker { /** * Returns those strings from the given array which aren't in the html file. - * + * * @param htmlFile * @param an array of requiredStrings * @return a List of those strings not found * @throws Exception - */ + */ public static List<String> getMissingStringsInFile(File htmlFile, String[] requiredStrings) throws Exception { List<String> missingStrings = new ArrayList<>(); for (String string : requiredStrings) { @@ -68,16 +68,16 @@ public class AjdocOutputChecker { } return missingStrings; } - + /** * Checks whether the section of the html file contains the * required String - * + * * @param htmlFile * @param requiredString * @param sectionHeader - * @return true if the file contains the given string within the - * required section or false otherwise (or if the file is null or + * @return true if the file contains the given string within the + * required section or false otherwise (or if the file is null or * not an html file) * @throws Exception */ @@ -91,7 +91,7 @@ public class AjdocOutputChecker { while (line != null) { if (line.contains(sectionHeader)) { String nextLine = reader.readLine(); - while (nextLine != null && + while (nextLine != null && (!nextLine.contains("========"))) { if (nextLine.contains(requiredString)) { reader.close(); @@ -107,11 +107,11 @@ public class AjdocOutputChecker { reader.close(); return false; } - + /** * Returns those strings from the given array which aren't in the - * ajdoc html file - * + * ajdoc html file + * * @param htmlFile * @param an array of requiredStrings * @param sectionHeader @@ -130,10 +130,10 @@ public class AjdocOutputChecker { } /** - * Returns whether the class data section has the expected - * relationship and target i.e. have the relationships been + * Returns whether the class data section has the expected + * relationship and target i.e. have the relationships been * applied to the type. - * + * * @param the ajdoc html file * @param the detail sectionHeader, for example "DECLARE DETAIL SUMMARY" * @param the source of the relationship, for example "Point()" @@ -143,7 +143,7 @@ public class AjdocOutputChecker { * false otherwise */ public static boolean classDataSectionContainsRel(File htmlFile, - HtmlDecorator.HtmlRelationshipKind relationship, + HtmlDecorator.HtmlRelationshipKind relationship, String target) throws Exception { if (((htmlFile == null) || !htmlFile.getAbsolutePath().endsWith("html"))) { return false; @@ -154,7 +154,7 @@ public class AjdocOutputChecker { if (line.contains("START OF CLASS DATA")) { // found the required class data section String subLine = reader.readLine(); - while(subLine != null + while(subLine != null && (!subLine.contains("========"))){ int relIndex = subLine.indexOf(relationship.toString()); int targetIndex = subLine.indexOf(target); @@ -175,11 +175,11 @@ public class AjdocOutputChecker { reader.close(); return false; } - + /** - * Returns whether the supplied source has the expected + * Returns whether the supplied source has the expected * relationship and target within the given detail section - * + * * @param the ajdoc html file * @param the detail sectionHeader, for example "DECLARE DETAIL SUMMARY" * @param the source of the relationship, for example "Point()" @@ -188,9 +188,9 @@ public class AjdocOutputChecker { * @return true if the section contains the expected source/relationship/target, * false otherwise */ - public static boolean detailSectionContainsRel(File htmlFile, - String sectionHeader, String source, - HtmlDecorator.HtmlRelationshipKind relationship, + public static boolean detailSectionContainsRel(File htmlFile, + String sectionHeader, String source, + HtmlDecorator.HtmlRelationshipKind relationship, String target) throws Exception { if (((htmlFile == null) || !htmlFile.getAbsolutePath().endsWith("html"))) { return false; @@ -210,9 +210,9 @@ public class AjdocOutputChecker { nextLine.contains("NAME=\"" + source + "\"") || nextLine.contains("name=\"" + source + "\"")) { // found the required subsection String subLine = reader.readLine(); - while(subLine != null + while(subLine != null && (!subLine.contains("========")) - && (!subLine.contains("NAME") && !subLine.contains("name"))) { + && (!subLine.contains("NAME=") && !subLine.contains("name="))) { int relIndex = subLine.indexOf(relationship.toString()); int targetIndex = subLine.indexOf(target); if ((relIndex != -1) && (targetIndex != -1)) { @@ -239,9 +239,9 @@ public class AjdocOutputChecker { } /** - * Returns whether the supplied source has the expected + * Returns whether the supplied source has the expected * relationship and target within the given summary section - * + * * @param the ajdoc html file * @param the detail sectionHeader, for example "DECLARE SUMMARY" * @param the source of the relationship, for example "Point()" @@ -251,10 +251,10 @@ public class AjdocOutputChecker { * false otherwise */ public static boolean summarySectionContainsRel( - File htmlFile, - String sectionHeader, - String source, - HtmlDecorator.HtmlRelationshipKind relationship, + File htmlFile, + String sectionHeader, + String source, + HtmlDecorator.HtmlRelationshipKind relationship, String target) throws Exception { if (((htmlFile == null) || !htmlFile.getAbsolutePath().endsWith("html"))) { return false; @@ -272,7 +272,7 @@ public class AjdocOutputChecker { if (nextLine.contains(source)) { // found the required subsection String subLine = nextLine; - while(subLine != null + while(subLine != null && (!subLine.contains("========")) && (!subLine.contains("<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">"))) { int relIndex = subLine.indexOf(relationship.toString()); @@ -299,5 +299,5 @@ public class AjdocOutputChecker { reader.close(); return false; } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java index acfb5eda4..0baeb7dcd 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2005 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2005 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -160,12 +160,12 @@ public abstract class AjdocTestCase extends TestCase { if (inputFiles.length == 0) { fail("need to pass some files into ajdoc"); } - if (!sourceLevel.equals("1.3") && - !sourceLevel.equals("1.4") && - !sourceLevel.equals("1.5") && - !sourceLevel.equals("1.6") && - !sourceLevel.equals("1.7") && - !sourceLevel.equals("1.8") && + if (!sourceLevel.equals("1.3") && + !sourceLevel.equals("1.4") && + !sourceLevel.equals("1.5") && + !sourceLevel.equals("1.6") && + !sourceLevel.equals("1.7") && + !sourceLevel.equals("1.8") && !sourceLevel.equals("1.9") && !sourceLevel.equals("10")) { fail("need to pass ajdoc '1.3' > '1.9' as the source level"); @@ -191,12 +191,12 @@ public abstract class AjdocTestCase extends TestCase { if (!visibility.equals("public") && !visibility.equals("protected") && !visibility.equals("private")) { fail("need to pass 'public','protected' or 'private' visibility to ajdoc"); } - if (!sourceLevel.equals("1.3") && - !sourceLevel.equals("1.4") && - !sourceLevel.equals("1.5") && - !sourceLevel.equals("1.6") && - !sourceLevel.equals("1.7") && - !sourceLevel.equals("1.8") && + if (!sourceLevel.equals("1.3") && + !sourceLevel.equals("1.4") && + !sourceLevel.equals("1.5") && + !sourceLevel.equals("1.6") && + !sourceLevel.equals("1.7") && + !sourceLevel.equals("1.8") && !sourceLevel.equals("1.9") && !sourceLevel.startsWith("9") && !sourceLevel.startsWith("10")) { @@ -217,7 +217,7 @@ public abstract class AjdocTestCase extends TestCase { args[2] = sourceLevel; args[3] = "-classpath"; StringBuilder classpath = new StringBuilder(); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { classpath.append(LangUtil.getJrtFsFilePath()).append(File.pathSeparator); } classpath.append(AjdocTests.ASPECTJRT_PATH.getPath()); diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java index ea8568cd8..3be100998 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java @@ -131,9 +131,9 @@ public class CoverageTestCase extends AjdocTestCase { String[] strings = null; strings = new String[] { "Aspect ClassA.InnerAspect", - "<pre>static aspect <span class=\"typeNameLabel\">ClassA.InnerAspect</span>", + "<pre>static aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>", "Class ClassA.InnerAspect", - "<pre>static class <span class=\"typeNameLabel\">ClassA.InnerAspect</span>"}; + "<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>"}; List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); StringBuilder buf = new StringBuilder(); for (String str:missingStrings) { @@ -144,7 +144,7 @@ public class CoverageTestCase extends AjdocTestCase { assertTrue(htmlFile.getName() + " should not have Class as it's title", missingStrings.contains("Class ClassA.InnerAspect")); assertTrue(htmlFile.getName() + " should not have class in its subtitle", - missingStrings.contains("<pre>static class <span class=\"typeNameLabel\">ClassA.InnerAspect</span>")); + missingStrings.contains("<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>")); // get the html file for the enclosing class File htmlFileClass = new File(getAbsolutePathOutdir() + "/foo/ClassA.html"); @@ -160,21 +160,21 @@ public class CoverageTestCase extends AjdocTestCase { if (LangUtil.is13VMOrGreater()) { classStrings = new String[] { "Class ClassA</h1>", - "public abstract class <span class=\"typeNameLabel\">ClassA</span>", + "public abstract class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>", "Aspect ClassA</H2>", - "public abstract aspect <span class=\"typeNameLabel\">ClassA</span>"}; + "public abstract aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>"}; } else { classStrings = new String[] { "Class ClassA</h2>", - "public abstract class <span class=\"typeNameLabel\">ClassA</span>", + "public abstract class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>", "Aspect ClassA</H2>", - "public abstract aspect <span class=\"typeNameLabel\">ClassA</span>"}; + "public abstract aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>"}; } List<String> classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings); assertEquals("There should be 2 missing strings:\n"+classMissing,2,classMissing.size()); assertTrue(htmlFileClass.getName() + " should not have Aspect as it's title",classMissing.contains("Aspect ClassA</H2>")); assertTrue(htmlFileClass.getName() + " should not have aspect in its subtitle", - classMissing.contains("public abstract aspect <span class=\"typeNameLabel\">ClassA</span>")); + classMissing.contains("public abstract aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>")); } /** @@ -657,14 +657,19 @@ public class CoverageTestCase extends AjdocTestCase { String[] strings = null; strings = new String[] { "Aspect PkgVisibleClass.NestedAspect", - "<pre>static aspect <span class=\"typeNameLabel\">PkgVisibleClass.NestedAspect</span>", + "<pre>static aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>", "Class PkgVisibleClass.NestedAspect", - "<pre>static class <span class=\"typeNameLabel\">PkgVisibleClass.NestedAspect</span>"}; - List<String> missing = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); - assertEquals("There should be 2 missing strings",2,missing.size()); - assertTrue(htmlFile.getName() + " should not have Class as it's title",missing.contains("Class PkgVisibleClass.NestedAspect")); + "<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>"}; + List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); + StringBuilder buf = new StringBuilder(); + for (String str:missingStrings) { + buf.append(str).append("\n"); + } + buf.append("HTMLFILE=\n").append(htmlFile).append("\n"); + assertEquals("There should be 2 missing strings",2,missingStrings.size()); + assertTrue(htmlFile.getName() + " should not have Class as it's title",missingStrings.contains("Class PkgVisibleClass.NestedAspect")); assertTrue(htmlFile.getName() + " should not have class in its subtitle", - missing.contains("<pre>static class <span class=\"typeNameLabel\">PkgVisibleClass.NestedAspect</span>")); + missingStrings.contains("<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>")); // get the html file for the enclosing class File htmlFileClass = new File(getAbsolutePathOutdir() + "/PkgVisibleClass.html"); if (!htmlFileClass.exists()) { @@ -678,22 +683,22 @@ public class CoverageTestCase extends AjdocTestCase { if (LangUtil.is13VMOrGreater()) { classStrings = new String[] { "Class PkgVisibleClass</h1>", - "<pre>class <span class=\"typeNameLabel\">PkgVisibleClass</span>", + "<pre>class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>", "Aspect PkgVisibleClass</h2>", - "<pre>aspect <span class=\"typeNameLabel\">PkgVisibleClass</span>"}; + "<pre>aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"}; } else { classStrings = new String[] { "Class PkgVisibleClass</h2>", - "<pre>class <span class=\"typeNameLabel\">PkgVisibleClass</span>", + "<pre>class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>", "Aspect PkgVisibleClass</h2>", - "<pre>aspect <span class=\"typeNameLabel\">PkgVisibleClass</span>"}; + "<pre>aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"}; } List<String> classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings); assertEquals("There should be 2 missing strings",2,classMissing.size()); assertTrue(htmlFileClass.getName() + " should not have Aspect as it's title", classMissing.contains("Aspect PkgVisibleClass</h2>")); assertTrue(htmlFileClass.getName() + " should not have aspect in its subtitle", - classMissing.contains("<pre>aspect <span class=\"typeNameLabel\">PkgVisibleClass</span>")); + classMissing.contains("<pre>aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>")); } /** @@ -716,14 +721,19 @@ public class CoverageTestCase extends AjdocTestCase { String[] strings = null; strings = new String [] { "Aspect ClassWithNestedAspect.NestedAspect", - "<pre>static aspect <span class=\"typeNameLabel\">ClassWithNestedAspect.NestedAspect</span>", + "<pre>static aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>", "Class ClassWithNestedAspect.NestedAspect", - "<pre>static class <span class=\"typeNameLabel\">ClassWithNestedAspect.NestedAspect</span>"}; - List<String> missing = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); - assertEquals("There should be 2 missing strings",2,missing.size()); - assertTrue(htmlFile.getName() + " should not have Class as it's title",missing.contains("Class ClassWithNestedAspect.NestedAspect")); + "<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>"}; + List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); + StringBuilder buf = new StringBuilder(); + for (String str:missingStrings) { + buf.append(str).append("\n"); + } + buf.append("HTMLFILE=\n").append(htmlFile).append("\n"); + assertEquals("There should be 2 missing strings",2,missingStrings.size()); + assertTrue(htmlFile.getName() + " should not have Class as it's title",missingStrings.contains("Class ClassWithNestedAspect.NestedAspect")); assertTrue(htmlFile.getName() + " should not have class in its subtitle", - missing.contains("<pre>static class <span class=\"typeNameLabel\">ClassWithNestedAspect.NestedAspect</span>")); + missingStrings.contains("<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>")); // get the html file for the enclosing class File htmlFileClass = new File(getAbsolutePathOutdir() + "/pkg/ClassWithNestedAspect.html"); @@ -738,22 +748,22 @@ public class CoverageTestCase extends AjdocTestCase { if (LangUtil.is13VMOrGreater()) { classStrings = new String[] { "Class ClassWithNestedAspect</h1>", - "public class <span class=\"typeNameLabel\">ClassWithNestedAspect</span>", + "public class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>", "Aspect ClassWithNestedAspect</h2>", - "public aspect <span class=\"typeNameLabel\">ClassWithNestedAspect</span>"}; + "public aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"}; } else { classStrings = new String[] { "Class ClassWithNestedAspect</h2>", - "public class <span class=\"typeNameLabel\">ClassWithNestedAspect</span>", + "public class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>", "Aspect ClassWithNestedAspect</h2>", - "public aspect <span class=\"typeNameLabel\">ClassWithNestedAspect</span>"}; + "public aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"}; } List<String> classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings); assertEquals("There should be 2 missing strings",2,classMissing.size()); assertTrue(htmlFileClass.getName() + " should not have Aspect as it's title", classMissing.contains("Aspect ClassWithNestedAspect</h2>")); assertTrue(htmlFileClass.getName() + " should not have aspect in its subtitle", - classMissing.contains("public aspect <span class=\"typeNameLabel\">ClassWithNestedAspect</span>")); + classMissing.contains("public aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>")); } /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java index 35666b334..7d3d18de6 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java @@ -227,11 +227,7 @@ public class ClassPath implements Serializable { } // On Java9 the sun.boot.class.path won't be set. System classes accessible through JRT filesystem - if (vm_version.startsWith("9") || vm_version.startsWith("10") - || vm_version.startsWith("11") - || vm_version.startsWith("12") - || vm_version.startsWith("13") - || vm_version.startsWith("14")) { + if (vm_version.matches("^(9|10|11|12|13|14|15).*")) { buf.insert(0, File.pathSeparatorChar); buf.insert(0, System.getProperty("java.home") + File.separator + "lib" + File.separator + JRT_FS); } diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java index e343c9d48..1f9b132ec 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java @@ -12,26 +12,15 @@ package org.aspectj.internal.tools.ant.taskdefs; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintStream; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.MatchingTask; import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Reference; +import java.io.*; +import java.util.*; + /** * Check that included .java files contain license and copyright strings for MPL 1.0 (default), Apache, or CPL. Use list="true" to * get a list of known license variants {license}-{copyrightHolder} todo reimplement with regexp and jdiff FileLine utilities @@ -343,9 +332,10 @@ public class Checklics extends MatchingTask { public static class License { /** acceptable years for copyright prefix to company - append " " */ static final String[] YEARS = // remove older after license xfer? - new String[] { "2002 ", "2003 ", "2004 ", "2005", "2006", "2007", "2008", - "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2001 ", "2000 ", - "1999 " }; + new String[] { + "2002 ", "2003 ", "2004 ", "2005", "2006", "2007", "2008", "2009", "2010", "2011", + "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", + "2001 ", "2000 ", "1999 " }; public final String tag; public final String license; private final String[] copyright; diff --git a/docs/pom.xml b/docs/pom.xml index 1f707646f..5b487c73e 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -1,136 +1,175 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.aspectj</groupId> - <artifactId>aspectj-parent</artifactId> - <version>1.9.7.BUILD-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.aspectj</groupId> + <artifactId>aspectj-parent</artifactId> + <version>1.9.7.BUILD-SNAPSHOT</version> + </parent> - <artifactId>docs</artifactId> - <packaging>jar</packaging> - <name>docs</name> + <artifactId>docs</artifactId> + <packaging>jar</packaging> + <name>docs</name> + <profiles> + <profile> + <id>create-docs</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <dependencies> + <!-- + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>util</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>runtime</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>util</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>testing-util</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>bridge</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>asm</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>org.aspectj.matcher</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>runtime</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>org.aspectj.matcher</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>bcel-builder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>commons</groupId> + <artifactId>commons</artifactId> + <version>1.0</version> + <scope>system</scope> + <systemPath>${project.basedir}/../lib/commons/commons.jar</systemPath> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + <version>1.0</version> + <scope>system</scope> + <systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath> + </dependency> + --> + </dependencies> - <dependencies> - <!-- <dependency> <groupId>org.aspectj</groupId> <artifactId>util</artifactId> - <version>${project.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> - <artifactId>runtime</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>org.aspectj</groupId> <artifactId>util</artifactId> - <version>${project.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> - <artifactId>testing-util</artifactId> <version>${project.version}</version> - </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>bridge</artifactId> - <version>${project.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> - <artifactId>asm</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>org.aspectj</groupId> <artifactId>org.aspectj.matcher</artifactId> - <version>${project.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> - <artifactId>runtime</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>org.aspectj</groupId> <artifactId>org.aspectj.matcher</artifactId> - <version>${project.version}</version> <type>test-jar</type> <scope>test</scope> - </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>bcel-builder</artifactId> - <version>${project.version}</version> </dependency> <dependency> <groupId>commons</groupId> - <artifactId>commons</artifactId> <version>1.0</version> <scope>system</scope> - <systemPath>${project.basedir}/../lib/commons/commons.jar</systemPath> </dependency> - <dependency> <groupId>asm</groupId> <artifactId>asm</artifactId> <version>1.0</version> - <scope>system</scope> <systemPath>${project.basedir}/../lib/asm/asm-7.0-beta.renamed.jar</systemPath> - </dependency> --> - </dependencies> + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + <includes> + <include>**/local.properties</include> + </includes> + </resource> + <!-- + <resource> + <directory>src/main/resources</directory> + <filtering>false</filtering> + <excludes> + <exclude>**/local.properties</exclude> + </excludes> + </resource> + --> + </resources> -<build> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <includes> - <include>**/local.properties</include> - </includes> - </resource> -<!-- - <resource> - <directory>src/main/resources</directory> - <filtering>false</filtering> - <excludes> - <exclude>**/local.properties</exclude> - </excludes> - </resource> ---> - </resources> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <versionRange>[1.7,)</versionRange> + <goals> + <goal>run</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.7</version> + <executions> + <execution> + <id>make-docs</id> + <phase>process-resources</phase> + <configuration> + <target> + <copy + file="${project.build.outputDirectory}/local.properties" + toFile="../build/local.properties" + overwrite="true" + /> + <ant antfile="build.xml"> + <target name="dist"/> + </ant> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + + </build> + </profile> + </profiles> -<plugins> -<plugin> - <artifactId>maven-antrun-plugin</artifactId> - <version>1.7</version> - <executions> - <execution> - <phase>process-resources</phase> - <configuration> - <tasks> - <copy file="${project.build.outputDirectory}/local.properties" - toFile="../build/local.properties" overwrite="true" /> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <version>1.7</version> - <executions> - <execution> - <id>ant</id> - <phase>process-resources</phase> - <configuration> - <target> - <ant antfile="build.xml"> - <target name="dist" /> - </ant> - </target> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin></plugins> - <pluginManagement> - <plugins> - <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId> - org.apache.maven.plugins - </groupId> - <artifactId> - maven-antrun-plugin - </artifactId> - <versionRange>[1.7,)</versionRange> - <goals> - <goal>run</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore></ignore> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> -</build> </project> diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java index 125a9e95c..4c37d568b 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials + * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Matthew Webster - initial implementation *******************************************************************************/ @@ -54,7 +54,7 @@ public class JRockitAgentTest extends TestCase { } public void testJrockitRecursionProtection() { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { // Skip test, not castable to URLClassLoader return; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java index 7717355bf..be594860b 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.ajc; @@ -364,7 +364,7 @@ public class BuildArgParser extends Main { List<String> ret = new ArrayList<>(); if (parser.bootclasspath == null) { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { addClasspath(LangUtil.getJrtFsFilePath(),ret); } else { addClasspath(System.getProperty("sun.boot.class.path", ""), ret); @@ -374,7 +374,7 @@ public class BuildArgParser extends Main { } return ret; } - + public List<String> getModulepath(AjcConfigParser parser) { List<String> ret = new ArrayList<>(); addClasspath(parser.modulepath, ret); @@ -391,7 +391,7 @@ public class BuildArgParser extends Main { public ArrayList<FileSystem.Classpath> handleClasspath(ArrayList<String> classpaths, String customEncoding) { return super.handleClasspath(classpaths, customEncoding); } - + /** * If the classpath is not set, we use the environment's java.class.path, but remove the aspectjtools.jar entry from that list * in order to prevent wierd bootstrap issues (refer to bug#39959). @@ -474,7 +474,7 @@ public class BuildArgParser extends Main { public List getUnparsedArgs() { return unparsedArgs; } - + public String getModuleInfoArgument() { return this.moduleInfoArgument; } @@ -914,12 +914,12 @@ public class BuildArgParser extends Main { } } - + @Override public boolean checkVMVersion(long minimalSupportedVersion) { return super.checkVMVersion(minimalSupportedVersion); } - + @Override public void initRootModules(LookupEnvironment environment, FileSystem fileSystem) { super.initRootModules(environment, fileSystem); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java index 78b82d223..daa23dd98 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -33,7 +33,7 @@ public abstract class CommandTestCase extends TestCase { /** * Constructor for CommandTestCase. - * + * * @param name */ public CommandTestCase(String name) { @@ -52,7 +52,7 @@ public abstract class CommandTestCase extends TestCase { protected void runMain(String className) { TestUtil.runMain(getSandboxName(), className); } - + public void checkCompile(String source, String[] extraArgs, int[] expectedErrors) { checkCompile(source,extraArgs,expectedErrors,getSandboxName()); } @@ -169,7 +169,7 @@ public abstract class CommandTestCase extends TestCase { /** get the location of the org.aspectj.lang & runtime classes */ protected static String getRuntimeClasspath() { StringBuilder classpath = new StringBuilder(); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { classpath.append(LangUtil.getJrtFsFilePath()).append(File.pathSeparator); } classpath.append(Constants.aspectjrtClasspath()); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index d1395ac81..a24edb804 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -947,7 +947,7 @@ public abstract class AjcTestCase extends TestCase { args = newargs; } } - boolean needsJRTFS = LangUtil.is19VMOrGreater(); + boolean needsJRTFS = LangUtil.is9VMOrGreater(); if (needsJRTFS) { if (!args[cpIndex].contains(LangUtil.JRT_FS)) { String jrtfsPath = LangUtil.getJrtFsFilePath(); diff --git a/testing-drivers/pom.xml b/testing-drivers/pom.xml index d5542cca2..26de8eab9 100644 --- a/testing-drivers/pom.xml +++ b/testing-drivers/pom.xml @@ -31,6 +31,12 @@ </dependency> <dependency> <groupId>org.aspectj</groupId> + <artifactId>testing-util</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> <artifactId>testing-client</artifactId> <version>${project.version}</version> </dependency> diff --git a/testing-drivers/src/test/java/org/aspectj/testing/drivers/HarnessSelectionTest.java b/testing-drivers/src/test/java/org/aspectj/testing/drivers/HarnessSelectionTest.java index a292962fc..790c4a710 100644 --- a/testing-drivers/src/test/java/org/aspectj/testing/drivers/HarnessSelectionTest.java +++ b/testing-drivers/src/test/java/org/aspectj/testing/drivers/HarnessSelectionTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.testing.drivers; @@ -41,23 +41,23 @@ import junit.framework.TestCase; */ public class HarnessSelectionTest extends TestCase { private static final String TESTDATA = "../testing-drivers/testdata"; - private static final String INC_HARNESS_DIR + private static final String INC_HARNESS_DIR = TESTDATA + "/incremental/harness"; - private static final String SELECT + private static final String SELECT = INC_HARNESS_DIR + "/selectionTest.xml"; - + /** @see testIncrementalSuite() */ - private static final String INCREMENTAL + private static final String INCREMENTAL = INC_HARNESS_DIR + "/suite.xml"; - private static final String TITLE_LIST_ONE + private static final String TITLE_LIST_ONE = INC_HARNESS_DIR + "/titleListOne.txt"; - private static final String TITLE_LIST_PLURAL + private static final String TITLE_LIST_PLURAL = INC_HARNESS_DIR + "/titleListPlural.txt"; - - private static Hashtable SPECS = new Hashtable(); - + + private static Hashtable SPECS = new Hashtable(); + private static AjcTest.Suite.Spec getSpec(String suiteFile) { AjcTest.Suite.Spec result = (AjcTest.Suite.Spec) SPECS.get(suiteFile); if (null == result) { @@ -67,7 +67,7 @@ public class HarnessSelectionTest extends TestCase { } catch (IOException e) { e.printStackTrace(System.err); } - } + } try { return (AjcTest.Suite.Spec) result.clone(); } catch (CloneNotSupportedException e) { @@ -76,13 +76,13 @@ public class HarnessSelectionTest extends TestCase { return null; // keep compiler happy } } - + private boolean verbose; public HarnessSelectionTest(String name) { super(name); } - + public void testFilesAvailable() { String[] files = new String[] { SELECT, INCREMENTAL, TITLE_LIST_ONE, TITLE_LIST_PLURAL @@ -99,20 +99,20 @@ public class HarnessSelectionTest extends TestCase { System.err.println("skipping test - eclipse classes not available"); return; } - String[] options = new String[] + String[] options = new String[] { "!verbose", "!eclipse", }; Exp exp = new Exp(6, 6, 0, 6, 0, 0, 0); checkSelection(INCREMENTAL, options, "INFIX IGNORED", exp); } - + public void testKeywordSelectionBoth() { if (!eclipseAvailable()) { System.err.println("skipping test - eclipse classes not available"); return; } - String[] options = new String[] - { "-ajctestRequireKeywords=requireKeyword", + String[] options = new String[] + { "-ajctestRequireKeywords=requireKeyword", "-ajctestSkipKeywords=skipKeyword,skipUnenforcedAjcLimit", "!verbose", "-eclipse", @@ -120,14 +120,14 @@ public class HarnessSelectionTest extends TestCase { Exp exp = new Exp(17, 1, 16, 1, 0, 0, 1); checkSelection(SELECT, options, "keyword skipKeyword was found", exp); } - + public void testKeywordSelectionRequire() { if (!eclipseAvailable()) { System.err.println("skipping test - eclipse classes not available"); return; } - String[] options = new String[] - { "-ajctestRequireKeywords=skipKeyword", + String[] options = new String[] + { "-ajctestRequireKeywords=skipKeyword", "!verbose", "-eclipse", }; @@ -140,21 +140,21 @@ public class HarnessSelectionTest extends TestCase { System.err.println("skipping test - eclipse classes not available"); return; } - String[] options = new String[] - { "-ajctestSkipKeywords=requireKeyword", + String[] options = new String[] + { "-ajctestSkipKeywords=requireKeyword", "!verbose", "-eclipse", }; Exp exp = new Exp(17, 0, 17, 0, 0, 0, 17); checkSelection(SELECT, options, "keyword requireKeyword was found", exp); } - + public void testNoOptions() { if (!ajcAvailable()) { System.err.println("skipping test - ajc classes not available"); return; } - String[] options = new String[] + String[] options = new String[] { "!ajc" }; Exp exp = new Exp(17, 3, 14, 3, 0, 0, 4); @@ -162,107 +162,107 @@ public class HarnessSelectionTest extends TestCase { } public void testEclipseOptionsSkip() { - String[] options = new String[] + String[] options = new String[] { "-eclipse", "-ajctestRequireKeywords=eclipseOptionSkip" }; Exp exp = new Exp(17, 0, 17, 0, 0, 0, 6); checkSelection(SELECT, options, "old ajc 1.0 option", exp); } - + public void testAjcEclipseConflict() { if (!ajcAvailable()) { System.err.println("skipping test - ajc classes not available"); return; } - String[] options = new String[] + String[] options = new String[] { "!ajc" }; Exp exp = new Exp(17, 3, 14, 3, 0, 0, 6); checkSelection(SELECT, options, "conflict between !eclipse and !ajc", exp); } - + public void testEclipseConflict() { - String[] options = new String[] + String[] options = new String[] { "^eclipse", "-ajctestSkipKeywords=skipUnenforcedAjcLimit" - }; + }; Exp exp = new Exp(17, 3, 14, 3, 0, 0, 6); checkSelection(SELECT, options, "force conflict between eclipse", exp); } - + public void testSinglePR() { - String[] options = new String[] + String[] options = new String[] { "-eclipse", "-ajctestPR=100" }; Exp exp = new Exp(17, 1, 16, 1, 0, 0, 16); checkSelection(SELECT, options, "bugId required", exp); } - + public void testTwoPR() { - String[] options = new String[] + String[] options = new String[] { "-eclipse", "-ajctestPR=100,101" }; Exp exp = new Exp(17, 2, 15, 2, 0, 0, 15); checkSelection(SELECT, options, "bugId required", exp); } - + public void testTitleContainsSubstringSelection() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleContains=run and ", - "-eclipse" + "-eclipse" }; Exp exp = new Exp(17, 1, 16, 1, 0, 0, 16); checkSelection(SELECT, options, "run and", exp); } - + public void testTitleContainsSubstringSelectionPlural() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleContains= run and , if skipKeyword ", - "-eclipse" + "-eclipse" }; Exp exp = new Exp(17, 2, 15, 2, 0, 0, 15); checkSelection(SELECT, options, "title", exp); } public void testTitleContainsExactSelection() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleContains=run and pass", - "-eclipse" + "-eclipse" }; Exp exp = new Exp(17, 1, 16, 1, 0, 0, 16); checkSelection(SELECT, options, "run and pass", exp); } - + public void testTitleContainsExactSelectionPlural() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleContains= run and pass , omit if skipKeyword ", - "-eclipse" + "-eclipse" }; Exp exp = new Exp(17, 2, 15, 2, 0, 0, 15); checkSelection(SELECT, options, "title", exp); } public void testTitleListSelection() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleList=run and pass", - "-eclipse" + "-eclipse" }; Exp exp = new Exp(17, 1, 16, 1, 0, 0, 16); checkSelection(SELECT, options, "run and pass", exp); } - + public void testTitleListSelectionPlural() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleList= run and pass , omit if skipKeyword ", - "-eclipse" + "-eclipse" }; Exp exp = new Exp(17, 2, 15, 2, 0, 0, 15); checkSelection(SELECT, options, "title", exp); } public void testTitleListFileSelection() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleList=" + TITLE_LIST_ONE, "-eclipse" }; @@ -271,15 +271,15 @@ public class HarnessSelectionTest extends TestCase { } public void testTitleListFileSelectionPlural() { - String[] options = new String[] + String[] options = new String[] { "-ajctestTitleList=" + TITLE_LIST_PLURAL, "-eclipse" }; Exp exp = new Exp(17, 2, 15, 2, 0, 0, 15); checkSelection(SELECT, options, TITLE_LIST_PLURAL, exp); - - // Now check the "fail only" path - options = new String[] + + // Now check the "fail only" path + options = new String[] { "-ajctestTitleFailList=" + TITLE_LIST_PLURAL, "-eclipse" }; @@ -289,7 +289,7 @@ public class HarnessSelectionTest extends TestCase { checkSelection(SELECT, options, "skip", exp); } - /** + /** * Run the static test suite with the given options. * @param setupHolder the IMessageHolder for any setup messages * @return null if setup failed or Harness.RunResult if suite completed. @@ -305,15 +305,15 @@ public class HarnessSelectionTest extends TestCase { assertTrue("expected 17 kids, got " + kids.size(), false); } if (!spec.adoptParentValues(runtime, setupHolder)) { - return null; + return null; } else { class TestHarness extends Harness { public RunResult run(AjcTest.Suite.Spec spec) { return super.run(spec); - } + } } TestHarness h = new TestHarness(); - return h.run(spec); + return h.run(spec); } } @@ -334,8 +334,8 @@ public class HarnessSelectionTest extends TestCase { this.incomplete = incomplete; this.infix = infix; } - } - + } + public void checkSelection(String suiteFile, String[] options, String infoInfix, Exp exp) { MessageHandler holder = new MessageHandler(); Harness.RunResult result = runSuite(suiteFile, options, holder); @@ -345,7 +345,7 @@ public class HarnessSelectionTest extends TestCase { assertNotNull("Harness.RunResult", result); // XXX sync hack snooping of message text with skip messages, harness final List skipList = MessageUtil.getMessages(holder, IMessage.INFO, false, "skip"); - final int numSkipped = skipList.size(); + final int numSkipped = skipList.size(); IRunStatus status = result.status; assertNotNull(status); if (verbose) { @@ -355,7 +355,7 @@ public class HarnessSelectionTest extends TestCase { assertEquals("skips", exp.skipped, numSkipped); IRunStatus[] children = status.getChildren(); assertNotNull(children); - assertTrue(children.length + "!= expRun=" + exp.testsRun, + assertTrue(children.length + "!= expRun=" + exp.testsRun, exp.testsRun == children.length); int actPass = 0; for (IRunStatus child : children) { @@ -369,25 +369,27 @@ public class HarnessSelectionTest extends TestCase { if (!LangUtil.isEmpty(infoInfix)) { int actInfix = MessageUtil.getMessages(holder, IMessage.INFO, false, infoInfix).size(); if (actInfix != exp.infix) { - String s = "for infix \"" + infoInfix + String s = "for infix \"" + infoInfix + "\" actInfix=" + actInfix + " != expInfix=" + exp.infix; assertTrue(s, false); } } } - + private boolean ajcAvailable() { // XXX util try { - return (null != Class.forName("org.aspectj.compiler.base.JavaCompiler")); + Class.forName("org.aspectj.compiler.base.JavaCompiler"); + return true; } catch (ClassNotFoundException e) { return false; } } - + private boolean eclipseAvailable() { // XXX util try { - return (null != Class.forName("org.aspectj.ajdt.ajc.AjdtCommand")); + Class.forName("org.aspectj.ajdt.ajc.AjdtCommand"); + return true; } catch (ClassNotFoundException e) { return false; } diff --git a/testing/src/test/java/org/aspectj/testing/AjcTest.java b/testing/src/test/java/org/aspectj/testing/AjcTest.java index e9eeafc2f..5f39368a6 100644 --- a/testing/src/test/java/org/aspectj/testing/AjcTest.java +++ b/testing/src/test/java/org/aspectj/testing/AjcTest.java @@ -39,7 +39,7 @@ public class AjcTest { is16VMOrGreater = true; is17VMOrGreater = true; is18VMOrGreater = true; - is19VMOrGreater = LangUtil.is19VMOrGreater(); + is19VMOrGreater = LangUtil.is9VMOrGreater(); is10VMOrGreater = LangUtil.is10VMOrGreater(); is11VMOrGreater = LangUtil.is11VMOrGreater(); is12VMOrGreater = LangUtil.is12VMOrGreater(); diff --git a/testing/src/test/java/org/aspectj/testing/OutputSpec.java b/testing/src/test/java/org/aspectj/testing/OutputSpec.java index 8e1fd2612..f8c96077f 100644 --- a/testing/src/test/java/org/aspectj/testing/OutputSpec.java +++ b/testing/src/test/java/org/aspectj/testing/OutputSpec.java @@ -11,8 +11,8 @@ * ******************************************************************/ package org.aspectj.testing; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.StringTokenizer; import org.aspectj.tools.ajc.AjcTestCase; import org.aspectj.util.LangUtil; @@ -63,43 +63,43 @@ public class OutputSpec { } boolean matches = false; int lineNo = 0; - StringTokenizer strTok = new StringTokenizer(output,"\n"); - if (strTok.countTokens() == expectedOutputLines.size()) { + String[] actualOutputLines = getTrimmedLines(output); + + if (actualOutputLines.length == expectedOutputLines.size()) { matches = true; - for (String line: expectedOutputLines) { - lineNo++; - String outputLine = strTok.nextToken().trim(); + for (String lineExpected : expectedOutputLines) { + String lineFound = actualOutputLines[lineNo++]; /* Avoid trying to match on ajSandbox source names that appear in messages */ - if (!outputLine.contains(line)) { + if (!lineFound.contains(lineExpected.trim())) { matches = false; break; } } } else { lineNo = -1; } if (!matches) { - createFailureMessage(output, lineNo, strTok.countTokens()); + createFailureMessage(output, lineNo, actualOutputLines.length); } } - public void unorderedMatchAgainst(String output) { - List<String> outputFound = getOutputFound(output); - if(outputFound.size() != expectedOutputLines.size()) { - createFailureMessage(output, -1, outputFound.size()); + private void unorderedMatchAgainst(String output) { + List<String> actualOutputLines = Arrays.asList(getTrimmedLines(output)); + int numberOfOutputLines = actualOutputLines.size(); + if(numberOfOutputLines != expectedOutputLines.size()) { + createFailureMessage(output, -1, numberOfOutputLines); return; } List<String> expected = new ArrayList<>(expectedOutputLines); - List<String> found = new ArrayList<>(outputFound); - for (String lineFound : outputFound) { + List<String> found = new ArrayList<>(actualOutputLines); + for (String lineFound : actualOutputLines) { for (String lineExpected : expectedOutputLines) { - if (lineFound.contains(lineExpected)) { + if (lineFound.contains(lineExpected.trim())) { found.remove(lineFound); expected.remove(lineExpected); - continue; } } } if (!found.isEmpty() || !expected.isEmpty()) { - createFailureMessage(output,-2,outputFound.size()); + createFailureMessage(output, -2, numberOfOutputLines); } } @@ -121,13 +121,9 @@ public class OutputSpec { AjcTestCase.fail(failMessage.toString()); } - private List<String> getOutputFound(String output) { - List<String> found = new ArrayList<>(); - StringTokenizer strTok = new StringTokenizer(output,"\n"); - while(strTok.hasMoreTokens()) { - String outputLine = strTok.nextToken().trim(); - found.add(outputLine); - } - return found; + private String[] getTrimmedLines(String text) { + // Remove leading/trailing empty lines and leading/trailing whitespace from each line + String[] trimmedLines = text.trim().split("\\s*\n\\s*"); + return trimmedLines.length == 1 && trimmedLines[0].equals("") ? new String[0] : trimmedLines; } } diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava14Only.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava14Only.java new file mode 100644 index 000000000..3bdb4d6be --- /dev/null +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava14Only.java @@ -0,0 +1,31 @@ +/* ******************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * ******************************************************************/ +package org.aspectj.testing; + +import org.aspectj.util.LangUtil; + +/** + * Makes sure tests are running on the right level of JDK. + * + * @author Alexander Kriegisch + */ +public abstract class XMLBasedAjcTestCaseForJava14Only extends XMLBasedAjcTestCase { + + @Override + public void runTest(String title) { + if (!LangUtil.is14VMOrGreater() || LangUtil.is15VMOrGreater()) { + throw new IllegalStateException( + "These tests should be run on Java 14 only " + + "(e.g. because they use version-specific preview features)" + ); + } + super.runTest(title); + } + +} diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java index 205b55273..19e80c474 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2018 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: * Andy Clement * ******************************************************************/ package org.aspectj.testing; @@ -15,7 +15,7 @@ import org.aspectj.util.LangUtil; /** * Makes sure tests are running on the right level of JDK. - * + * * @author Andy Clement */ public abstract class XMLBasedAjcTestCaseForJava9OrLater extends XMLBasedAjcTestCase { @@ -23,10 +23,10 @@ public abstract class XMLBasedAjcTestCaseForJava9OrLater extends XMLBasedAjcTest @Override public void runTest(String title) { // Check we are on Java9 or later - if (!LangUtil.is19VMOrGreater()) { + if (!LangUtil.is9VMOrGreater()) { throw new IllegalStateException("These tests should be run on Java 9 or later"); } super.runTest(title); } - + } diff --git a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java index b20a5650a..645a9c7df 100644 --- a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java +++ b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ package org.aspectj.testing.taskdefs; @@ -35,7 +35,7 @@ public class AjcTaskCompileCommandTest extends TestCase { static boolean loggedWarning = false; static boolean runAllTests = true; static List<File> tempFiles = new ArrayList<>(); - + private static File getClassesDir() { File tempDir = FileUtil.getTempDir("AjcTaskCompileCommandTest-classes"); tempFiles.add(tempDir); @@ -48,7 +48,7 @@ public class AjcTaskCompileCommandTest extends TestCase { list.add("-classpath"); StringBuilder classpath = new StringBuilder(); classpath.append(Globals.F_aspectjrt_jar.getAbsolutePath()); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { classpath.append(File.pathSeparator).append(LangUtil.getJrtFsFilePath()); } list.add(classpath.toString()); @@ -56,7 +56,7 @@ public class AjcTaskCompileCommandTest extends TestCase { static boolean doWait(IMessageHolder holder, int seconds, int timeout) { return AjcTaskCompileCommand - .waitUntilMessagesQuiet(holder, seconds, timeout); + .waitUntilMessagesQuiet(holder, seconds, timeout); } public AjcTaskCompileCommandTest(String name) { @@ -85,30 +85,30 @@ public class AjcTaskCompileCommandTest extends TestCase { public void testDefaultList() { runSimpleTest("../taskdefs/testdata/default.lst", 0); } - + public void testCompileErrorList() { runSimpleTest("../taskdefs/testdata/compileError.lst", 1); } - + public void testWaitUntilMessagesQuiet_1_2() { if (runAllTests) checkWait(1, 2, 0, 0); } - + public void testWaitUntilMessagesQuiet_1_10() { if (runAllTests) checkWait(1, 10, 0, 0); } - + public void testWaitUntilMessagesQuiet_8_10() { checkWait(8, 10, 0, 0); } - + // XXX two async tests might fail if adder thread starved - + public void testWaitUntilMessagesQuiet_1_10_4_1() { if (runAllTests) checkWait(1, 10, 4, 1); } - + public void testWaitUntilMessagesQuiet_8_10_2_1() { if (runAllTests) checkWait(8, 20, 2, 1); } @@ -129,7 +129,7 @@ public class AjcTaskCompileCommandTest extends TestCase { } runTest(list, expectedErrors); } - + void runTest(ArrayList<String> args, int expectedErrors) { AjcTaskCompileCommand command = new AjcTaskCompileCommand(); @@ -140,14 +140,14 @@ public class AjcTaskCompileCommandTest extends TestCase { final boolean pass = (result == expectPass); if (!pass) { String m = expectPass ? "pass" : "fail"; - + assertTrue("expected " + m + ": " + args+"\n Messages:"+handler.getUnmodifiableListView(), false); } } void checkWait(final int seconds, final int timeout, int toAdd, int addInterval) { - final String testCase = "checkWait(seconds=" - + seconds + ", timeout=" + timeout; + final String testCase = "checkWait(seconds=" + + seconds + ", timeout=" + timeout; final MessageHandler mhandler = new MessageHandler(); final long startTime = System.currentTimeMillis(); final long testTimeout = startTime + (timeout * 2000l); @@ -160,7 +160,7 @@ public class AjcTaskCompileCommandTest extends TestCase { System.out.println("warning - test will fail if adder thread starved"); loggedWarning = true; } - final MessageAdder adder + final MessageAdder adder = new MessageAdder(mhandler, toAdd, addInterval); final String label = testCase + " wait(" + toAdd + ", " + addInterval + ")"; class Result { @@ -173,15 +173,15 @@ public class AjcTaskCompileCommandTest extends TestCase { waitResult.addedThread = new Thread(adder, label + "-child"); waitResult.addedThread.start(); - waitResult.result = + waitResult.result = AjcTaskCompileCommandTest.doWait(mhandler, seconds, timeout); } }, label); - + testThread.start(); - + try { - testThread.join(testTimeout - startTime); + testThread.join(testTimeout - startTime); } catch (InterruptedException e) { // ignore } @@ -190,13 +190,13 @@ public class AjcTaskCompileCommandTest extends TestCase { long wait = testTimeout - System.currentTimeMillis(); if (0 < wait) { waitResult.addedThread.join(wait); - } + } } } catch (InterruptedException e) { // ignore } result = waitResult.result; - int added = adder.getNumAdded(); + int added = adder.getNumAdded(); assertEquals(testCase + " added", added, toAdd); if (!result) { assertTrue(testCase + " result " + adder, false); @@ -215,12 +215,12 @@ class MessageAdder implements Runnable { public static long MAX_MILLIS = 1000 * 30; public boolean stop; public boolean wait; - + private final IMessageHolder messages; private final int numToAdd; private final int interval; private int numAdded; - + /** * @param holder the IMessageHolder to add to * @param num the int number of messages to add @@ -242,7 +242,7 @@ class MessageAdder implements Runnable { final long timeout = curTime + MAX_MILLIS; // final Thread thread = Thread.currentThread(); int numAdded = 0; - while (!stop && (timeout > curTime) + while (!stop && (timeout > curTime) && (numAdded < numToAdd)) { long targetTime = curTime + waitBetweenAdds; while (!stop && (curTime < timeout) @@ -264,7 +264,7 @@ class MessageAdder implements Runnable { int getNumAdded() { return numAdded; } - + public String toString() { return "MessageAdder(" + "numAdded=" + numAdded @@ -273,9 +273,9 @@ class MessageAdder implements Runnable { + ", stop=" + stop + ", wait=" + wait + ", numMessages=" - + (null == messages - ? 0 + + (null == messages + ? 0 : messages.numMessages(null, true)) + ")"; - } -}
\ No newline at end of file + } +} diff --git a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReader.java b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReader.java index 3ab25c088..421d37584 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReader.java +++ b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReader.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC), * 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Xerox/PARC initial implementation * Wes Isberg resolver * ******************************************************************/ @@ -42,8 +42,8 @@ import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -/** - * Read an ajc test specification in xml form. +/** + * Read an ajc test specification in xml form. * Input files should comply with DOCTYPE */ public class AjcSpecXmlReader { @@ -51,7 +51,7 @@ public class AjcSpecXmlReader { * To add new elements or attributes: * - update the DOCTYPE * - update setupDigester(..) - * - new sub-elements should be created + * - new sub-elements should be created * - new attributes should have values set as bean properties * (possibly by mapping names) * - new sub-elements should be added to parents @@ -64,7 +64,7 @@ public class AjcSpecXmlReader { * - update any client writers referring to the DOCTYPE, as necessary. * - the parent IXmlWriter should delegate to the child component * as IXmlWriter (or write the subelement itself) - * + * * Debugging * - use logLevel = 2 for tracing * - common mistakes @@ -72,29 +72,29 @@ public class AjcSpecXmlReader { * - no rule defined (or misdefined) so element ignored * - property read-only (?) */ - + // private static final String EOL = "\n"; - + /** presumed relative-path to dtd file for any XML files written by writeSuiteToXmlFile */ public static final String DTD_PATH = "../tests/ajcTestSuite.dtd"; - + /** expected doc type of AjcSpec XML files */ - public static final String DOCTYPE = "<!DOCTYPE " + public static final String DOCTYPE = "<!DOCTYPE " + AjcTest.Suite.Spec.XMLNAME + " SYSTEM \"" + DTD_PATH + "\">"; - private static final AjcSpecXmlReader ME + private static final AjcSpecXmlReader ME = new AjcSpecXmlReader(); - + /** @return shared instance */ public static final AjcSpecXmlReader getReader() { return ME; } - + public static void main(String[] a) throws IOException { writeDTD(new File("../tests/ajcTestSuite2.dtd")); } - - /** + + /** * Write a DTD to dtdFile. * @deprecated * @param dtdFile the File to write to @@ -103,19 +103,19 @@ public class AjcSpecXmlReader { LangUtil.throwIaxIfNull(dtdFile, "dtdFile"); PrintWriter out = new PrintWriter(new FileWriter(dtdFile)); try { - out.println("<!-- document type for ajc test suite - see " + out.println("<!-- document type for ajc test suite - see " + AjcSpecXmlReader.class.getName() + " -->"); //out.println(getDocType()); } finally { out.close(); - } + } } private static final String[] LOG = new String[] {"info", "debug", "trace" }; - + // XXX logLevel n>0 causes JUnit tests to fail! - private int logLevel = 0; // use 2 for tracing - + private int logLevel = 0; // use 2 for tracing + private AjcSpecXmlReader() {} /** @param level 0..2, info..trace */ @@ -126,14 +126,13 @@ public class AjcSpecXmlReader { if (level > 2) { level = 2; } - logLevel = level; + logLevel = level; } /** * Print an IXmlWritable to the output file * with our leader and DOCTYPE. * @param output the File to write to - overwritten - * @param tests the List of IXmlWritable to write * @return null if no warnings detected, warnings otherwise */ public String writeSuiteToXmlFile(File output, IXmlWritable topNode) throws IOException { @@ -147,7 +146,7 @@ public class AjcSpecXmlReader { String parent = output.getParent(); if (null == parent) { parent = "."; - } + } String dtdPath = parent + "/" + DTD_PATH; File dtdFile = new File(dtdPath); if (!dtdFile.canRead()) { @@ -155,13 +154,13 @@ public class AjcSpecXmlReader { } return null; } - - /** + + /** * Read the specifications for a suite of AjcTest from an XML file. * This also sets the suite dir in the specification. * @param file the File must be readable, comply with DOCTYPE. * @return AjcTest.Suite.Spec read from file - * @see setLogLevel(int) + * @see #setLogLevel(int) */ public AjcTest.Suite.Spec readAjcSuite(File file) throws IOException, AbortException { // setup loggers for digester and beanutils... @@ -180,7 +179,7 @@ public class AjcSpecXmlReader { if (null != input) { input.close(); input = null; - } + } } AjcTest.Suite.Spec result = holder.spec; if (null != result) { @@ -198,13 +197,13 @@ public class AjcSpecXmlReader { } return result; } - + private Digester makeDigester(final File suiteFile) { // implement EntityResolver directly; set is failing Digester result = new Digester() { final SuiteResolver resolver = new SuiteResolver(suiteFile); public InputSource resolveEntity( - String publicId, + String publicId, String systemId) throws SAXException { return resolver.resolveEntity(publicId, systemId); @@ -213,7 +212,7 @@ public class AjcSpecXmlReader { setupDigester(result); return result; } - + /** set up the mapping between the xml and Java. */ private void setupDigester(Digester digester) { // XXX supply sax parser to ignore white space? @@ -245,24 +244,24 @@ public class AjcSpecXmlReader { digester.addObjectCreate(compileX, CompilerRun.Spec.class.getName()); //digester.addObjectCreate(compileX + "/file", AbstractRunSpec.WrapFile.class.getName()); digester.addObjectCreate(inccompileX, IncCompilerRun.Spec.class.getName()); - digester.addObjectCreate(runX, JavaRun.Spec.class.getName()); + digester.addObjectCreate(runX, JavaRun.Spec.class.getName()); digester.addObjectCreate(messageX, SoftMessage.class.getName()); digester.addObjectCreate(messageSrcLocX, SoftSourceLocation.class.getName()); digester.addObjectCreate(dirchangesX, DirChanges.Spec.class.getName()); - + // ---- set bean properties for sub-elements created automatically // -- some remapped - warnings // - if property exists, map will not be used digester.addSetProperties(suiteX); // ok to have suite messages and global suite options, etc. - digester.addSetProperties(ajctestX, + digester.addSetProperties(ajctestX, new String[] { "title", "dir", "pr"}, new String[] { "description", "testDirOffset", "bugId"}); - digester.addSetProperties(compileX, + digester.addSetProperties(compileX, new String[] { "files", "argfiles"}, new String[] { "paths", "argfiles"}); digester.addSetProperties(compileX + "/file"); digester.addSetProperties(inccompileX, "classes", "paths"); - digester.addSetProperties(runX, + digester.addSetProperties(runX, new String[] { "class", "vm", "skipTester", "fork", "vmargs", "aspectpath", "module"}, new String[] { "className", "javaVersion", "skipTester", "fork", "vmArgs", "aspectpath", "module"}); digester.addSetProperties(dirchangesX); @@ -274,7 +273,7 @@ public class AjcSpecXmlReader { // only file subelement of compile uses text as path... XXX vestigial digester.addCallMethod(compileX + "/file", "setFile", 0); - // ---- when subelements are created, add to parent + // ---- when subelements are created, add to parent // add ajctest to suite, runs to ajctest, files to compile, messages to any parent... // the method name (e.g., "addSuite") is in the parent (SuiteHolder) // the class (e.g., AjcTest.Suite.Spec) refers to the type of the object created @@ -289,53 +288,53 @@ public class AjcSpecXmlReader { // addSourceLocation is for the extra digester.addSetNext(messageSrcLocX, "addSourceLocation", ISourceLocation.class.getName()); digester.addSetNext(dirchangesX, "addDirChanges", DirChanges.Spec.class.getName()); - + // can set parent, but prefer to have "knows-about" flow down only... } // ------------------------------------------------------------ testing code - /** - * Get expected bean properties for introspection tests. + /** + * Get expected bean properties for introspection tests. * This should return an expected property for every attribute in DOCTYPE, * using any mapped-to names from setupDigester. */ static BProps[] expectedProperties() { - return new BProps[] + return new BProps[] { - new BProps(AjcTest.Suite.Spec.class, + new BProps(AjcTest.Suite.Spec.class, new String[] { "suiteDir"}), // verbose removed - new BProps(AjcTest.Spec.class, + new BProps(AjcTest.Spec.class, new String[] { "description", "testDirOffset", "bugId"}), // mapped from { "title", "dir", "pr"} - new BProps(CompilerRun.Spec.class, - new String[] { "files", "options", + new BProps(CompilerRun.Spec.class, + new String[] { "files", "options", "staging", "badInput", "reuseCompiler", "includeClassesDir", - "argfiles", "aspectpath", "classpath", "extdirs", + "argfiles", "aspectpath", "classpath", "extdirs", "sourceroots", "xlintfile", "outjar"}), - new BProps(IncCompilerRun.Spec.class, + new BProps(IncCompilerRun.Spec.class, new String[] { "tag" }), - new BProps(JavaRun.Spec.class, - new String[] { "className", "skipTester", "options", + new BProps(JavaRun.Spec.class, + new String[] { "className", "skipTester", "options", "javaVersion", "errStreamIsError", "outStreamIsError", "fork", "vmArgs", "aspectpath"}), // mapped from { "class", ...} - new BProps(DirChanges.Spec.class, + new BProps(DirChanges.Spec.class, new String[] { "added", "removed", "updated", "unchanged", "dirToken", "defaultSuffix"}), -// new BProps(AbstractRunSpec.WrapFile.class, +// new BProps(AbstractRunSpec.WrapFile.class, // new String[] { "path"}), - new BProps(SoftMessage.class, + new BProps(SoftMessage.class, new String[] { "kindAsString", "lineAsString", "text", "details", "file"}) // mapped from { "kind", "line", ...} }; } - - /** + + /** * This is only to do compile-time checking for the APIs impliedly * used in setupDigester(..). * The property setter checks are redundant with tests based on * expectedProperties(). */ - private static void setupDigesterCompileTimeCheck() { + private static void setupDigesterCompileTimeCheck() { if (true) { throw new Error("never invoked"); } AjcTest.Suite.Spec suite = new AjcTest.Suite.Spec(); AjcTest.Spec test = new AjcTest.Spec(); @@ -349,7 +348,7 @@ public class AjcSpecXmlReader { // ajctest.setTestBaseDirOffset((String) null); // ajctest.setBugId((String) null); // ajctest.setTestSourceLocation((ISourceLocation) null); - + CompilerRun.Spec crunSpec = new CompilerRun.Spec(); crunSpec.addMessage((IMessage) null); // XXX crunSpec.addSourceLocation((ISourceLocation) null); @@ -360,7 +359,7 @@ public class AjcSpecXmlReader { crunSpec.setReuseCompiler(false); crunSpec.setXlintfile((String) null); crunSpec.setOutjar((String)null); - + IncCompilerRun.Spec icrunSpec = new IncCompilerRun.Spec(); icrunSpec.addMessage((IMessage) null); icrunSpec.setTag((String) null); @@ -371,7 +370,7 @@ public class AjcSpecXmlReader { jrunspec.setClassName((String) null); jrunspec.addMessage((IMessage) null); // input s.b. interpretable by Boolean.valueOf(String) - jrunspec.setSkipTester(true); + jrunspec.setSkipTester(true); jrunspec.setErrStreamIsError("false"); jrunspec.setOutStreamIsError("false"); jrunspec.setAspectpath(""); @@ -379,8 +378,8 @@ public class AjcSpecXmlReader { jrunspec.setFork(false); jrunspec.setLTW("false"); jrunspec.setException("Error"); - - + + DirChanges.Spec dcspec = new DirChanges.Spec(); dcspec.setAdded((String) null); dcspec.setRemoved((String) null); @@ -393,16 +392,16 @@ public class AjcSpecXmlReader { m.setText((String) null); m.setKindAsString((String) null); m.setDetails((String) null); - + SoftSourceLocation sl = new SoftSourceLocation(); - sl.setFile((String) null); - sl.setLine((String) null); - sl.setColumn((String) null); - sl.setEndLine((String) null); - + sl.setFile((String) null); + sl.setLine((String) null); + sl.setColumn((String) null); + sl.setEndLine((String) null); + // add attribute setters to validate? } - + /** top element on Digester stack holds the test suite */ public static class SuiteHolder { AjcTest.Suite.Spec spec; @@ -410,7 +409,7 @@ public class AjcSpecXmlReader { this.spec = spec; } } - + /** hold class/properties association for testing */ static class BProps { final Class cl; @@ -420,13 +419,13 @@ public class AjcSpecXmlReader { this.props = props; } } - + /** * Find file NAME=="ajcTestSuite.dtd" from some reasonably-local * relative directories. * XXX bug: commons parser doesn't accept second registration, * so we override Digester's implementation instead. - * XXX cannot JUnit test SuiteResolver since they run from + * XXX cannot JUnit test SuiteResolver since they run from * local directory with valid reference * XXX does not fix JDK 1.4 parser message "unable to resolve without base URI" * XXX should be able to just set BaseURI instead... @@ -440,7 +439,7 @@ public class AjcSpecXmlReader { public SuiteResolver(File suiteFile) { this.suiteFile = suiteFile; } - + private String getPath(String id) { // first, try id relative to suite file @@ -453,12 +452,12 @@ public class AjcSpecXmlReader { return result.getPath(); } } - // then try misc paths relative to suite file or current dir + // then try misc paths relative to suite file or current dir final File[] baseDirs = new File[] { suiteFileDir, new File(".") }; final String[] locations = new String[] - { ".", "..", "../tests", "../../tests", + { ".", "..", "../tests", "../../tests", "../../../tests", "tests", "modules/tests" }; File baseDir; @@ -480,11 +479,11 @@ public class AjcSpecXmlReader { return null; } public InputSource resolveEntity( - String publicId, + String publicId, String systemId) throws SAXException { InputSource result = null; - if ((null != systemId) && + if ((null != systemId) && systemId.endsWith(NAME)) { String path = getPath(systemId); if (null != path) { @@ -514,8 +513,8 @@ public class AjcSpecXmlReader { // int start = line.indexOf("\""); // int end = line.lastIndexOf(NAME + "\""); // if ((0 < start) && (start < end)) { -// return upper.substring(start+1, -// end + NAME.length()); +// return upper.substring(start+1, +// end + NAME.length()); // } // } else if (!line.startsWith("<?xml")) { // break; // something else... diff --git a/tests/ajcTestSuite.dtd b/tests/ajcTestSuite.dtd index fbfcd011a..6d6712fb9 100644 --- a/tests/ajcTestSuite.dtd +++ b/tests/ajcTestSuite.dtd @@ -1,71 +1,119 @@ -<!-- this defines a DOCTYPE for a suite of ajc tests -->
-<!-- element-component mappings are in org.aspectj.testing.xml.AjcSpecXmlReader -->
-<!-- element names are determined by the component XMLNAME static variable -->
-
- <!ELEMENT suite (ajc-test*)>
- <!ATTLIST suite suiteDir CDATA #IMPLIED >
- <!-- permits leading inc-compile, will fail -->
- <!ELEMENT ajc-test ((compile | inc-compile | run)*)>
- <!ATTLIST ajc-test title CDATA #REQUIRED >
- <!ATTLIST ajc-test dir CDATA #REQUIRED >
- <!ATTLIST ajc-test pr CDATA #IMPLIED >
- <!ATTLIST ajc-test keywords CDATA #IMPLIED >
- <!ATTLIST ajc-test comment CDATA #IMPLIED >
-
- <!ELEMENT compile (dir-changes*,message*)>
- <!ATTLIST compile staging CDATA #IMPLIED >
- <!ATTLIST compile badInput CDATA #IMPLIED >
- <!ATTLIST compile files CDATA #IMPLIED >
- <!ATTLIST compile reuseCompiler CDATA #IMPLIED >
- <!ATTLIST compile includeClassesDir CDATA #IMPLIED >
- <!ATTLIST compile argfiles CDATA #IMPLIED >
- <!ATTLIST compile aspectpath CDATA #IMPLIED >
- <!ATTLIST compile classpath CDATA #IMPLIED >
- <!ATTLIST compile extdirs CDATA #IMPLIED >
- <!ATTLIST compile options CDATA #IMPLIED >
- <!ATTLIST compile sourceroots CDATA #IMPLIED >
- <!ATTLIST compile xlintfile CDATA #IMPLIED >
- <!ATTLIST compile outjar CDATA #IMPLIED >
-
- <!ELEMENT inc-compile (dir-changes*,message*)>
- <!ATTLIST inc-compile tag CDATA #REQUIRED >
- <!ATTLIST inc-compile fresh CDATA #IMPLIED >
- <!ATTLIST inc-compile checkModel CDATA #IMPLIED >
-
- <!ELEMENT run (dir-changes*,message*)>
- <!ATTLIST run class CDATA #REQUIRED >
- <!ATTLIST run skipTester CDATA #IMPLIED >
- <!ATTLIST run vm CDATA #IMPLIED >
- <!ATTLIST run options CDATA #IMPLIED >
- <!ATTLIST run errStreamIsError CDATA #IMPLIED >
- <!ATTLIST run outStreamIsError CDATA #IMPLIED >
- <!ATTLIST run fork CDATA #IMPLIED >
- <!ATTLIST run vmargs CDATA #IMPLIED >
- <!ATTLIST run aspectpath CDATA #IMPLIED >
- <!ATTLIST run classpath CDATA #IMPLIED >
- <!ATTLIST run LTW CDATA #IMPLIED >
- <!ATTLIST run usefullltw CDATA #IMPLIED >
- <!ATTLIST run exception CDATA #IMPLIED >
-
- <!ELEMENT message (source*)>
- <!ATTLIST message kind (abort | fail | error | warning | info | Xlint) #REQUIRED >
- <!ATTLIST message line CDATA #IMPLIED >
- <!ATTLIST message text CDATA #IMPLIED >
- <!ATTLIST message file CDATA #IMPLIED >
- <!ATTLIST message details CDATA #IMPLIED >
-
- <!ELEMENT source (#PCDATA)>
- <!ATTLIST source line CDATA #IMPLIED >
- <!ATTLIST source file CDATA #IMPLIED >
-
- <!ELEMENT dir-changes (#PCDATA)>
- <!ATTLIST dir-changes dirToken (classes | run) #IMPLIED >
- <!ATTLIST dir-changes defaultSuffix (.class) #IMPLIED >
- <!ATTLIST dir-changes added CDATA #IMPLIED >
- <!ATTLIST dir-changes removed CDATA #IMPLIED >
- <!ATTLIST dir-changes updated CDATA #IMPLIED >
- <!ATTLIST dir-changes unchanged CDATA #IMPLIED >
- <!ATTLIST dir-changes expDir CDATA #IMPLIED >
- <!ATTLIST dir-changes fastFail CDATA #IMPLIED >
- <!ATTLIST dir-changes delay CDATA #IMPLIED >
-
+<!-- this defines a DOCTYPE for a suite of ajc tests --> +<!-- element-component mappings are in org.aspectj.testing.xml.AjcSpecXmlReader --> +<!-- element names are determined by the component XMLNAME static variable --> + + <!ELEMENT suite (ajc-test | comment)*> + <!ATTLIST suite suiteDir CDATA #IMPLIED > + + <!-- permits leading inc-compile, will fail --> + <!ELEMENT ajc-test ((compile | inc-compile | run | weave | file | ant | comment)*)> + <!ATTLIST ajc-test title CDATA #REQUIRED > + <!ATTLIST ajc-test dir CDATA #REQUIRED > + <!ATTLIST ajc-test pr CDATA #IMPLIED > + <!ATTLIST ajc-test keywords CDATA #IMPLIED > + <!ATTLIST ajc-test comment CDATA #IMPLIED > + <!ATTLIST ajc-test vm CDATA #IMPLIED > + + <!ELEMENT compile (dir-changes*,message*)> + <!ATTLIST compile comment CDATA #IMPLIED > + <!ATTLIST compile staging CDATA #IMPLIED > + <!ATTLIST compile badInput CDATA #IMPLIED > + <!ATTLIST compile files CDATA #IMPLIED > + <!ATTLIST compile reuseCompiler CDATA #IMPLIED > + <!ATTLIST compile includeClassesDir CDATA #IMPLIED > + <!ATTLIST compile argfiles CDATA #IMPLIED > + <!ATTLIST compile aspectpath CDATA #IMPLIED > + <!ATTLIST compile aspectsFiles CDATA #IMPLIED > + <!ATTLIST compile classpath CDATA #IMPLIED > + <!ATTLIST compile modulepath CDATA #IMPLIED > + <!ATTLIST compile inpath CDATA #IMPLIED > + <!ATTLIST compile extdirs CDATA #IMPLIED > + <!ATTLIST compile options CDATA #IMPLIED > + <!ATTLIST compile sourceroots CDATA #IMPLIED > + <!ATTLIST compile xlintfile CDATA #IMPLIED > + <!ATTLIST compile outjar CDATA #IMPLIED > + <!ATTLIST compile outxmlfile CDATA #IMPLIED > + + <!ELEMENT inc-compile (dir-changes*,message*)> + <!ATTLIST inc-compile tag CDATA #REQUIRED > + <!ATTLIST inc-compile fresh CDATA #IMPLIED > + <!ATTLIST inc-compile checkModel CDATA #IMPLIED > + + <!ELEMENT run (dir-changes*,message*,stdout*,stderr*)> + <!-- Either class or modulepath is required --> + <!ATTLIST run class CDATA #IMPLIED > + <!ATTLIST run modulepath CDATA #IMPLIED > + <!ATTLIST run module CDATA #IMPLIED > + <!ATTLIST run skipTester CDATA #IMPLIED > + <!ATTLIST run vm CDATA #IMPLIED > + <!ATTLIST run options CDATA #IMPLIED > + <!ATTLIST run errStreamIsError CDATA #IMPLIED > + <!ATTLIST run outStreamIsError CDATA #IMPLIED > + <!ATTLIST run fork CDATA #IMPLIED > + <!ATTLIST run vmargs CDATA #IMPLIED > + <!ATTLIST run aspectpath CDATA #IMPLIED > + <!ATTLIST run classpath CDATA #IMPLIED > + <!ATTLIST run ltw CDATA #IMPLIED > + <!ATTLIST run usefullltw CDATA #IMPLIED > + <!ATTLIST run exception CDATA #IMPLIED > + <!ATTLIST run xlintfile CDATA #IMPLIED > + + <!ELEMENT message (source*)> + <!ATTLIST message kind (abort | fail | error | warning | info | Xlint | weave) #IMPLIED > + <!ATTLIST message line CDATA #IMPLIED > + <!ATTLIST message text CDATA #IMPLIED > + <!ATTLIST message file CDATA #IMPLIED > + <!ATTLIST message details CDATA #IMPLIED > + + <!ELEMENT source (#PCDATA)> + <!ATTLIST source line CDATA #IMPLIED > + <!ATTLIST source file CDATA #IMPLIED > + + <!ELEMENT dir-changes (#PCDATA)> + <!ATTLIST dir-changes dirToken (classes | run) #IMPLIED > + <!ATTLIST dir-changes defaultSuffix (.class) #IMPLIED > + <!ATTLIST dir-changes added CDATA #IMPLIED > + <!ATTLIST dir-changes removed CDATA #IMPLIED > + <!ATTLIST dir-changes updated CDATA #IMPLIED > + <!ATTLIST dir-changes unchanged CDATA #IMPLIED > + <!ATTLIST dir-changes expDir CDATA #IMPLIED > + <!ATTLIST dir-changes fastFail CDATA #IMPLIED > + <!ATTLIST dir-changes delay CDATA #IMPLIED > + + <!ATTLIST dir-changes dirToken (classes | run) #IMPLIED > + <!ATTLIST dir-changes defaultSuffix (.class) #IMPLIED > + <!ATTLIST dir-changes added CDATA #IMPLIED > + <!ATTLIST dir-changes removed CDATA #IMPLIED > + <!ATTLIST dir-changes updated CDATA #IMPLIED > + <!ATTLIST dir-changes unchanged CDATA #IMPLIED > + <!ATTLIST dir-changes expDir CDATA #IMPLIED > + <!ATTLIST dir-changes fastFail CDATA #IMPLIED > + <!ATTLIST dir-changes delay CDATA #IMPLIED > + + <!ELEMENT stdout (line*)> + <!ATTLIST stdout ordered CDATA #IMPLIED > + + <!ELEMENT stderr (line*)> + <!ATTLIST stderr ordered CDATA #IMPLIED > + + <!ELEMENT line (line*)> + <!ATTLIST line text CDATA #REQUIRED > + <!ATTLIST line vm CDATA #IMPLIED > + + <!ELEMENT weave (message*)> + <!ATTLIST weave classesFiles CDATA #REQUIRED > + <!ATTLIST weave aspectsFiles CDATA #REQUIRED > + <!ATTLIST weave options CDATA #REQUIRED > + <!ATTLIST weave xlintfile CDATA #IMPLIED > + + <!ELEMENT file EMPTY> + <!ATTLIST file deletefile CDATA #IMPLIED > + <!ATTLIST file renamefrom CDATA #IMPLIED > + <!ATTLIST file renameto CDATA #IMPLIED > + + <!ELEMENT ant (stdout*,stderr*)> + <!ATTLIST ant file CDATA #IMPLIED > + <!ATTLIST ant target CDATA #IMPLIED > + <!ATTLIST ant verbose CDATA #IMPLIED > + + <!ELEMENT comment (#PCDATA)> diff --git a/tests/features195/textblock/Code.java b/tests/features195/textblock/Code.java index 89df1e537..5dc430872 100644 --- a/tests/features195/textblock/Code.java +++ b/tests/features195/textblock/Code.java @@ -1,9 +1,9 @@ public class Code { public static void main(String[] argv) { + // Caveat: Putting the closing '"""' on a separate line adds a line break and 'println' (not 'print'!) adds another. System.out.println(""" this is a text block """); } } - diff --git a/tests/features195/textblock/Code2.java b/tests/features195/textblock/Code2.java index f0b39e08b..7020b67a5 100644 --- a/tests/features195/textblock/Code2.java +++ b/tests/features195/textblock/Code2.java @@ -6,10 +6,10 @@ public class Code2 { aspect X { before(): execution(* Code2.main(..)) { + // Caveat: Putting the closing '"""' on a separate line adds a line break and 'println' (not 'print'!) adds another. System.out.println(""" this is a text block in advice """); } } - diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java index 95ab500fc..ee6fb6af6 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -22,7 +22,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { /*========================================== * Generics test plan for pointcuts. - * + * * handler PASS * - does not permit type var spec * - does not permit generic type (fail with type not found) @@ -54,7 +54,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { * staticinitialization PASS * - error on parameterized type PASS N/A * - permit parameterized type + PASS N/A - * - matching with parameterized type + N/A + * - matching with parameterized type + N/A * - wrong number of parameters in parameterized type PASS N/A * - generic type with one type parameter N/A * - generic type with n type parameters N/A @@ -64,7 +64,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { * within PASS * - as above, but allows parameterized type (disallowed in simplified plan) * - wildcards in type parameters N/A - * this PASS + * this PASS * - no type vars * - parameterized types - disallowed in simplification plan * - implements @@ -115,20 +115,20 @@ public class GenericsTests extends XMLBasedAjcTestCase { * - parameter as parameterized type PASS * - no join points for bridge methods PASS * call PASS - * - no generic or parameterized declaring type patterns PASS + * - no generic or parameterized declaring type patterns PASS * - no parameterized throws patterns PASS * - return type as type variable PASS - * - return type as parameterized type PASS + * - return type as parameterized type PASS * - parameter as type variable PASS * - parameter as parameterized type PASS * - calls to a bridge methods PASS * after throwing - can't use parameterized type pattern * after returning - same as for args */ - + /* ========================================== * Generics test plan for ITDs. - * + * * think about: * - 'visibility' default/private/public * - static/nonstatic @@ -148,7 +148,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { * - super/extends with parameterized types <? extends List<String>> * - multiple ITDs defined in one type that reuse type variable letters, specifying different bounds * - generic aspects - * + * * PASS parsing generic ITDs * PASS generic methods * PASS generic constructors @@ -170,15 +170,15 @@ public class GenericsTests extends XMLBasedAjcTestCase { * PASS parameterizing ITDs with type variables * PASS using type variables from the target type in your *STATIC* ITD (field/method/ctor) (error scenario) * PASS basic binary weaving of generic itds - * + * * TODO generic aspect binary weaving (or at least multi source file weaving) * TODO binary weaving with changing types (moving between generic and simple) * TODO bridge method creation (also relates to covariance overrides..) * TODO exotic class/interface bounds ('? extends List<String>','? super anything') * TODO signature attributes for generic ITDs (public only?) - * + * */ - + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(GenericsTests.class); } @@ -186,15 +186,15 @@ public class GenericsTests extends XMLBasedAjcTestCase { protected java.net.URL getSpecFile() { return getClassResource("ajc150.xml"); } - + public void testITDReturningParameterizedType() { runTest("ITD with parameterized type"); } - + public void testPR91267_1() { runTest("NPE using generic methods in aspects 1"); } - + public void testParameterizedTypeAndAroundAdvice_PR115250() { runTest("parameterized type and around advice"); } @@ -202,29 +202,29 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testParameterizedTypeAndAroundAdvice_PR115250_2() { runTest("parameterized type and around advice - 2"); } - + public void testPR91267_2() { runTest("NPE using generic methods in aspects 2"); } - + public void testPR91053() { runTest("Generics problem with Set"); } - + public void testPR87282() { runTest("Compilation error on generic member introduction"); } - + public void testGenericsOverrides_1() { runTest("generics and ITD overrides - 1"); } public void testGenericsOverrides_2() { runTest("generics and ITD overrides - 2"); } public void testGenericsOverrides_3() { runTest("generics and ITD overrides - 3"); } public void testGenericsOverrides_4() { runTest("generics and ITD overrides - 4"); } - - public void testSelfBoundGenerics_pr117296() { + + public void testSelfBoundGenerics_pr117296() { runTest("self bounding generic types"); } - + public void testPR88606() { runTest("Parameterized types on introduced fields not correctly recognized"); } @@ -235,14 +235,14 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testGenericsBang_pr95993() { runTest("NPE at ClassScope.java:660 when compiling generic class"); - } - - + } + + // generic aspects public void testPR96220_GenericAspects1() {runTest("generic aspects - 1");} public void testPR96220_GenericAspects2() {runTest("generic aspects - 2");} public void testPR96220_GenericAspects3() {runTest("generic aspects - 3");} - public void testGenericAspects4() {runTest("generic aspects - 4");} + public void testGenericAspects4() {runTest("generic aspects - 4");} public void testGenericAspects5() {runTest("generic aspects - 5 (ajdk)");} // in separate files public void testGenericAspects6() {runTest("generic aspects - 6 (ajdk)");} // all in one file public void testTypeVariablesInDeclareWarning() { runTest("generic aspect with declare warning using type vars");} @@ -254,12 +254,12 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testDeclareSoftInGenericAspect() { runTest("generic aspect declare soft"); } - + ////////////////////////////////////////////////////////////////////////////// // Generic/Parameterized ITDs - includes scenarios from developers notebook // ////////////////////////////////////////////////////////////////////////////// - - + + // parsing of generic ITD members public void testParseItdNonStaticMethod() {runTest("Parsing generic ITDs - 1");} public void testParseItdStaticMethod() {runTest("Parsing generic ITDs - 2");} @@ -267,8 +267,8 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testParseItdComplexMethod() {runTest("Parsing generic ITDs - 4");} public void testParseItdSharingVars1() {runTest("Parsing generic ITDs - 5");} public void testParseItdSharingVars2() {runTest("Parsing generic ITDs - 6");} - - + + // non static public void testGenericMethodITD1() {runTest("generic method itd - 1");} // <E> ... (List<? extends E>) public void testGenericMethodITD2() {runTest("generic method itd - 2");} // <E extends Number> ... (List<? extends E>) called incorrectly @@ -285,7 +285,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testGenericMethodITD13() {runTest("generic method itd - 13");} // <R extends Comparable<? extends R>> ... (List<R>) called correctly in a clever way ;) public void testGenericMethodITD14() {runTest("generic method itd - 14");} // <R extends Comparable<? super R>> ... (List<R>) called incorrectly in a clever way public void testGenericMethodITD15() {runTest("generic method itd - 15");} // <R extends Comparable<? super R>> ... (List<R>) called correctly in a clever way - + // generic ctors @@ -293,29 +293,29 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testGenericCtorITD2() {runTest("generic ctor itd - 2");} // <T> new(List<T>,List<? extends T>) public void testGenericCtorITD3() {runTest("generic ctor itd - 3");} // <T> new(List<T>,Comparator<? super T>) - + // parameterized ITDs public void testParameterizedMethodITD1() {runTest("parameterized method itd - 1");} // (List<? extends Super>) public void testParameterizedMethodITD2() {runTest("parameterized method itd - 2");} // (List<? extends Number>) called incorrectly public void testParameterizedMethodITD3() {runTest("parameterized method itd - 3");} // (List<? super A>) called incorrectly public void testParameterizedMethodITD4() {runTest("parameterized method itd - 4");} // (List<? super B>) - - + + // differing visibilities public void testPublicITDs() {runTest("public itds");} public void testPublicITDsErrors() {runTest("public itds with errors");} public void testPrivateITDs() {runTest("private itds");} public void testPackageITDs() {runTest("package itds");} - - + + // targetting different types (interface/class/aspect) public void testTargettingInterface() {runTest("targetting interface");} public void testTargettingAspect() {runTest("targetting aspect");} public void testTargettingClass() {runTest("targetting class");} - - - - // using a type variable from the target generic type in your ITD + + + + // using a type variable from the target generic type in your ITD public void testFieldITDsUsingTargetTypeVars1() {runTest("field itd using type variable from target type - 1");} public void testFieldITDsUsingTargetTypeVars2() {runTest("field itd using type variable from target type - 2");} public void testFieldITDsUsingTargetTypeVars3() {runTest("field itd using type variable from target type - 3");} @@ -333,7 +333,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testFieldITDsUsingTargetTypeVars15(){runTest("field itd using type variable from target type -15");} public void testFieldITDsUsingTargetTypeVars16(){runTest("field itd using type variable from target type -16");} public void testFieldITDsUsingTargetTypeVars17(){runTest("field itd using type variable from target type -17");} - + public void testMethodITDsUsingTargetTypeVarsA1() {runTest("method itd using type variable from target type - A1");} public void testMethodITDsUsingTargetTypeVarsA2() {runTest("method itd using type variable from target type - A2");} @@ -358,7 +358,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testMethodITDsUsingTargetTypeVarsO2() {runTest("method itd using type variable from target type - O2");} public void testMethodITDsUsingTargetTypeVarsP1() {runTest("method itd using type variable from target type - P1");} public void testMethodITDsUsingTargetTypeVarsQ1() {runTest("method itd using type variable from target type - Q1");} - + public void testCtorITDsUsingTargetTypeVarsA1() {runTest("ctor itd using type variable from target type - A1");} public void testCtorITDsUsingTargetTypeVarsB1() {runTest("ctor itd using type variable from target type - B1");} public void testCtorITDsUsingTargetTypeVarsC1() {runTest("ctor itd using type variable from target type - C1");} @@ -368,7 +368,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testCtorITDsUsingTargetTypeVarsG1() {runTest("ctor itd using type variable from target type - G1");} public void testCtorITDsUsingTargetTypeVarsH1() {runTest("ctor itd using type variable from target type - H1");} public void testCtorITDsUsingTargetTypeVarsI1() {runTest("ctor itd using type variable from target type - I1");} - + public void testSophisticatedAspectsA() {runTest("uberaspects - A");} public void testSophisticatedAspectsB() {runTest("uberaspects - B");} public void testSophisticatedAspectsC() {runTest("uberaspects - C");} @@ -395,13 +395,13 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testSophisticatedAspectsW() {runTest("uberaspects - W");} public void testSophisticatedAspectsX() {runTest("uberaspects - X");} // from the AJDK public void testSophisticatedAspectsY() {runTest("uberaspects - Y");} // pointcut matching - public void testSophisticatedAspectsZ() {runTest("uberaspects - Z");} - + public void testSophisticatedAspectsZ() {runTest("uberaspects - Z");} + // FIXME asc these two tests have peculiar error messages - generic aspect related // public void testItdUsingTypeParameter() {runTest("itd using type parameter");} // public void testItdIncorrectlyUsingTypeParameter() {runTest("itd incorrectly using type parameter");} - - + + public void testUsingSameTypeVariable() {runTest("using same type variable in ITD");} public void testBinaryWeavingITDsA() {runTest("binary weaving ITDs - A");} @@ -409,17 +409,17 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testBinaryWeavingITDs1() {runTest("binary weaving ITDs - 1");} public void testBinaryWeavingITDs2() {runTest("binary weaving ITDs - 2");} public void testBinaryWeavingITDs3() {runTest("binary weaving ITDs - 3");} - public void testGenericITFSharingTypeVariable() {runTest("generic intertype field declaration, sharing type variable");} - - + public void testGenericITFSharingTypeVariable() {runTest("generic intertype field declaration, sharing type variable");} + + // general tests ... usually just more complex scenarios public void testReusingTypeVariableLetters() {runTest("reusing type variable letters");} public void testMultipleGenericITDsInOneFile() {runTest("multiple generic itds in one file");} public void testItdNonStaticMember() {runTest("itd of non static member");} public void testItdStaticMember() {runTest("itd of static member");} public void testStaticGenericMethodITD() {runTest("static generic method itd");} - - + + public void testAtOverride0() {runTest("atOverride used with ITDs");} public void testAtOverride1() {runTest("atOverride used with ITDs - 1");} public void testAtOverride2() {runTest("atOverride used with ITDs - 2");} @@ -428,8 +428,8 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testAtOverride5() {runTest("atOverride used with ITDs - 5");} public void testAtOverride6() {runTest("atOverride used with ITDs - 6");} public void testAtOverride7() {runTest("atOverride used with ITDs - 7");} - - + + // bridge methods public void testITDBridgeMethodsCovariance1() {runTest("bridging with covariance 1 - normal");} public void testITDBridgeMethodsCovariance2() {runTest("bridging with covariance 1 - itd");} @@ -438,8 +438,8 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testITDBridgeMethods2Normal() {runTest("basic bridging with type vars - 2 - normal");} public void testITDBridgeMethods2Itd() {runTest("basic bridging with type vars - 2 - itd");} public void testITDBridgeMethodsPr91381() {runTest("Abstract intertype method and covariant returns");} - - + + // Just normal source compile of two types with a method override between them public void testGenericITDsBridgeMethods1() { runTest("bridge methods - 1"); @@ -450,7 +450,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { // Now the same thing but the aspect (which doesn't do much!) is binary woven in. public void testGenericITDsBridgeMethods1binary() { runTest("bridge methods - 1 - binary"); - checkMethodsExist("Sub1",new String[]{ + checkMethodsExist("Sub1",new String[]{ "java.lang.Integer Sub1.m()", "java.lang.Object Sub1.m() [BridgeMethod]"}); } @@ -482,7 +482,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { "java.lang.Integer Sub3.m()", "java.lang.Object Sub3.m() [BridgeMethod]"}); } - // Now the two types are disconnected until the aspect supplies a declare parents relationship - + // Now the two types are disconnected until the aspect supplies a declare parents relationship - // the bridge method should still be created in the subtype public void testGenericITDSBridgeMethods4() { runTest("bridge methods - 4"); @@ -497,7 +497,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { "java.lang.Integer Sub4.m()", "java.lang.Object Sub4.m() [BridgeMethod]"}); } - + public void testBinaryBridgeMethodsOne() { runTest("binary bridge methods - one"); checkMethodsExist("OneB",new String[]{ @@ -526,21 +526,21 @@ public class GenericsTests extends XMLBasedAjcTestCase { "java.lang.Double ThreeB.m()" }); } - - + + public void testGenericITDsBridgeMethodsPR91381() {runTest("abstract intertype methods and covariant returns");} public void testGenericITDsBridgeMethodsPR91381_2() {runTest("abstract intertype methods and covariant returns - error");} // ---------------------------------------------------------------------------------------- // generic declare parents tests // ---------------------------------------------------------------------------------------- - + public void testPR96220_GenericDecp() { runTest("generic decp - simple"); checkOneSignatureAttribute(ajc,"Basic"); verifyClassSignature(ajc,"Basic","Ljava/lang/Object;LJ<Ljava/lang/Double;>;LI<Ljava/lang/Double;>;"); } - + // Both the existing type decl and the one adding via decp are parameterized public void testGenericDecpMultipleVariantsOfAParameterizedType1() { runTest("generic decp - implementing two variants #1"); @@ -560,12 +560,12 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testGenericDecpMultipleVariantsOfAParameterizedType4() { runTest("generic decp - implementing two variants #4"); } - + // same as above four tests for binary weaving public void testGenericDecpMultipleVariantsOfAParameterizedType1_binaryWeaving() { runTest("generic decp binary - implementing two variants #1"); } - + public void testGenericDecpMultipleVariantsOfAParameterizedType2_binaryWeaving() { runTest("generic decp binary - implementing two variants #2"); } @@ -585,19 +585,19 @@ public class GenericsTests extends XMLBasedAjcTestCase { checkOneSignatureAttribute(ajc,"Basic6"); verifyClassSignature(ajc,"Basic6","<J:Ljava/lang/Object;>Ljava/lang/Object;LI<TJ;>;LK<Ljava/lang/Integer;>;"); } - + public void testGenericDecpIncorrectNumberOfTypeParams() { runTest("generic decp - incorrect number of type parameters"); } - + public void testGenericDecpSpecifyingBounds() { runTest("generic decp - specifying bounds"); } - + public void testGenericDecpViolatingBounds() { runTest("generic decp - specifying bounds but breaking them"); } - + // need separate compilation test to verify signatures are ok // // public void testIllegalGenericDecp() { @@ -607,18 +607,18 @@ public class GenericsTests extends XMLBasedAjcTestCase { // public void testPR95992_TypeResolvingProblemWithGenerics() { // runTest("Problems resolving type name inside generic class"); // } - + // -- Pointcut tests... public void testHandlerWithGenerics() { runTest("handler pcd and generics / type vars"); } - + public void testPointcutsThatDontAllowTypeVars() { runTest("pointcuts that dont allow type vars"); } - + public void testParameterizedTypesInAtPCDs() { runTest("annotation pcds with parameterized types"); } @@ -626,7 +626,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testAnnotationPatternsWithParameterizedTypes() { runTest("annotation patterns with parameterized types"); } - + public void testStaticInitializationWithParameterizedTypes() { runTest("staticinitialization and parameterized types"); } @@ -643,9 +643,9 @@ public class GenericsTests extends XMLBasedAjcTestCase { // no longer a valid test in simplified design // public void testStaticInitializationWithGenericTypesAdvanced() { -// runTest("staticinitialization with generic types - advanced"); +// runTest("staticinitialization with generic types - advanced"); // } - + public void testWithinPointcutErrors() { runTest("within pcd with various parameterizations and generic types - errors"); } @@ -653,7 +653,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testWithinPointcutWarnings() { runTest("within pcd with various parameterizations and generic types - warnings"); } - + public void testThisTargetPointcutErrors() { runTest("this and target with various parameterizations and generic types - errors"); } @@ -661,47 +661,47 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testThisTargetPointcutRuntime() { runTest("this and target with various parameterizations and generic types - runtime"); } - + public void testInitAndPreInitPointcutErrors() { runTest("init and preinit with parameterized declaring types"); } - + public void testInitAndPreInitPointcutMatchingWithGenericDeclaringTypes() { runTest("init and preinit with raw declaring type pattern"); } - + public void testInitAndPreInitPointcutMatchingWithParameterizedParameterTypes() { runTest("init and preinit with parameterized parameter types"); } - + public void testWithinCodePointcutErrors() { runTest("withincode with various parameterizations and generic types - errors"); } - + public void testWithinCodeMatching() { runTest("withincode with various parameterizations and generic types - matching"); } - + public void testWithinCodeOverrideMatchingWithGenericMembers() { runTest("withincode with overriding of inherited generic members"); } - + public void testExecutionWithRawType() { runTest("execution pcd with raw type matching"); } - + public void testExecutionWithRawSignature() { runTest("execution pcd with raw signature matching"); } - + public void testExecutionPointcutErrors() { runTest("execution with various parameterizations and generic types - errors"); } - + public void testExecutionMatching() { runTest("execution with various parameterizations and generic types - matching"); } - + public void testExecutionOverrideMatchingWithGenericMembers() { runTest("execution with overriding of inherited generic members"); } @@ -709,15 +709,15 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testCallPointcutErrors() { runTest("call with various parameterizations and generic types - errors"); } - + public void testCallMatching() { runTest("call with various parameterizations and generic types - matching"); } - + public void testCallOverrideMatchingWithGenericMembers() { runTest("call with overriding of inherited generic members"); } - + public void testCallWithBridgeMethods() { runTest("call with bridge methods"); } @@ -725,47 +725,47 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testGetAndSetPointcutErrors() { runTest("get and set with various parameterizations and generic types - errors"); } - + public void testGetAndSetPointcutMatchingWithGenericAndParameterizedTypes() { runTest("get and set with various parameterizations and generic declaring types"); } - + public void testGetAndSetPointcutMatchingWithGenericAndParameterizedFieldTypes() { runTest("get and set with various parameterizations and generic field types"); } - + public void testArgsWithRawType() { runTest("args with raw type and generic / parameterized sigs"); } - + public void testArgsParameterizedType() { runTest("args with parameterized type and generic / parameterized sigs"); } - + public void testArgsParameterizedAndWildcards() { runTest("args with parameterized type and wildcards"); } - + public void testArgsWithWildcardVar() { runTest("args with generic wildcard"); } - + public void testArgsWithWildcardExtendsVar() { runTest("args with generic wildcard extends"); } - + public void testArgsWithWildcardSuperVar() { runTest("args with generic wildcard super"); } - + public void testGenericMethodMatching() { runTest("generic method matching"); } - + public void testGenericWildcardsInSignatureMatching() { runTest("generic wildcards in signature matching"); } - + public void testAfterThrowing() { runTest("after throwing with parameterized throw type"); } @@ -773,108 +773,108 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testAfterReturningWithRawType() { runTest("after returning with raw type and generic / parameterized sigs"); } - + public void testAfterReturningParameterizedType() { runTest("after returning with parameterized type and generic / parameterized sigs"); } - + public void testAfterReturningParameterizedAndWildcards() { runTest("after returning with parameterized type and wildcards"); } public void testAfterReturningWithWildcardVar() { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { // See ReferenceType.isCoerceableFrom comments return; } // Something to investigate here. The implementation of isCoerceable runTest("after returning with generic wildcard"); } - + public void testAfterReturningWithWildcardExtendsVar() { runTest("after returning with generic wildcard extends"); } - + public void testAfterReturningWithWildcardSuperVar() { runTest("after returning with generic wildcard super"); } - + public void testAJDKErasureMatchingExamples() { runTest("ajdk notebook: erasure matching examples"); } - + public void testAJDKParameterizedMatchingSimpleExamples() { runTest("ajdk notebook: simple parameterized type matching examples"); } - + public void testAJDKMixedTypeVarsAndParametersExample() { runTest("ajdk notebook: mixed parameterized types and generic methods"); } - + public void testAJDKSignatureAndWildcardExamples() { runTest("ajdk notebook: signature matching with generic wildcards"); } - + // had to remove at e37 level - although pointcuts are likely to work, we can't compile the code // that invokes the bridge methods - seems the compiler is too smart and won't let them through. // public void testAJDKBridgeMethodExamples() { // runTest("ajdk notebook: bridge method examples"); // } - + public void testAJDKArgsExamples() { runTest("ajdk notebook: args examples"); } - + public void testAJDKArgsAndWildcardsExamples() { runTest("ajdk notebook: args and wildcards examples"); } - + public void testAJDKAfterReturningExamples() { runTest("ajdk notebook: after returning examples"); } - + public void testAJDKPointcutInGenericClassExample() { runTest("ajdk notebook: pointcut in generic class example"); } - + // TESTS for generic abstract aspects that get extended and parameterized... - + public void testStaticPointcutParameterization() { runTest("static pointcut parameterization suite"); } - + public void testDynamicPointcutParameterization() { runTest("dynamic pointcut parameterization suite"); } - + public void testReferenceToPointcutInGenericClass() { runTest("reference to pointcut in generic class"); } - + public void testReferenceToPointcutInGenericClass2() { runTest("reference to non-parameterized pointcut in generic class"); } - + public void testDeclareParentsParameterized() { runTest("declare parents parameterized"); } - - public void testDeclarePrecedenceParameterized() { + + public void testDeclarePrecedenceParameterized() { runTest("declare precedence parameterized"); } - + public void testDeclareAnnotationParameterized() { runTest("declare annotation parameterized"); } - + public void testMultiLevelGenericAspects() { runTest("multi-level generic abstract aspects"); } - + // --- helpers - + /** - * When a class has been written to the sandbox directory, you can ask this method to + * When a class has been written to the sandbox directory, you can ask this method to * verify it contains a particular set of methods. Typically this is used to verify that * bridge methods have been created. */ @@ -899,7 +899,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { } catch (MalformedURLException e) { e.printStackTrace(); } - + // check the methods specified do exist for (String string : methods) { if (!methodsFound.remove(string)) { @@ -913,9 +913,9 @@ public class GenericsTests extends XMLBasedAjcTestCase { } fail("These methods weren't expected: "+unexpectedMethods); } - + } - + /** * Use 1.5 API isBridge if available. * See JLS3 15.12.4.5 Create Frame, Synchronize, Transfer Control @@ -924,7 +924,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { // why not importing java.lang.reflect.Method? No BCEL clash? try { final Class<?>[] noparms = new Class[0]; - java.lang.reflect.Method isBridge + java.lang.reflect.Method isBridge = java.lang.reflect.Method.class.getMethod("isBridge", noparms); Boolean result = (Boolean) isBridge.invoke(m, new Object[0]); return result; @@ -934,7 +934,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { } public static JavaClass getClass(Ajc ajc, String classname) { try { - ClassPath cp = + ClassPath cp = new ClassPath(ajc.getSandboxDirectory() + File.pathSeparator + System.getProperty("java.class.path")); SyntheticRepository sRepos = SyntheticRepository.getInstance(cp); JavaClass clazz = sRepos.loadClass(classname); @@ -944,7 +944,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { } return null; } - + public static Signature getClassSignature(Ajc ajc,String classname) { JavaClass clazz = getClass(ajc,classname); Signature sigAttr = null; @@ -954,7 +954,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { } return sigAttr; } - + public static void checkOneSignatureAttribute(Ajc ajc,String classname) { JavaClass clazz = getClass(ajc,classname); Attribute[] attrs = clazz.getAttributes(); @@ -968,15 +968,15 @@ public class GenericsTests extends XMLBasedAjcTestCase { } if (signatureCount>1) fail("Should be only one signature attribute but found "+signatureCount+sb.toString()); } - + // Check the signature attribute on a class is correct public static void verifyClassSignature(Ajc ajc,String classname,String sig) { Signature sigAttr = getClassSignature(ajc,classname); assertTrue("Failed to find signature attribute for class "+classname,sigAttr!=null); assertTrue("Expected signature to be '"+sig+"' but was '"+sigAttr.getSignature()+"'", - sigAttr.getSignature().equals(sig)); + sigAttr.getSignature().equals(sig)); } - + private static String stringify(Class<?>[] clazzes) { if (clazzes==null) return ""; StringBuffer sb = new StringBuffer(); diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196PreviewFeaturesTests.java new file mode 100644 index 000000000..f9c68131e --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196PreviewFeaturesTests.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.aspectj.systemtest.ajc196; + +import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCaseForJava14Only; + +import junit.framework.Test; + +/** + * @author Alexander Kriegisch + */ +public class Ajc196PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava14Only { + + public void testRecords2() { + runTest("using a record"); + } + + public void testInstanceofPatterns() { + runTest("instanceof patterns"); + } + + public void testAdvisingRecords() { + runTest("advising records"); + } + + public void testTextBlock1() { + runTest("textblock 1"); + } + + public void testTextBlock2() { + runTest("textblock 2"); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc196PreviewFeaturesTests.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc196.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java index 00bae65e4..7ec224109 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java @@ -18,58 +18,39 @@ import junit.framework.Test; */ public class Ajc196Tests extends XMLBasedAjcTestCaseForJava14OrLater { - public void testNPE_558995() { - runTest("early resolution of supporting interfaces"); - } - - public void testRecords() { - runTest("simple record"); - checkVersion("Person", Constants.MAJOR_14, Constants.PREVIEW_MINOR_VERSION); - } - - public void testRecords2() { - runTest("using a record"); - } - - public void testInstanceofPatterns() { - runTest("instanceof patterns"); - } - - public void testAdvisingRecords() { - runTest("advising records"); - } - - public void testSwitch1() { - runTest("switch 1"); - checkVersion("Switch1", Constants.MAJOR_14, 0); - } - - public void testSwitch2() { - runTest("switch 2"); - checkVersion("Switch2", Constants.MAJOR_14, 0); - } - - public void testSwitch3() { - runTest("switch 3"); - checkVersion("Switch3", Constants.MAJOR_14, 0); - } - - public void testTextBlock1() { - runTest("textblock 1"); - } - - public void testTextBlock2() { - runTest("textblock 2"); - } - // --- - - public static Test suite() { - return XMLBasedAjcTestCase.loadSuite(Ajc196Tests.class); - } - - @Override - protected java.net.URL getSpecFile() { - return getClassResource("ajc196.xml"); - } + public void testNPE_558995() { + runTest("early resolution of supporting interfaces"); + } + + public void testRecords() { + runTest("simple record"); + checkVersion("Person", Constants.MAJOR_14, Constants.PREVIEW_MINOR_VERSION); + } + + public void testSwitch1() { + runTest("switch 1"); + checkVersion("Switch1", Constants.MAJOR_14, 0); + } + + public void testSwitch2() { + runTest("switch 2"); + checkVersion("Switch2", Constants.MAJOR_14, 0); + } + + public void testSwitch3() { + runTest("switch 3"); + checkVersion("Switch3", Constants.MAJOR_14, 0); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc196Tests.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc196.xml"); + } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java index 0cdfe9290..fa2a3aea2 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java @@ -23,6 +23,9 @@ public class AllTestsAspectJ196 { suite.addTest(Ajc196Tests.suite()); suite.addTest(SanityTestsJava14.suite()); } + if (LangUtil.is14VMOrGreater() && !LangUtil.is15VMOrGreater()) { + suite.addTest(Ajc196PreviewFeaturesTests.suite()); + } return suite; } } diff --git a/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java b/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java index 3b6430c38..b459d2a29 100644 --- a/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java @@ -23,7 +23,7 @@ import junit.framework.Test; public class AptTests extends XMLBasedAjcTestCase { public void testAptWithSpecifiedProcessor() { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { return; } runTest("annotation processing with specified processor"); @@ -33,7 +33,7 @@ public class AptTests extends XMLBasedAjcTestCase { * SPI - http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html */ public void testAptUsingSPI() { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { return; } runTest("annotation processing in action using SPI"); diff --git a/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java b/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java index b3ae1b6c1..a4af3112d 100644 --- a/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java +++ b/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.systemtest.incremental.tools; @@ -75,7 +75,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio + "c:/batik/batik-1.6/lib/batik-svggen.jar;" + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "aspectjrt.jar"; verifyClasspath(cp); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { cp = LangUtil.getJrtFsFilePath() + File.pathSeparator + cp; } @@ -178,7 +178,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio this.outjar = outjar; this.changed |= ICompilerConfiguration.OUTJAR_CHANGED; } - + public void setProcessor(String processor) { this.processor = processor; this.changed |= ICompilerConfiguration.PROCESSOR_CHANGED; diff --git a/tests/src/test/java/org/aspectj/systemtest/knownlimitations/KnownLimitationsTests.java b/tests/src/test/java/org/aspectj/systemtest/knownlimitations/KnownLimitationsTests.java index 4115ff90e..0c0379b58 100644 --- a/tests/src/test/java/org/aspectj/systemtest/knownlimitations/KnownLimitationsTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/knownlimitations/KnownLimitationsTests.java @@ -4,8 +4,8 @@ * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * http://www.eclipse.org/legal/epl-v10.html + * * ******************************************************************/ package org.aspectj.systemtest.knownlimitations; @@ -20,7 +20,7 @@ public class KnownLimitationsTests extends org.aspectj.testing.XMLBasedAjcTestCa } protected java.net.URL getSpecFile() { - return getClassResource("knownlimitations.xml"); + return getClassResource("knownLimitations.xml"); // return new File("../tests/src/org/aspectj/systemtest/knownlimitations/knownlimitations.xml"); } diff --git a/tests/src/test/java/org/aspectj/tests/TestsModuleTests.java b/tests/src/test/java/org/aspectj/tests/TestsModuleTests.java index 72e31e121..351c91f1e 100644 --- a/tests/src/test/java/org/aspectj/tests/TestsModuleTests.java +++ b/tests/src/test/java/org/aspectj/tests/TestsModuleTests.java @@ -26,7 +26,7 @@ public class TestsModuleTests extends TestCase { String name = TestsModuleTests.class.getName(); TestSuite suite = new TestSuite(name); // compiler tests, wrapped for JUnit - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { suite.addTest(AllTests19.suite()); } else { suite.addTest(AllTests18.suite()); diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc121/ajc121.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc121/ajc121.xml index ff2e46106..812c80f0c 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc121/ajc121.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc121/ajc121.xml @@ -10,7 +10,7 @@ <message kind="error" line="4" file="DisjunctVarBinding_3.java" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"/> </compile> </ajc-test> - + <ajc-test dir="bugs/IfPerThis" pr="62458" title="An if() pointcut inside a perthis() clauses an ABORT - null pointer exception in ajc"> <compile files="Testcase1.java"> @@ -20,40 +20,40 @@ <message kind="error" line="27" text="if() pointcut designator cannot be used directly in a per clause"/> </compile> </ajc-test> - + <ajc-test dir="bugs/IfPerThis" pr="62458" title="An if() pointcut inside a perthis() clauses an ABORT - null pointer exception in ajc"> <compile files="Testcase2.java"/> <run class="Testcase2"/> </ajc-test> - + <ajc-test dir="bugs/IfPerThis" pr="62458" title="An if() pointcut inside a perthis() clauses an ABORT - null pointer exception in ajc"> <compile files="Testcase3.java"> <message kind="error" line="2" text="if() pointcut designator cannot be used directly in a per clause"/> </compile> </ajc-test> - + <ajc-test dir="bugs/bug70619" pr="70619" title="compiler aborts with 'conflicting dominates orders' with circular declare precedences"> <compile files="Precedence.java"> <message kind="error" line="0" text="conflicting declare precedence"/> </compile> - <compile files="Conflict.java,Order2.aj,Order1.aj"> + <compile files="Conflict.java,Order2.aj,Order1.aj"> <message kind="error" line="0" text="conflicting declare precedence"/> </compile> <compile files="Conflict.java,Order1.aj,Order2.aj"> <message kind="error" line="0" text="conflicting declare precedence"/> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="53999" title="'can't bind type' message has $ for . in type name for declare soft"> <compile files="Cosmetic.java"> <message kind="error" line="9" text="can't bind type name 'unknown.Error'"/> </compile> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs/intertypeOverrides" pr="69459" title="Hiding of Instance Methods by static methods"> <compile files="IntertypeOverrides.java"> @@ -63,7 +63,7 @@ <message kind="error" line="8" text="void Sub.m() cannot override void Super.m(); overridden method is static"/> </compile> <compile files="Superclass.java,Subclass.java,Aspect1.java"> - <message file="Aspect1.java" kind="error" line="2" + <message file="Aspect1.java" kind="error" line="2" text="void Subclass.staticMethod() cannot override void Superclass.staticMethod(); overridden method is static"/> </compile> <compile files="Superclass.java,Subclass.java,Aspect2.java"> @@ -71,31 +71,31 @@ text="void Subclass.nonstaticMethod() cannot override void Superclass.nonstaticMethod(); overriding method is static"/> </compile> </ajc-test> - + <ajc-test dir="new" title="if(false) optimisation" pr="48990"> <compile files="IfFalse.aj" options="-1.4"/> <run class="IfFalse"/> </ajc-test> - + <ajc-test dir="new" title="if(true) optimisation" pr="48990"> <compile files="IfTrue.aj" options="-1.4"/> <run class="IfTrue"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs/abstractITDs" pr="64331" title="java.lang.NullPointerException in WeaverMessageHandler class"> <compile files="A.java,C.java" aspectpath="B.jar"> <message kind="error" line="1" text="must implement abstract inter-type declaration: void A.foo()"/> </compile> </ajc-test> - + <ajc-test dir="bugs/pr64262" title="ClassCastException at BcelRenderer.java:169" pr="64262"> <compile files="PrimitiveCoercionInExactTypePatternMatching.java"/> </ajc-test> - + <ajc-test dir="bugs" pr="61536" title="Front-end bug, shouldn't allow patterns of the form foo.., should be foo..*"> <compile files="EllipsesStar.java"> @@ -108,7 +108,7 @@ <message kind="error" line="12" text="Syntax error on token"/> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="67774" title="Nullpointer-Exception when defining a withincode() pointcut"> <compile files="WithincodeNPE01.java"> @@ -117,37 +117,37 @@ <message kind="warning" line="11" text="In String ctor"/> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="60015" title="NPE, Incorrect XLint:unmatchedSuperTypeInCall warning"> <compile files="IncorrectXlintOnInterface.java"> </compile> </ajc-test> - + <ajc-test dir="bugs/typeVisibilityProblem" pr="67591" title="invalid warning indicating no match when a match really occurs"> <compile files="Main.java"> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="71273" title="RuntimeException thrown: Could not find instruction: org.apache.bcel.generic.B2I"> <compile files="NoByteToInt.java"/> <run class="NoByteToInt"/> </ajc-test> - + <ajc-test dir="bugs/AroundAdviceJPs" pr="71377" title="Cannot advise private method call in around advice"> <compile files="JoinPointInAroundAdvice.java"/> <run class="JoinPointInAroundAdvice"/> </ajc-test> - + <ajc-test dir="bugs/AroundAdviceJPs" pr="71377" title="Cannot advise private field sets in around advice"> <compile files="FieldJoinPointsInAroundAdvice.java"/> <run class="FieldJoinPointsInAroundAdvice"/> </ajc-test> - + <ajc-test dir="bugs/AroundAdviceJPs" pr="71377" title="Cannot advise private field gets in around advice"> <compile files="FieldGetJoinPointsInAroundAdvice.java"/> @@ -163,8 +163,8 @@ </ajc-test> --> -<!-- these next two tests commented out as they take minutes to run - reinstate if you need to - investigate 59208 for any reason +<!-- these next two tests commented out as they take minutes to run - reinstate if you need to + investigate 59208 for any reason <ajc-test dir="bugs/pr59208" pr="59208" title="Weaver fails in BCEL for large classes"> <compile files="Foo.java, A.aj"> @@ -175,7 +175,7 @@ <ajc-test dir="bugs/pr59208" pr="59208" title="Weaver fails in BCEL for large classes (binary)"> - <compile + <compile aspectpath="test.jar" inpath="classes"> <message kind="error" line="0" text="constant pool too big"></message> @@ -204,7 +204,7 @@ <ajc-test dir="bugs" pr="61572" title="ITDs on inner classes should be static context"> <compile files="PR61572.aj"> - <message kind="error" line="19" text="Cannot make a static reference to the non-static field zzz"></message> + <message kind="error" line="19" text="Cannot make a static reference to the non-static field zzz"/> </compile> </ajc-test> @@ -218,17 +218,17 @@ <message kind="error" line="29" text="ambiguous binding of parameter(s) x across '||' in pointcut"/> </compile> </ajc-test> - + <!-- should NOT raise error, despite Oxford expectations to the contrary --> <ajc-test dir="bugs/oxford" pr="62475" title="resolution of IT field inits"> <compile files="PR62475.java"> </compile> </ajc-test> - - <ajc-test - dir="bugs/invalidAbsoluteTypeName" + + <ajc-test + dir="bugs/invalidAbsoluteTypeName" pr="65925" title="Valid but inaccessible type names should not be flagged by XLint:invalidAbsoluteTypeName"> <compile files="False_InvalidAbsoluteTypeName.java"> @@ -236,19 +236,19 @@ </compile> <run class="False_InvalidAbsoluteTypeName"/> </ajc-test> - + <ajc-test dir="bugs/PR68991" pr="68991" title="intertype initialisers should match field set pointcuts"> <compile files="Simple.java"/> <run class="Simple"/> </ajc-test> - + <ajc-test dir="bugs/PR68991" pr="68991" title="intertype initialisers should match field set pointcuts (oxford testcase)"> <compile files="Oxford.java"/> <run class="Oxford"/> </ajc-test> - + <ajc-test dir="bugs" pr="54421" title="Compile time declarations (warning and error) do not accept string concatenation (with +)"> <compile files="decwStrings.java"> @@ -261,14 +261,14 @@ <message kind="warning" line="39" text="abcdefghijklmnopqrstuvwxyz"/> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="54421" title="Compile time declarations (warning and error) do not accept string concatenation (with +) (2)"> <compile files="decwStringsErroneous.java"> <message kind="error" line="22"/> </compile> </ajc-test> - + <ajc-test dir="bugs/oxford" pr="61768" title="scope for inter-type methods"> <compile files="PR61768.java"> @@ -287,13 +287,13 @@ <compile files="PrivateCall2.java,PrivateCall3.java"/> <run class="def.PrivateCall3"/> </ajc-test> - + <ajc-test dir="bugs/doYouHaveVisiblePrivates" pr="71372" title="NoSuchMethodError calling private method from around advice in inner aspect (3)"> <compile files="PrivateCallInstance.java"/> <run class="PrivateCallInstance"/> </ajc-test> - + <ajc-test dir="bugs/doYouHaveVisiblePrivates" pr="71372" title="NoSuchMethodError calling private method from around advice in inner aspect (4)"> <compile files="PrivateCall_Instance_Package1.java,PrivateCall_Instance_Package2.java"/> @@ -305,7 +305,7 @@ <compile files="a/ITD.aj,b/B.aj"/> <run class="b.B"/> </ajc-test> - + <ajc-test dir="bugs/privilegedNPE" pr="67579" title="NPE on privileged aspect error (2)"> <compile files="b/B.aj,a/ITD.aj"/> @@ -317,14 +317,14 @@ <compile files="b/B.aj,a/ITD.aj"/> <run class="b.B"/> </ajc-test> - + <ajc-test dir="bugs/privilegedAccess" pr="67578" title="Privileged Aspect Access Problem Across Packages (2)"> <compile files="b/B_notPrivileged.aj,a/ITD.aj"> <message kind="error" line="7" text="The method returnNothing(Object) from the type ITD is not visible"/> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="62642" title="proper handling of ExceptionInIntializer inside clinit in presence of after throwing advice"> <compile files="pr62642.java"/> @@ -352,7 +352,7 @@ <message kind="error" line="12" text="Cannot make a static reference to the non-static method clone() from the type Object"/> </compile> </ajc-test> - + <ajc-test dir="design/sourceLines" pr="37020" title="wrong line for method execution join point"> <compile files="TestSourceLines.java"> @@ -380,20 +380,20 @@ title="The introduction on interface causes the interface implementation class error (1)"> <compile files="PublicPublic.java"/> </ajc-test> - - + + <ajc-test dir="bugs/interfaceITDs" pr="70794" title="The introduction on interface causes the interface implementation class error (2)"> <compile files="PackagePublic.java"/> </ajc-test> - + <ajc-test dir="bugs/interfaceITDs" pr="70794" title="The introduction on interface causes the interface implementation class error (3)"> <compile files="PackagePackage.java"> <message kind="error" line="17" text="abstract intertype method declaration 'void PackagePackage.world()' on interface PackagePackage must be declared public (compiler limitation)"/> </compile> </ajc-test> - + <ajc-test dir="bugs/interfaceITDs" pr="70794" title="The introduction on interface causes the interface implementation class error (4)"> <compile files="PublicPackage.java"> @@ -415,7 +415,7 @@ <message kind="error" line="2" text="The abstract pointcut tracingScope can only be defined in an abstract aspect"/> </compile> </ajc-test> - + <ajc-test dir="bugs" pr="72699" title="Bogus error message: The abstract method ajc$pointcut$$tracingScope$a2 in type Tracing can only be defined by an abstract class (2)"> <compile files="BogusMessage2.java"> @@ -423,19 +423,19 @@ <message kind="error" line="2" text="The abstract pointcut tracingScope can only be defined in an aspect"/> </compile> </ajc-test> - - <ajc-test dir="bugs/pr70404" pr="70404" + + <ajc-test dir="bugs/pr70404" pr="70404" title="passing null to array arguments confuzes static join point signature. (1)"> <compile files="Main.java,MainAspect.java"/> <run class="dk.infimum.aspectjtest.Main"/> </ajc-test> - <ajc-test dir="bugs/pr70404" pr="70404" + <ajc-test dir="bugs/pr70404" pr="70404" title="passing null to array arguments confuzes static join point signature. (2)"> <compile files="Main2.java,MainAspect.java"/> <run class="dk.infimum.aspectjtest.Main2"/> </ajc-test> - + <ajc-test dir="bugs" pr="72528" title="around advice throws java.lang.VerifyError at runtime"> <compile files="ArrayCloning.java"/> @@ -448,9 +448,9 @@ <message kind="error" line="13" text="Unhandled"/> </compile> </ajc-test> - - <ajc-test - dir="bugs" + + <ajc-test + dir="bugs" pr="75129" title="NPE on thisJoinPoint mistake"> <compile files="TjpMistake.java"> @@ -462,35 +462,35 @@ <compile files="CounterTest01.java"/> <run class="CounterTest01"/> </ajc-test> - + <ajc-test dir="cflow" pr="76030" title="Optimization of cflow - shared counters (2)"> <compile files="CounterTest02.java" options="-1.4"/> <run class="CounterTest02"/> </ajc-test> - + <ajc-test dir="cflow" pr="76030" title="Optimization of cflow - shared stacks (3)"> <compile files="CounterTest03.java"/> <run class="CounterTest03"/> </ajc-test> - + <ajc-test dir="cflow" pr="76030" title="Optimization of cflow - counters (4)"> <compile files="CounterTest04.java" options="-1.4"/> <run class="CounterTest04"/> </ajc-test> - + <ajc-test dir="cflow" pr="76030" title="Optimization of cflow - counters with abstract pointcuts (5)"> <compile files="CounterTest05.java"/> <run class="CounterTest05"/> </ajc-test> - + <ajc-test dir="bugs/pr76096" pr="76096" title="Anonymous classes unaware of introductions into abstract classes"> <compile files="ConcreteClassA.java"/> <run class="ConcreteClassA"/> </ajc-test> - + <ajc-test dir="bugs" pr="74952" title="before,after not (cflow(within(Trace*))) prints nothing"> <compile files="WhatsGoingOn.java"/> <run class="WhatsGoingOn"/> </ajc-test> - + </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml index 0c3f4da84..7963070e0 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml @@ -892,7 +892,7 @@ <ajc-test dir="bugs150" pr="107059" title="target(@Foo *)"> <compile files="pr107059_2.aj" options="-1.5"> - <message kind="error" line="4" text="wildcard type pattern not allowed"></message> + <message kind="error" line="4" text="wildcard type pattern not allowed"/> </compile> </ajc-test> @@ -907,9 +907,9 @@ <ajc-test dir="bugs150" pr="108050" title="signature matching in override scenario"> <compile files="pr108050.aj" options="-1.5"> - <message kind="warning" line = "2" text="servlet request"></message> - <message kind="warning" line = "7" text="servlet request"></message> - <message kind="warning" line = "21" text="servlet request"></message> + <message kind="warning" line="2" text="servlet request"/> + <message kind="warning" line="7" text="servlet request"/> + <message kind="warning" line="21" text="servlet request"/> </compile> </ajc-test> @@ -923,7 +923,8 @@ <ajc-test dir="bugs150/" pr="107953" title="@AfterThrowing with no formal specified"> <compile files="pr107953.java" options="-1.5"> - <message kind="error" line="8" text="throwing formal 'RuntimeException' must be declared as a parameter in the advice signature"></message> + <message kind="error" line="8" + text="throwing formal 'RuntimeException' must be declared as a parameter in the advice signature"/> </compile> </ajc-test> @@ -980,8 +981,10 @@ <ajc-test title="matching against Object[]" pr="72668" dir="bugs150"> <compile files="pr72668.aj" options="-1.5"> - <message kind="error" line="3" text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"></message> - <message kind="error" line="10" text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"></message> + <message kind="error" line="3" + text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"/> + <message kind="error" line="10" + text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"/> </compile> </ajc-test> @@ -1020,17 +1023,17 @@ <ajc-test dir="bugs" pr="61568" title="Various kinds of ambiguous bindings"> <compile files="AmbiguousBindings.aj" options="-1.4"> - <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> - <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> - <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> - <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"></message> - <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> + <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> + <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> + <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> + <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"/> + <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> </compile> </ajc-test> <ajc-test dir="bugs" pr="61658" title="ambiguous args"> <compile files="PR61658.java" options="-1.5"> - <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"></message> + <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"/> </compile> </ajc-test> @@ -1153,8 +1156,8 @@ <ajc-test dir="bugs150" pr="107858" title="inlined field access in proceed call"> <compile files="pr107858.aj" options="-1.5"> - <message kind="error" line="9" text="too many arguments to proceed, expected 0"></message> - <message kind="error" line="10" text="too many arguments to proceed, expected 0"></message> + <message kind="error" line="9" text="too many arguments to proceed, expected 0"/> + <message kind="error" line="10" text="too many arguments to proceed, expected 0"/> </compile> </ajc-test> @@ -1258,11 +1261,11 @@ <ajc-test dir="bugs150/pr87530" pr="87530" title="final itd methods on interfaces"> <compile files="FinalITDMOnInterface.aj" options="-1.5"> - <message kind="error" line="12" text="Cannot override the final method from A.TestInterface"></message> + <message kind="error" line="12" text="Cannot override the final method from A.TestInterface"/> </compile> <compile files="FinalITDMOnInterface2.aj" options="-1.5"> <!--message kind="error" line="8" text="Cannot override the final method from A.TestInterface"></message--> - <message kind="error" line="8" text="can't override final void A$TestInterface.m()"></message> + <message kind="error" line="8" text="can't override final void A$TestInterface.m()"/> </compile> </ajc-test> @@ -1620,17 +1623,17 @@ <ajc-test title="declare parents : hasmethod(..) - 1" dir="hasmember"> <compile files="HasMethod.aj" options="-1.5 -XhasMember"/> - <run class="HasMethod"></run> + <run class="HasMethod"/> </ajc-test> <ajc-test title="declare parents : hasmethod(..) - 2" dir="hasmember"> <compile files="HasMethodInherited.aj" options="-1.5 -XhasMember"/> - <run class="HasMethodInherited"></run> + <run class="HasMethodInherited"/> </ajc-test> <ajc-test title="declare parents : hasmethod(..) - 3" dir="hasmember"> <compile files="HasPrivateMethodInherited.aj" options="-1.5 -XhasMember"/> - <run class="HasPrivateMethodInherited"></run> + <run class="HasPrivateMethodInherited"/> </ajc-test> <ajc-test title="declare parents : hasmethod(..) - 4" dir="hasmember"> @@ -1641,17 +1644,17 @@ <ajc-test title="declare parents : hasfield(..) - 1" dir="hasmember"> <compile files="HasField.aj" options="-1.5 -XhasMember"/> - <run class="HasField"></run> + <run class="HasField"/> </ajc-test> <ajc-test title="declare parents : hasfield(..) - 2" dir="hasmember"> <compile files="HasFieldInherited.aj" options="-1.5 -XhasMember"/> - <run class="HasFieldInherited"></run> + <run class="HasFieldInherited"/> </ajc-test> <ajc-test title="declare parents : hasfield(..) - 3" dir="hasmember"> <compile files="HasPrivateFieldInherited.aj" options="-1.5 -XhasMember"/> - <run class="HasPrivateFieldInherited"></run> + <run class="HasPrivateFieldInherited"/> </ajc-test> <!-- Annotation binding tests --> @@ -3150,7 +3153,7 @@ <compile files="BaseTypes.java,DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"> <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/> <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/> - <message king="error" line="17" text="A is not a valid target for annotation ColorA"/> + <message kind="error" line="17" text="A is not a valid target for annotation ColorA"/> <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/> <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/> <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml index 429d2edf1..00bf094bc 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml @@ -580,7 +580,7 @@ <ajc-test dir="bugs153/pr149560" title="incorrect staticinitialization weaving - codestyle"> <compile files="CodeStyle.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point 'staticinitialization(void MyAspect.<clinit>())' in Type 'MyAspect' (CodeStyle.java:3) advised by after advice from 'MyAspect' (CodeStyle.java:4)"/> - <message kind="weave" test="Join point 'staticinitialization(void CodeStyle.<clini>())' in Type 'CodeStyle' (CodeStyle.java:9) advised by after advice from 'MyAspect' (CodeStyle.java:4)"/> + <message kind="weave" text="Join point 'staticinitialization(void CodeStyle.<clinit>())' in Type 'CodeStyle' (CodeStyle.java:9) advised by after advice from 'MyAspect' (CodeStyle.java:4)"/> </compile> <run class="CodeStyle"> <stdout> @@ -594,7 +594,7 @@ <ajc-test dir="bugs153/pr149560" title="incorrect staticinitialization weaving - annstyle"> <compile files="AnnStyle.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point 'staticinitialization(void MyAspect.<clinit>())' in Type 'MyAspect' (AnnStyle.java:5) advised by after advice from 'MyAspect' (AnnStyle.java:7)"/> - <message kind="weave" test="Join point 'staticinitialization(void AnnStyle.<clini>())' in Type 'AnnStyle' (AnnStyle.java:12) advised by after advice from 'MyAspect' (AnnStyle.java:7)"/> + <message kind="weave" text="Join point 'staticinitialization(void AnnStyle.<clinit>())' in Type 'AnnStyle' (AnnStyle.java:12) advised by after advice from 'MyAspect' (AnnStyle.java:7)"/> </compile> <run class="AnnStyle"> <stdout> @@ -791,10 +791,10 @@ <compile files="TestAroundClosure.aj" options="-1.4"/> <run class="HelloWorld" ltw="aop-aroundclosure.xml"> <stdout> - <line text="&rt; ConcreteAspectWithAroundClosure()"/> + <line text="> ConcreteAspectWithAroundClosure()"/> <line text="< ConcreteAspectWithAroundClosure()"/> <line text="? void HelloWorld.main(String[])"/> - <line text="&rt; HelloWorld()"/> + <line text="> HelloWorld()"/> <line text="< HelloWorld()"/> <line text="Hello World!"/> </stdout> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml index b9aa9525a..650bdea43 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -585,7 +585,7 @@ <ajc-test dir="bugs1612/pr345515" title="anno copying"> <compile files="Code.java" options="-1.5"/> -<run class="Code"></run> + <run class="Code"/> </ajc-test> <ajc-test dir="bugs1612/pr327867" title="synthetic methods"> @@ -653,7 +653,7 @@ <ajc-test dir="bugs1612/pr315398" title="verifyerror - 2"> <compile files="Code2.java" options="-1.5"> </compile> -<run class="Code2"></run> + <run class="Code2"/> </ajc-test> <ajc-test dir="bugs1612/pr335810" title="rawtype warning"> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml index e1c8e87b4..a14d8d0e7 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml @@ -15,44 +15,44 @@ <ajc-test dir="bugs164/pr268689" title="generics aspects npe"> <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs164/pr267559" title="generics and itd npe"> <compile files="IMarker.java ClassB.java Aspect.java ClassA.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs164/pr266564" title="annotation style long"> <compile files="AA.java" options="-1.5"/> <run class="business.AA"/> </ajc-test> - + <ajc-test dir="bugs164/pr266564" title="annotation style long - 2"> <compile files="CC.java" options="-1.5"/> <run class="business.CC"/> </ajc-test> - + <ajc-test dir="bugs164/pr266420" title="unused private warning"> <compile files="A.java" options="-1.5 -warn:unusedPrivate"/> </ajc-test> - + <ajc-test dir="bugs164/pr266420" title="unused private warning - 2"> <compile files="B.java" options="-1.5 -warn:unusedPrivate"> <message kind="warning" text="The value of the field B.i is not used"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr266420" title="unused private warning - 3"> <compile files="C.java" options="-1.5 -warn:unusedPrivate"> <message kind="warning" text="The value of the field C.j is not used"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr265729" title="aspectpath model"> <compile files="Aspect.java Orange.java Strawberry.java Fruit.java" outjar="library.jar" options="-emacssym"/> <compile files="Orange.java Strawberry.java Fruit.java" aspectpath="library.jar" options="-emacssym"/> <!-- --> </ajc-test> - + <ajc-test dir="bugs164/pr266220" title="generics and aop.xml"> <compile files="Code.java"/> <compile files="Isolator.java" outjar="aspects.jar" options="-1.5"/> @@ -64,21 +64,21 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 1"> <compile files="NeverWeave.java" options="-1.5 -Xlint:ignore -showWeaveInfo"/> </ajc-test> - + <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 2"> <compile files="AlwaysWeave.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 3"> <compile files="NeverWeave2.java" options="-1.5 -Xlint:ignore -showWeaveInfo"/> </ajc-test> - + <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 4"> <compile files="AlwaysWeave2.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point"/> @@ -92,19 +92,19 @@ <message kind="warning" line="26" text="advice defined"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr265695" title="new syntax for inherited anno - 1"> <compile files="AspNew.aj" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr265695" title="new syntax for inherited anno - 3"> <compile files="AspNew2.aj" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr265418" title="varargs"> <compile files="A.java" options="-1.5"/> <run class="A"> @@ -118,25 +118,25 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs164" title="parser problem for array subtypes"> <compile files="PR148508.java"/> <run class="PR148508"> </run> </ajc-test> - + <ajc-test dir="bugs164/pr265360" title="incorrect resolution of Date"> <compile files="Foo.java Main.java" options="-1.5"> <message kind="warning" text="no match for this type name: Date "/> - <message kind="warning" test="advice defined in"/> + <message kind="warning" text="advice defined in"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr233032" title="dual preClinit"> <compile files="A.java" options="-1.5"/> <run class="A"/> </ajc-test> - + <ajc-test dir="features164/aopconfig/one" title="aop config - 1"> <compile files="A.java A2.java B.java foo.xml" options="-1.5 -showWeaveInfo -xmlConfigured"> <message kind="weave" text="Join point 'staticinitialization(void A.<clinit>())' in Type 'A' (A.java:1) advised by before advice from 'A' (A.java:2)"/> @@ -144,20 +144,20 @@ <message kind="weave" text="Join point 'staticinitialization(void B.<clinit>())' in Type 'B' (B.java:1) advised by before advice from 'A' (A.java:2)"/> </compile> </ajc-test> - + <ajc-test dir="features164/aopconfig/one" title="aop config - 2"> <compile files="A.java A2.java B.java B2.java foo2.xml" options="-1.5 -showWeaveInfo -xmlConfigured"> <message kind="weave" text="Join point 'staticinitialization(void B.<clinit>())' in Type 'B' (B.java:1) advised by before advice from 'A' (A.java:2)"/> </compile> </ajc-test> - + <ajc-test dir="features164/aopconfig/two" title="aop config - 3"> <!-- type pattern in the scope in foo.xml is complete nonsense --> <compile files="A.java B.java foo.xml" options="-1.5 -Xlint:ignore -xmlConfigured"> <message kind="error" text="Unable to parse scope as type pattern"/> </compile> </ajc-test> - + <ajc-test dir="features164/aopconfig/one" title="aop config - 4"> <!-- excluding a type --> <compile files="A.java A2.java B.java B2.java case4.xml" options="-1.5 -Xlint:ignore -xmlConfigured -showWeaveInfo"> @@ -169,7 +169,7 @@ <message kind="weave" text="Join point 'staticinitialization(void B.<clinit>())' in Type 'B' (B.java:1) advised by before advice from 'A' (A.java:2)"/> </compile> </ajc-test> - + <ajc-test dir="features164/aopconfig/one" title="aop config - 5"> <!-- excluding a type --> <compile files="A.java A2.java B.java B2.java case5.xml" options="-1.5 -Xlint:ignore -xmlConfigured -showWeaveInfo"> @@ -179,100 +179,100 @@ <message kind="weave" text="Join point 'staticinitialization(void A2.<clinit>())' in Type 'A2' (A2.java:1) advised by before advice from 'A' (A.java:2)"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr263310" title="inner handles"> <compile files="HandleTestingAspect.java" options="-1.5 -emacssym -Xlint:ignore"/> </ajc-test> - + <ajc-test dir="bugs164/pr263666" title="around advice handles"> <compile files="x/A.java x/B.java x/OverrideOptions.aj" options="-1.5 -emacssym"/> </ajc-test> - + <ajc-test dir="bugs164" title="ajcthis not read"> <compile files="pr195090.java" options="-1.5 -warn:+unusedArgument"> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr256779" title="anno decprecedence"> <compile files="ThisAspect.java OtherAspect.java" options="-1.5"/> <run class="com.ThisAspect" ltw="aop.xml"/> </ajc-test> - + <ajc-test dir="bugs164/pr262905" title="recursive cflow"> <compile files="A.java" options="-1.5"> <message kind="warning" line="5" text="advice defined"/> <message kind="error" line="3" text="circular"/> </compile> </ajc-test> - + <ajc-test dir="bugs164/pr194314" title="broken lvt - 1"> <compile files="Service.java IService.java Main.java ServiceInterceptor.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs164/pr194314" title="broken lvt - 2"> <compile files="Service.java IService.java Main.java ServiceInterceptorCodeStyle.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs164/pr194314" title="broken lvt - 3"> <compile files="ITDOne.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs164/pr262509" title="debugging before advice"> <compile files="Foo.java" options="-1.5"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr262509" title="debugging before advice - 2"> <compile files="Foo2.java" options="-1.5 -preserveAllLocals"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr262509" title="debugging before advice - 3"> <compile files="Foo3.java" options="-1.5 -preserveAllLocals"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr246393" title="rogue errors - 1"> <compile files="D.java" options="-1.5"> <message kind="error" line="2" text="error on token"/> </compile> - </ajc-test> + </ajc-test> <ajc-test dir="bugs164/pr262257" title="name clash"> <compile files="C.java" options="-1.5"> </compile> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr260384" title="compiling spring"> <compile files="Broken.java" options="-1.5"> </compile> - </ajc-test> + </ajc-test> <ajc-test dir="bugs164/pr260384" title="compiling spring - 2"> <compile files="Broken2.java" options="-1.5"> </compile> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr260384" title="compiling spring - 3"> <compile files="C.java" options="-1.5 -emacssym"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr260384" title="compiling spring - 4"> <compile files="D.java" options="-1.5"> </compile> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr164016" title="ataspectj decp 164016"> <compile files="Code.aj" options="-1.5"/> <run class="test.Code"/> - </ajc-test> - - + </ajc-test> + + <ajc-test dir="bugs164/pr164016" title="ataspectj decp 164016 - 2"> <compile files="Code.java TargetBad.java TargetGood.java" aspectpath="code.jar" options="-1.5"/> <run class="test.Code"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs164/pr258788" title="ataspectj decp 258788"> <compile files="NameAware.java NameManager.java NameManagerImpl.java StartClass.java TargetClass.java TestAspect.java" options="-1.5"/> <run class="com.StartClass"/> - </ajc-test> - -</suite>
\ No newline at end of file + </ajc-test> + +</suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml index fde9ff259..f3f18f6d9 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml @@ -5,15 +5,15 @@ <ajc-test dir="bugs170/pr382723" title="generic aspect"> <compile files="FooAspect.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs170/pr382723" title="generic aspect 2"> <compile files="FooAspect2.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs170/pr382723" title="generic aspect 3"> <compile files="FooAspect3.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs170/pr382723" title="generic aspect 4"> <compile files="Foo.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point 'constructor-call(void java.util.LinkedList.<init>())' in Type 'Foo' (Foo.java:41) advised by around advice from 'Bar' (Foo.java:14)"/> @@ -26,33 +26,33 @@ </stdout> </run> </ajc-test> - - + + <!-- no declare parents, only ITD --> <ajc-test dir="bugs170/pr382189/one" title="covariant generics 1"> <compile files="A.java A_ITD.aj B.java SuperA.java SuperB.java" options="-1.5"/> </ajc-test> - + <!-- now declare parents and ITD --> <ajc-test dir="bugs170/pr382189/two" title="covariant generics 2"> <compile files="A.java A_ITD.aj B.java SuperA.java SuperB.java" options="-1.5"/> </ajc-test> - + <!-- now run it --> <ajc-test dir="bugs170/pr382189/three" title="covariant generics 3"> <compile files="A.java A_ITD.aj B.java SuperA.java SuperB.java" options="-1.5"/> <run class="A"/> </ajc-test> - + <ajc-test dir="bugs170/pr382435/one" title="covariant generic itds 1"> <compile files="bug/A.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs170/pr382435/two" title="covariant generic itds 2"> <compile files="bug/A.java" options="-1.5"/> <run class="bug.A"/> </ajc-test> - + <ajc-test dir="bugs170/pr382189" title="covariant generics"> <compile files="covbug/A.java covbug/A_ITD.aj covbug/B.java covbug/SuperA.java covbug/SuperB.java" options="-1.5"/> <!-- <run class="Foo"> @@ -60,7 +60,7 @@ <line text="@Anno()"/></stdout> </run> --> </ajc-test> - + <ajc-test dir="bugs170/pr377130" title="missing annos on priv aspects"> <compile files="Foo.java" options="-1.5"/> <run class="Foo"> @@ -68,7 +68,7 @@ <line text="@Anno()"/></stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/pr377130" title="missing annos on priv aspects - 2"> <compile files="Foo2.java" options="-1.5"/> <run class="Foo2"> @@ -83,7 +83,7 @@ <compile inpath="code.jar" aspectpath="aspects.jar" options="-showWeaveInfo"> <message kind="weave" text="Join point 'constructor-call(void R.<init>())'"/> </compile> - <!-- + <!-- if we had a 1.7 vm we could use this: <compile files="RAj.java" options="-1.7 -Xlint:ignore"/> <run class="R" ltw="aop.xml"> @@ -110,7 +110,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/ltw" title="dec at field ordering 2"> <compile files="Anno.java Main.java TriggerAll.java MyObject.java" options="-1.5"/> <run class="ch.tests.Main"> @@ -120,7 +120,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/ltw" title="dec at field ordering ltw 1"> <compile files="Anno.java Main.java MyObject.java" options="-1.5"/> <compile files="TriggerAll.java" options="-Xlint:ignore -1.5 "/> @@ -144,7 +144,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method 2"> <compile files="Hello.java Anno2.java" options="-1.5"/> <run class="Hello" ltw="aop2.xml"> @@ -163,7 +163,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec at field"> <compile files="Hello2.java Anno.java" options="-1.5"/> <run class="Hello2" ltw="aop3.xml"> @@ -174,7 +174,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - variants 1"> <compile files="Hello4.java Anno4.java" options="-1.5"/> <run class="Hello4" ltw="aop4.xml"> @@ -195,7 +195,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - variants 2"> <compile files="Hello5.java Anno5.java" options="-1.5"/> <run class="Hello5" ltw="aop5.xml"> @@ -216,7 +216,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - multiple values"> <compile files="Hello6.java Anno6.java" options="-1.5"/> <run class="Hello6" ltw="aop6.xml"> @@ -228,7 +228,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - multiple values and spaces"> <compile files="Hello6.java Anno6.java" options="-1.5"/> <run class="Hello6" ltw="aop6a.xml"> @@ -240,7 +240,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - type"> <compile files="Hello7.java Anno7.java" options="-1.5"/> <run class="Hello7" ltw="aop7.xml"> @@ -261,7 +261,7 @@ </compile> <run class="AspectTest"/> </ajc-test> - + <ajc-test dir="bugs170/transientTjpFields" title="transient tjp fields"> <compile files="Code.java" options="-Xset:makeTjpFieldsTransient=true"> </compile> @@ -271,54 +271,54 @@ <compile files="PerThis.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="pertarget"> <compile files="PerTarget.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="percflow"> <compile files="PerCflow.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="pertypewithin"> <compile files="PerTypeWithin.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="diamond 1"> <compile files="Diamond.java" options="-1.5"> <message kind="error" line="11" text="'<>' operator is not allowed for source level below 1.7"/> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="diamond 2"> <compile files="Diamond.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="diamond itd 1"> <compile files="DiamondITD.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="literals 1"> <compile files="Literals.java" options="-1.5"> <message kind="error" line="8" text="Underscores can only be used with source level 1.7 or greater"/> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="literals 2"> <compile files="Literals.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="literals itd 1"> <compile files="LiteralsITD.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="string switch 1"> <compile files="StringSwitch.java" options="-1.5"> <message kind="error" line="9" text="Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted"/> @@ -329,7 +329,7 @@ <compile files="StringSwitch.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="multi catch 1"> <compile files="MultiCatch.java" options="-1.5"> <message kind="error" line="6" text="Multi-catch parameters are not allowed for source level below 1.7"/> @@ -340,12 +340,12 @@ <compile files="MultiCatch.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="multi catch with handler 1"> <compile files="MultiCatchWithHandler.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="multi catch aspect 1"> <compile files="MultiCatchAspect.java" options="-1.7"> </compile> @@ -355,23 +355,23 @@ <compile files="TryResources.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="try resources 2"> <compile files="TryResourcesAspect.java" options="-1.7"> </compile> </ajc-test> - + <ajc-test dir="bugs170/language" title="multi catch with handler 2"> <compile files="MultiCatchWithHandler2.java" options="-1.7"> </compile> - <run class="MultiCatchWithHandler2"></run> + <run class="MultiCatchWithHandler2"/> </ajc-test> - + <ajc-test dir="bugs170/sanity" title="sanity 1"> <compile files="DeclareAtType.java" options="-1.5"> </compile> </ajc-test> - + <ajc-test dir="bugs170/pr363979" title="missing impl"> <compile files="Example.java" options="-1.5"/> <run class="Example"> @@ -380,7 +380,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/pr363979" title="missing impl 2"> <compile files="Example2.java" options="-1.5"/> <run class="Example2"> @@ -389,12 +389,12 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs170/pr364380" title="stackoverflow"> <compile files="X.aj" options="-1.5" outjar="foo.jar"/> <compile files="C.java" options="-1.5" inpath="foo.jar"> <message kind="warning" text="An advice already exists for setting an owner"/> </compile> </ajc-test> - + </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc172/ajc172.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc172/ajc172.xml index 4509d4979..79cb7b311 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc172/ajc172.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc172/ajc172.xml @@ -107,7 +107,7 @@ </ajc-test> <ajc-test dir="bugs172/pr398246" title="if pointcut names 4"> - <compile files="Code4.java" options="-1.5"></compile> + <compile files="Code4.java" options="-1.5"/> <compile files="Code4.java" options="-1.5" outjar="aspects.jar"/> <run class="Code4" options="-1.5"> <stdout> @@ -115,7 +115,7 @@ <line text="advice"/> </stdout> </run> - <compile files="CodeExtra4.java" aspectpath="aspects.jar" options="-1.5"></compile> + <compile files="CodeExtra4.java" aspectpath="aspects.jar" options="-1.5"/> <run class="CodeExtra4" options="-1.5"> <stdout> <line text="advice"/> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml index 0171f5b55..90fcbc1e7 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml @@ -27,7 +27,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs1810/500035" title="ataspectj binding 2"> <compile options="-1.8" files="Code2.java"/> <run class="Code2"> @@ -39,7 +39,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs1810/500035" title="ataspectj binding 3 -XnoInline"> <compile options="-1.8 -XnoInline" files="Code3.java"/> <run class="Code3"> @@ -59,7 +59,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs1810/500035" title="ataspectj binding 4"> <compile options="-1.8" files="Code3.java"/> <run class="Code3"> @@ -79,7 +79,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs1810/501656" title="generics exception"> <compile options="-1.8 -parameters" files="ApplicationException.java ApplicationExceptionHandler.java"/> </ajc-test> @@ -90,7 +90,7 @@ <ajc-test dir="bugs1810/493554" title="pertarget"> <compile options="-1.8" files="Dep.java FooAspect.aj Cmd.java"/> - <run class="example.kusedep.Cmd"></run> + <run class="example.kusedep.Cmd"/> </ajc-test> <ajc-test dir="bugs1810/ambig" title="ambiguous message - 18"> @@ -106,5 +106,5 @@ <message kind="error" text="The method toList() in the type Collectors is not applicable for the arguments (Inner::getId)"/> </compile> </ajc-test> - + </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc183/ajc183.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc183/ajc183.xml index e1c40ae72..0e495139c 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc183/ajc183.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc183/ajc183.xml @@ -26,7 +26,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs183/436653/abstract" title="suppress type not found - abstract 1"> <compile options="-1.8 -Xlint:ignore" files="A.java" outjar="codeA.jar"/> <compile options="-1.8" files="AA.java X.java" classpath="codeA.jar" outjar="aspects.jar"/> @@ -44,7 +44,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs183/436653" title="suppress type not found 4"> <compile options="-1.8 -Xlint:ignore" files="X.java" outjar="aspects.jar"/> <compile options="-1.8" files="Runner.java"/> @@ -54,10 +54,10 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs183/436653" title="suppress type not found 5"> <compile options="-1.8 -Xlint:ignore" files="X.java" outjar="aspects.jar"/> - <compile class="-1.8" files="A.java"/> + <compile options="-1.8" files="A.java"/> <compile options="-1.8" files="Runner.java"/> <run class="Runner" ltw="aop.xml"> <stdout> @@ -66,7 +66,7 @@ </stdout> </run> </ajc-test> - + <!-- annotation style aspect, missing type so deactivated --> <ajc-test dir="bugs183/436653" title="suppress type not found 6"> <compile options="-1.8 -Xlint:ignore" files="AnnoX.java" outjar="aspects.jar"/> @@ -77,7 +77,7 @@ </stdout> </run> </ajc-test> - + <!-- annotation style aspect, type not missing so not deactivated --> <ajc-test dir="bugs183/436653" title="suppress type not found 7"> <compile options="-1.8 -Xlint:ignore" files="AnnoX.java A.java" outjar="aspects.jar"/> @@ -89,7 +89,7 @@ </stdout> </run> </ajc-test> - + <!-- annotation style aspect, type not missing so not deactivated --> <ajc-test dir="bugs183/436653" title="suppress type not found 8"> <compile options="-1.8 -Xlint:ignore" files="AnnoX.java A.java" outjar="aspects.jar"/> @@ -114,7 +114,7 @@ <message kind="info" text="*deactivating aspect 'XA2' as it requires type 'B' which cannot be found on the classpath"/> </compile> </ajc-test> - + <ajc-test dir="bugs183/436653" title="suppress type not found 2"> <compile options="-1.8" files="A.java" outjar="typeA.jar"/> <!-- adviceDidNotMatch messages are suppressed here --> @@ -122,7 +122,7 @@ <compile options="-1.8" files="Code.java" aspectpath="aspects.jar"> </compile> </ajc-test> - + <ajc-test dir="bugs183/436653" title="suppress type not found"> <compile options="-1.8" files="A.java" outjar="typeA.jar"/> <!-- adviceDidNotMatch messages are suppressed here --> @@ -148,12 +148,12 @@ <compile options="-1.8" files="ControlFlow.java ForReplacer.java ControlFlowCommand.java ControlFlowDriver.java"> </compile> </ajc-test> - + <ajc-test dir="bugs183/444398" title="abstract aspect npe"> <compile options="-1.8" files="Bottom.java Middle.java Top.java"> </compile> </ajc-test> - + <ajc-test dir="bugs183/442425" title="anno style decp"> <compile options="-1.8" files="EntityController.java IEntityController.java MyAnnotatedController.java EntityControllerAspect.java EntityMongoController.java"> <message kind="error" line="23" text="Type mismatch: cannot convert from MyAnnotatedController<String> to IEntityController<String>"/> @@ -173,10 +173,10 @@ </run> --> </ajc-test> - + <ajc-test dir="bugs183/443477" title="verifyerror"> <compile options="-1.7" files="Coo.java"/> <run class="Coo"/> </ajc-test> - + </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc187/ajc187.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc187/ajc187.xml index dfa22f696..86594730d 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc187/ajc187.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc187/ajc187.xml @@ -41,7 +41,7 @@ </ajc-test> <ajc-test dir="bugs187/469889" title="broken java"> -<!-- +<!-- <compile files="A.java B.java AbstractA.java BImpl.java Main.java" options="-1.8"/> --> <compile files="Code.java" options="-1.8"/> @@ -61,7 +61,7 @@ <compile files="B.java" options="-XhasMember -1.8 -showWeaveInfo"> <message kind="weave" text="Extending interface set for type 'B' (B.java) to include 'java.io.Serializable' (B.java)"/> </compile> -<run class="B"></run> + <run class="B"/> </ajc-test> </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190.xml index 8290bc418..0db1fdc14 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190.xml @@ -190,7 +190,7 @@ <ajc-test dir="bugs190/modules" title="weave module"> <compile files="aspect1/Azpect1.java" inpath="module1/module-one.jar" outjar="runner.jar" options="-1.8"/> - <java classpath="runner.jar" class="a.b.c.Code"/> + <run classpath="runner.jar" class="a.b.c.Code"/> </ajc-test> <ajc-test dir="bugs190/various" title="setting static final outside clinit"> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190_from150.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190_from150.xml index 9eacce24a..885a0b74e 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190_from150.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc190/ajc190_from150.xml @@ -892,7 +892,7 @@ <ajc-test dir="bugs150" pr="107059" title="target(@Foo *)"> <compile files="pr107059_2.aj" options="-1.9"> - <message kind="error" line="4" text="wildcard type pattern not allowed"></message> + <message kind="error" line="4" text="wildcard type pattern not allowed"/> </compile> </ajc-test> @@ -907,9 +907,9 @@ <ajc-test dir="bugs150" pr="108050" title="signature matching in override scenario"> <compile files="pr108050.aj" options="-1.9"> - <message kind="warning" line = "2" text="servlet request"></message> - <message kind="warning" line = "7" text="servlet request"></message> - <message kind="warning" line = "21" text="servlet request"></message> + <message kind="warning" line="2" text="servlet request"/> + <message kind="warning" line="7" text="servlet request"/> + <message kind="warning" line="21" text="servlet request"/> </compile> </ajc-test> @@ -923,7 +923,8 @@ <ajc-test dir="bugs150/" pr="107953" title="@AfterThrowing with no formal specified"> <compile files="pr107953.java" options="-1.9"> - <message kind="error" line="8" text="throwing formal 'RuntimeException' must be declared as a parameter in the advice signature"></message> + <message kind="error" line="8" + text="throwing formal 'RuntimeException' must be declared as a parameter in the advice signature"/> </compile> </ajc-test> @@ -980,8 +981,10 @@ <ajc-test title="matching against Object[]" pr="72668" dir="bugs150"> <compile files="pr72668.aj" options="-1.9"> - <message kind="error" line="3" text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"></message> - <message kind="error" line="10" text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"></message> + <message kind="error" line="3" + text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"/> + <message kind="error" line="10" + text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"/> </compile> </ajc-test> @@ -1020,17 +1023,17 @@ <ajc-test dir="bugs" pr="61568" title="Various kinds of ambiguous bindings"> <compile files="AmbiguousBindings.aj" options="-1.4"> - <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> - <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> - <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> - <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"></message> - <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message> + <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> + <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> + <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> + <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"/> + <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"/> </compile> </ajc-test> <ajc-test dir="bugs" pr="61658" title="ambiguous args"> <compile files="PR61658.java" options="-1.9"> - <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"></message> + <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"/> </compile> </ajc-test> @@ -1153,8 +1156,8 @@ <ajc-test dir="bugs150" pr="107858" title="inlined field access in proceed call"> <compile files="pr107858.aj" options="-1.9"> - <message kind="error" line="9" text="too many arguments to proceed, expected 0"></message> - <message kind="error" line="10" text="too many arguments to proceed, expected 0"></message> + <message kind="error" line="9" text="too many arguments to proceed, expected 0"/> + <message kind="error" line="10" text="too many arguments to proceed, expected 0"/> </compile> </ajc-test> @@ -1258,11 +1261,11 @@ <ajc-test dir="bugs150/pr87530" pr="87530" title="final itd methods on interfaces"> <compile files="FinalITDMOnInterface.aj" options="-1.9"> - <message kind="error" line="12" text="Cannot override the final method from A.TestInterface"></message> + <message kind="error" line="12" text="Cannot override the final method from A.TestInterface"/> </compile> <compile files="FinalITDMOnInterface2.aj" options="-1.9"> <!--message kind="error" line="8" text="Cannot override the final method from A.TestInterface"></message--> - <message kind="error" line="8" text="can't override final void A$TestInterface.m()"></message> + <message kind="error" line="8" text="can't override final void A$TestInterface.m()"/> </compile> </ajc-test> @@ -1620,17 +1623,17 @@ <ajc-test title="declare parents : hasmethod(..) - 1" dir="hasmember"> <compile files="HasMethod.aj" options="-1.9 -XhasMember"/> - <run class="HasMethod"></run> + <run class="HasMethod"/> </ajc-test> <ajc-test title="declare parents : hasmethod(..) - 2" dir="hasmember"> <compile files="HasMethodInherited.aj" options="-1.9 -XhasMember"/> - <run class="HasMethodInherited"></run> + <run class="HasMethodInherited"/> </ajc-test> <ajc-test title="declare parents : hasmethod(..) - 3" dir="hasmember"> <compile files="HasPrivateMethodInherited.aj" options="-1.9 -XhasMember"/> - <run class="HasPrivateMethodInherited"></run> + <run class="HasPrivateMethodInherited"/> </ajc-test> <ajc-test title="declare parents : hasmethod(..) - 4" dir="hasmember"> @@ -1641,17 +1644,17 @@ <ajc-test title="declare parents : hasfield(..) - 1" dir="hasmember"> <compile files="HasField.aj" options="-1.9 -XhasMember"/> - <run class="HasField"></run> + <run class="HasField"/> </ajc-test> <ajc-test title="declare parents : hasfield(..) - 2" dir="hasmember"> <compile files="HasFieldInherited.aj" options="-1.9 -XhasMember"/> - <run class="HasFieldInherited"></run> + <run class="HasFieldInherited"/> </ajc-test> <ajc-test title="declare parents : hasfield(..) - 3" dir="hasmember"> <compile files="HasPrivateFieldInherited.aj" options="-1.9 -XhasMember"/> - <run class="HasPrivateFieldInherited"></run> + <run class="HasPrivateFieldInherited"/> </ajc-test> <!-- Annotation binding tests --> @@ -3150,7 +3153,7 @@ <compile files="BaseTypes.java,DecaTypeBin5.aj" options="-1.9" xlintfile="ignoreTypeNotExposed.properties"> <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/> <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/> - <message king="error" line="17" text="A is not a valid target for annotation ColorA"/> + <message kind="error" line="17" text="A is not a valid target for annotation ColorA"/> <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/> <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/> <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc196/ajc196.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc196/ajc196.xml index 69a9fd8bf..3ef3457d2 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc196/ajc196.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc196/ajc196.xml @@ -10,7 +10,7 @@ <ajc-test dir="features193" vm="14" title="switch 1"> <compile files="Switch1.java" options="-14"> </compile> - <run class="Switch1" vmargs="--enable-preview"> + <run class="Switch1"> <stdout> <line text="0" /> <line text="1" /> @@ -98,8 +98,6 @@ <run class="Code" vmargs="--enable-preview"> <stdout> <line text="this is a text" /> - <!-- the incidental space is removed with a trim in output matching but - the test app doesn't remove it when printing it, why? --> <line text="block" /> </stdout> </run> @@ -112,7 +110,6 @@ </compile> <run class="Code2" vmargs="--enable-preview"> <stdout> - <!-- why is the incidental space not removed here?? --> <line text="this is a text" /> <line text="block in advice" /> </stdout> diff --git a/tests/src/test/resources/org/aspectj/systemtest/bringup/bringup.xml b/tests/src/test/resources/org/aspectj/systemtest/bringup/bringup.xml index 6009c9484..6e657c4df 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/bringup/bringup.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/bringup/bringup.xml @@ -4,11 +4,11 @@ <suite> <ajc-test title="empty class" dir="bringup"> - <compile files="EmptyClass.java"></compile> + <compile files="EmptyClass.java"/> </ajc-test> <ajc-test title="empty aspect" dir="bringup"> - <compile files="EmptyAspect.aj"></compile> + <compile files="EmptyAspect.aj"/> </ajc-test> - -</suite>
\ No newline at end of file + +</suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/incremental/incremental-tests.xml b/tests/src/test/resources/org/aspectj/systemtest/incremental/incremental-tests.xml index 1ce24711e..87fe7c33d 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/incremental/incremental-tests.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/incremental/incremental-tests.xml @@ -1,9 +1,10 @@ +<suite> <!-- Incremental compilation Tests --> - <ajc-test dir="incremental/initialTests/classAdded" - title="expect class added in initial incremental tests" + <ajc-test dir="incremental/initialTests/classAdded" + title="expect class added in initial incremental tests" keywords="incremental-test" > - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <run class="main.Main"/> @@ -13,11 +14,11 @@ <run class="main.Main" skipTester="true"/> </ajc-test> - <ajc-test dir="incremental/initialTests/classRemoved" - title="expect class removed in initial incremental tests" + <ajc-test dir="incremental/initialTests/classRemoved" + title="expect class removed in initial incremental tests" keywords="incremental-test" > - <compile staging="true" - options="-incremental" + <compile staging="true" + options="-incremental" sourceroots="."/> <run class="main.Main"/> <inc-compile tag="20"> @@ -26,10 +27,10 @@ <run class="main.Main"/> </ajc-test> - <ajc-test dir="incremental/initialTests/classUpdated" - title="expect class updated in initial incremental tests" + <ajc-test dir="incremental/initialTests/classUpdated" + title="expect class updated in initial incremental tests" keywords="incremental-test" > - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <run class="main.Main"/> @@ -39,11 +40,11 @@ <run class="main.Main"/> </ajc-test> - <ajc-test dir="incremental/initialTests/sourceAdded" + <ajc-test dir="incremental/initialTests/sourceAdded" title="add file with class" - comment="only expecting pickup if sourceroots" + comment="only expecting pickup if sourceroots" keywords="incremental-test" > - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <run class="main.Main"/> @@ -56,11 +57,11 @@ <run class="main.Main"/> </ajc-test> - <ajc-test dir="incremental/initialTests/sourceDeleted" + <ajc-test dir="incremental/initialTests/sourceDeleted" title="delete source file before incremental compile" comment="build config should permit file deletions for incremental (sourceroots)" keywords="incremental-test" > - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <run class="delete.Main"/> @@ -68,12 +69,12 @@ <dir-changes removed="delete.DeleteMe"/> <message kind="error" line="6" file="delete/Target.java"/> </inc-compile> - <inc-compile tag="30"/> + <inc-compile tag="30"/> <run class="delete.Main"/> </ajc-test> <!-- this test cannot pass with the new AjAttribute.MethodDeclarationLineNumberAttribute - <ajc-test dir="incremental/initialTests/expClasses" + <ajc-test dir="incremental/initialTests/expClasses" title="expected class tree" > <compile files="Main.java"> <dir-changes expDir="expected"/> @@ -81,11 +82,11 @@ <run class="Main"/> </ajc-test> --> - - <ajc-test dir="incremental/initialTests/defaultPackage" - title="do everything in default package (sourceroots)" + + <ajc-test dir="incremental/initialTests/defaultPackage" + title="do everything in default package (sourceroots)" keywords="incremental-test" > - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <run class="Main"/> @@ -97,7 +98,7 @@ <dir-changes updated="Main"/> </inc-compile> <run class="Main" skipTester="true"/> - <inc-compile tag="40"> + <inc-compile tag="40"> <message kind="error" line="6" file="Main.java"/> </inc-compile> <inc-compile tag="50"/> @@ -107,9 +108,9 @@ <ajc-test dir="incremental/defaultPackage" keywords="incremental-test" title="change sources in default package"> - <compile + <compile staging="true" - options="-incremental" + options="-incremental" sourceroots="src"/> <run class="Main"/> <inc-compile tag="20"/> @@ -119,9 +120,9 @@ <ajc-test dir="incremental/interPackage" keywords="incremental-test" title="change source"> - <compile + <compile staging="true" - options="-incremental" + options="-incremental" sourceroots="src"/> <run class="app.Main"/> <inc-compile tag="20"/> @@ -132,7 +133,7 @@ <ajc-test dir="incremental/stringliteral" keywords="incremental-test" title="incrementally change only string literal, still expect advice"> - <compile staging="true" options="-incremental" + <compile staging="true" options="-incremental" sourceroots="src"/> <run class="packageOne.Main" options="in packageOne.Main.main(..), @@ -145,10 +146,10 @@ before main packageOne.Main"/> </ajc-test> - <ajc-test dir="incremental/initialTests/aspectSourceAdded" + <ajc-test dir="incremental/initialTests/aspectSourceAdded" title="add aspect source file and check world is rewoven" keywords="incremental-test" > - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <inc-compile tag="20"> @@ -156,11 +157,11 @@ </inc-compile> <run class="Main"/> </ajc-test> - + <ajc-test dir="incremental/initialTests/classWAroundClosureRemoved" title="make sure additional classes generated during weave are deleted with src class file" keywords="incremental-test"> - <compile staging="true" + <compile staging="true" options="-incremental" sourceroots="."/> <inc-compile tag="20" > @@ -171,8 +172,8 @@ <ajc-test dir="incremental/full-rebuild" pr="59895" title="incremental with aspect-driven full rebuild"> - <compile - staging="true" + <compile + staging="true" sourceroots="src" options="-incremental"> <message kind="error" line="3" file="Aspect.java"/> @@ -182,4 +183,5 @@ </inc-compile> <run class="Main"/> </ajc-test> - + +</suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations-tests.xml b/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations-tests.xml deleted file mode 100644 index d420885de..000000000 --- a/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations-tests.xml +++ /dev/null @@ -1,297 +0,0 @@ -<!-- Known Limitations --> - - <!-- we're not implementing static inter-type fields on interfaces in 1.1 --> - <ajc-test dir="knownLimitations/test117" title="DEPRECATED: introduce of variables" - keywords="from-base,knownLimitation"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <!-- we're not implementing this error check in 1.1 --> - <ajc-test dir="errors" - title="checking the contra-variant errors for typing of proceed" - keywords="from-errors,knownLimitation"> - <compile files="BadAround.java"> - <message kind="error" line="12"/> - <message kind="error" line="15"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - <message kind="error" line="22"/> - </compile> - </ajc-test> - - <!-- we're not implementing static inter-type fields on interfaces in 1.1 --> - <ajc-test dir="design/intro" - title="introduction of static methods and fields on classes and interfaces" - keywords="from-design,knownLimitation"> - <compile files="Statics.java"/> - <run class="Statics"/> - </ajc-test> - - <!-- only before advice implemented for handler join points in 1.1 --> - <ajc-test dir="new" title="advice on catch clauses" - keywords="from-resolved_10x,knownLimitation"> - <compile files="CatchAdvice.java"/> - <run class="CatchAdvice"/> - </ajc-test> - - <!-- we will handle this by signalling a weave-time error for any around - advice that is applied to a join point which throws checked exceptions - that it can't handle. proceeds in closures change the exceptions that - around advice can handle to include the greatest lower bound of the - checked exceptions that are legally throwable by the proceed. - Ideally their should be an -Xlint compile-time warning for ALL - cases that could produce weave-time errors. - --> - <ajc-test dir="new" title="holding onto proceed calls in a closure-like way" - keywords="from-resolved_10x,knownLimitation"> - <compile files="HoldProceed.java"/> - <run class="HoldProceed"/> - </ajc-test> - - <!-- around advice not implemented on initializer join points --> - <ajc-test dir="new" pr="490" - title="PR#458 Compiler was incorrectly flagging error in advice on initialization and static initialization" - keywords="from-resolved_10x,knownLimitation"> - <compile files="StaticInitCE.java"/> - <run class="StaticInitCE"/> - </ajc-test> - - <!-- This behavior is different from 1.0, but we might want to consider allowing it - Using the eclipse compiler it would be much easier to permit than forbid. --> - <ajc-test dir="new/introTypeMissing" - title="Introduced type unavailable to instanceof expressions in introduced methods" - keywords="from-resolved_10x,knownLimitation"> - <compile files="InstanceOf.java,TargetClass.java,Util.java"> - <message kind="error" line="19"/> - <message kind="error" line="20"/> - <message kind="error" line="21"/> - <message kind="error" line="22"/> - <message kind="error" line="23"/> - <message kind="error" line="24"/> - <message kind="error" line="25"/> - <message kind="error" line="26"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="enclosing join point not exported properly in pre-initialization join point" - keywords="from-resolved_10x,knownLimitation"> - <compile files="PreInitialization.java"/> - <run class="PreInitialization"/> - </ajc-test> - - <!-- pointcuts aren't checked for circularities unless they're used --> - <ajc-test dir="new" pr="568" title="cyclic pointcut definitions" - keywords="from-resolved_10rc3,knownLimitation"> - <compile files="CyclicPointcuts.java"> - <message kind="error" line="11"/> - <message kind="error" line="14"/> - <message kind="error" line="18"/> - <message kind="error" line="32"/> - <message kind="error" line="43"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="package typepattern with no packages (in default package)" - keywords="from-resolved_105,knownLimitation"> - <compile options="-Xlint" files="TypeNames.java"> - <message kind="warning" line="34"/> - <message kind="warning" line="39"/> - <message kind="warning" line="43"/> - <message kind="warning" line="47"/> - </compile> - <run class="TypeNames"/> - </ajc-test> - - <ajc-test dir="new" pr="764" - title="flag errors when binding args with indeterminate prefix and suffix" - keywords="from-resolved_105,knownLimitation"> - <compile files="IndeterminateArgsCE.java"> - <message kind="error" line="67"/> - <message kind="error" line="68"/> - <message kind="error" line="70"/> - <message kind="error" line="72"/> - </compile> - </ajc-test> - - <ajc-test dir="design/around" - title="around and return types + inlining optimizations" - comment="-XOcodeSize not in 1.1, source uses 1.4 APIs" - keywords="from-14tests,knownLimitation"> - <compile options="-XOcodeSize,-source,1.4" - files="ReturnCastProceed.java,StackChecker.java"> - <message kind="warning" line="68"/> - </compile> - <run class="ReturnCastProceed" vm="1.4"/> - </ajc-test> - - <ajc-test dir="new" pr="885" keywords="knownLimitation" - comment="this behaves differently in 1.3 from 1.4 for unknown reasons, merge with above when resolved" - title="source locations within expressions (hard case of constructor start)"> - <compile files="SourceLocationWithinExprHard.java"/> - <run class="SourceLocationWithinExprHard"/> - </ajc-test> - - <!-- Can't handle packages named 'aspect' in parser - --> - <ajc-test dir="new/PR852" pr="852" - title="declaring method on superclass and subclass" - keywords="knownLimitation"> - <compile files="aspect/Aspect.java,target/SubClass.java,target/SuperClass.java"> - <dir-changes added="target.SubClass,target.SuperClass"/> - </compile> - <run class="aspect.Aspect"/> - </ajc-test> - - <ajc-test dir="new" pr="660" title="illegal name binding in around cflow" - keywords="from-resolved_104,knownLimitation"> - <compile files="ArgsInCflowCf.java"> - <message kind="error" line="19"/> - <message kind="error" line="29"/> - <message kind="error" line="35"/> - </compile> - </ajc-test> - - <ajc-test dir="incremental/stringliteral" - keywords="knownLimitation" - title="incrementally change string size and wire in injar classes"> - <compile staging="true" options="-incremental" - files="oneInjar.jar,twoInjar.jar" - sourceroots="src"/> - <run class="packageOne.Main" - options="in packageOne.Main.main(..), - before main packageOne.Main"/> - <inc-compile tag="20"> - <dir-changes updated="packageOne.Main"/> - </inc-compile> - <!-- now failing here. This step passes in non-injar variant. --> - <run class="packageOne.Main" - options="in longer packageOne.Main.main(..), - before main packageOne.Main"/> - <inc-compile tag="30"> - <dir-changes added="RunInjarMains"/> - </inc-compile> - <run class="packageOne.Main" - options="in longer packageOne.Main.main(..), - before main InjarOneMain, - before main InjarTwoMain, - before main packageOne.Main"/> - </ajc-test> - - <ajc-test dir="bugs" pr="34206" - keywords="knownLimitation" - title="before():execution(new(..)) does not throw NoAspectBoundException" - comment="correct behavior of this case needs to be thought through"> - <compile files="AspectInitError.java"/> - <run class="AspectInitError"/> - </ajc-test> - - <ajc-test dir="new/binaryWarnings/src" pr="37020" - keywords="knownLimitation" - comment="source loc of binary jp depends on first code, not block start" - title="declare error on handler/method execution with no code on binary ajc 1.1 classes"> - <compile files="aspects/MainExecStartLinesErrors.java,../injars/appStartLines-ajc-1.1.jar"> - <message kind="error" file="app/MainExecStartLines.java" - line="6" text="execution(void MainExecStartLines.main(String[]))"/> - <message kind="error" file="app/MainExecStartLines.java" - line="17" text="handler(RuntimeException)"/> - </compile> - </ajc-test> - - <ajc-test dir="new/binaryWarnings/src" pr="37020" - keywords="knownLimitation" - comment="source loc of binary jp depends on first code, not block start; XXX need javac inlining example" - title="declare error on handler/method execution with no code on binary javac 1.4 classes"> - <compile files="aspects/MainExecStartLinesErrors.java,../injars/appStartLines-javac-1.4.jar"> - <message kind="error" file="app/MainExecStartLines.java" - line="6" text="execution(void MainExecStartLines.main(String[]))"/> - <message kind="error" file="app/MainExecStartLines.java" - line="17" text="handler(RuntimeException)"/> - </compile> - </ajc-test> - - <ajc-test dir="harness" - keywords="command-line-error,knownLimitation" - comment="can't test -help: has to abort, but returns 0, normal status" - title="CLE: -help usage"> - <compile badInput="true" options="-help"> - <message kind="abort" text="Usage"/> - </compile> - </ajc-test> - - <!-- The next three tests are all about the same issue. The source - line for a constructor execution is returned as the first executable - line within the constructor-execution join point rather than the declaration - line of the constructor. Any other definition will require collusion between - the source->bytecode compiler and the weaver and will only work in - those case where such collusion is possible. - --> - - <ajc-test dir="new/binaryWarnings/src" pr="37020" keywords="knownLimitation" - title="declare warnings on main - constructor execution"> - <compile files="aspects/ConstructorExecutionWarning.java,app/Main.java"> - <message kind="warning" file="app/Main.java" - line="23" text="execution(Main.new())"/> - </compile> - <run class="app.Main"/> - </ajc-test> - - <ajc-test dir="new/binaryWarnings/src" pr="37020" keywords="knownLimitation" - title="declare warnings on binary javac 1.4 main - constructor execution"> - <compile files="aspects/ConstructorExecutionWarning.java,../injars/app-javac-1.4.jar"> - <message kind="warning" file="app/Main.java" - line="23" text="execution(Main.new())"/> - </compile> - <run class="app.Main"/> - </ajc-test> - - <ajc-test dir="new/binaryWarnings/src" pr="37020" keywords="knownLimitation" - title="declare warnings on binary ajc 1.1 main - constructor execution"> - <compile files="aspects/ConstructorExecutionWarning.java,../injars/app-ajc-1.1.jar"> - <message kind="warning" file="app/Main.java" - line="23" text="execution(Main.new())"/> - </compile> - <run class="app.Main"/> - </ajc-test> - - <ajc-test dir="bugs/handlers" pr="37898" keywords="knownLimitation" - title="advice on handler join points should not throw unpermitted checked exceptions"> - <compile files="ExceptionCheckCE.java"> - <message kind="warning" line="8" text="expected"/> - <message kind="error" line="25" text="throw checked exception" /> - <message kind="error" line="8" text="throw checked exception" /> - </compile> - </ajc-test> - - <ajc-test dir="harness" pr="38134" keywords="knownLimitation" - comment="behavior is correct for 1.1 - revisit for 1.2" - title="-nowarn suppresses XLint warnings"> - <compile files="XLintWarningTest.java" options="-nowarn"/> - </ajc-test> - - <ajc-test dir="harness" pr="38134" keywords="knownLimitation" - comment="behavior is correct for 1.1 - revisit for 1.2" - title="warn:none suppresses XLint warnings"> - <compile files="XLintWarningTest.java" options="-warn:none"/> - </ajc-test> - - <ajc-test dir="harness" pr="38134" keywords="knownLimitation" - comment="behavior is correct for 1.1 - revisit for 1.2" - title="-nowarn suppresses declare warnings"> - <compile files="WarningTest.java" options="-nowarn"/> - </ajc-test> - - <ajc-test dir="harness" pr="38134" keywords="knownLimitation" - comment="behavior is correct for 1.1 - revisit for 1.2" - title="-warn:none suppresses declare warnings"> - <compile files="WarningTest.java" options="-warn:none"/> - </ajc-test> - - <ajc-test dir="bugs" pr="38168" keywords="knownLimitation" - title="insertion of lots of advice code can make branch offset for if too large"> - <compile files="WideJumps.java"/> - <run class="WideJumps"/> - </ajc-test> - diff --git a/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations.xml b/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations.xml index 25d99f6e4..ff00c6837 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/knownlimitations/knownLimitations.xml @@ -1,11 +1,300 @@ -<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[ -<!ENTITY tests SYSTEM "../tests/src/org/aspectj/systemtest/knownlimitations/knownLimitations-tests.xml"> -]> +<suite> -<!-- Known Limitations -these tests will fail --> + <!-- Known Limitations --> -<suite> + <!-- we're not implementing static inter-type fields on interfaces in 1.1 --> + <ajc-test dir="knownLimitations/test117" title="DEPRECATED: introduce of variables" + keywords="from-base,knownLimitation"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <!-- we're not implementing this error check in 1.1 --> + <ajc-test dir="errors" + title="checking the contra-variant errors for typing of proceed" + keywords="from-errors,knownLimitation"> + <compile files="BadAround.java"> + <message kind="error" line="12"/> + <message kind="error" line="15"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + <message kind="error" line="22"/> + </compile> + </ajc-test> + + <!-- we're not implementing static inter-type fields on interfaces in 1.1 --> + <ajc-test dir="design/intro" + title="introduction of static methods and fields on classes and interfaces" + keywords="from-design,knownLimitation"> + <compile files="Statics.java"/> + <run class="Statics"/> + </ajc-test> + + <!-- only before advice implemented for handler join points in 1.1 --> + <ajc-test dir="new" title="advice on catch clauses" + keywords="from-resolved_10x,knownLimitation"> + <compile files="CatchAdvice.java"/> + <run class="CatchAdvice"/> + </ajc-test> + + <!-- we will handle this by signalling a weave-time error for any around + advice that is applied to a join point which throws checked exceptions + that it can't handle. proceeds in closures change the exceptions that + around advice can handle to include the greatest lower bound of the + checked exceptions that are legally throwable by the proceed. + Ideally their should be an -Xlint compile-time warning for ALL + cases that could produce weave-time errors. + --> + <ajc-test dir="new" title="holding onto proceed calls in a closure-like way" + keywords="from-resolved_10x,knownLimitation"> + <compile files="HoldProceed.java"/> + <run class="HoldProceed"/> + </ajc-test> + + <!-- around advice not implemented on initializer join points --> + <ajc-test dir="new" pr="490" + title="PR#458 Compiler was incorrectly flagging error in advice on initialization and static initialization" + keywords="from-resolved_10x,knownLimitation"> + <compile files="StaticInitCE.java"/> + <run class="StaticInitCE"/> + </ajc-test> + + <!-- This behavior is different from 1.0, but we might want to consider allowing it + Using the eclipse compiler it would be much easier to permit than forbid. --> + <ajc-test dir="new/introTypeMissing" + title="Introduced type unavailable to instanceof expressions in introduced methods" + keywords="from-resolved_10x,knownLimitation"> + <compile files="InstanceOf.java,TargetClass.java,Util.java"> + <message kind="error" line="19"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + <message kind="error" line="22"/> + <message kind="error" line="23"/> + <message kind="error" line="24"/> + <message kind="error" line="25"/> + <message kind="error" line="26"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="enclosing join point not exported properly in pre-initialization join point" + keywords="from-resolved_10x,knownLimitation"> + <compile files="PreInitialization.java"/> + <run class="PreInitialization"/> + </ajc-test> + + <!-- pointcuts aren't checked for circularities unless they're used --> + <ajc-test dir="new" pr="568" title="cyclic pointcut definitions" + keywords="from-resolved_10rc3,knownLimitation"> + <compile files="CyclicPointcuts.java"> + <message kind="error" line="11"/> + <message kind="error" line="14"/> + <message kind="error" line="18"/> + <message kind="error" line="32"/> + <message kind="error" line="43"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="package typepattern with no packages (in default package)" + keywords="from-resolved_105,knownLimitation"> + <compile options="-Xlint" files="TypeNames.java"> + <message kind="warning" line="34"/> + <message kind="warning" line="39"/> + <message kind="warning" line="43"/> + <message kind="warning" line="47"/> + </compile> + <run class="TypeNames"/> + </ajc-test> + + <ajc-test dir="new" pr="764" + title="flag errors when binding args with indeterminate prefix and suffix" + keywords="from-resolved_105,knownLimitation"> + <compile files="IndeterminateArgsCE.java"> + <message kind="error" line="67"/> + <message kind="error" line="68"/> + <message kind="error" line="70"/> + <message kind="error" line="72"/> + </compile> + </ajc-test> + + <ajc-test dir="design/around" + title="around and return types + inlining optimizations" + comment="-XOcodeSize not in 1.1, source uses 1.4 APIs" + keywords="from-14tests,knownLimitation"> + <compile options="-XOcodeSize,-source,1.4" + files="ReturnCastProceed.java,StackChecker.java"> + <message kind="warning" line="68"/> + </compile> + <run class="ReturnCastProceed" vm="1.4"/> + </ajc-test> + + <ajc-test dir="new" pr="885" keywords="knownLimitation" + comment="this behaves differently in 1.3 from 1.4 for unknown reasons, merge with above when resolved" + title="source locations within expressions (hard case of constructor start)"> + <compile files="SourceLocationWithinExprHard.java"/> + <run class="SourceLocationWithinExprHard"/> + </ajc-test> + + <!-- Can't handle packages named 'aspect' in parser + --> + <ajc-test dir="new/PR852" pr="852" + title="declaring method on superclass and subclass" + keywords="knownLimitation"> + <compile files="aspect/Aspect.java,target/SubClass.java,target/SuperClass.java"> + <dir-changes added="target.SubClass,target.SuperClass"/> + </compile> + <run class="aspect.Aspect"/> + </ajc-test> + + <ajc-test dir="new" pr="660" title="illegal name binding in around cflow" + keywords="from-resolved_104,knownLimitation"> + <compile files="ArgsInCflowCf.java"> + <message kind="error" line="19"/> + <message kind="error" line="29"/> + <message kind="error" line="35"/> + </compile> + </ajc-test> + + <ajc-test dir="incremental/stringliteral" + keywords="knownLimitation" + title="incrementally change string size and wire in injar classes"> + <compile staging="true" options="-incremental" + files="oneInjar.jar,twoInjar.jar" + sourceroots="src"/> + <run class="packageOne.Main" + options="in packageOne.Main.main(..), + before main packageOne.Main"/> + <inc-compile tag="20"> + <dir-changes updated="packageOne.Main"/> + </inc-compile> + <!-- now failing here. This step passes in non-injar variant. --> + <run class="packageOne.Main" + options="in longer packageOne.Main.main(..), + before main packageOne.Main"/> + <inc-compile tag="30"> + <dir-changes added="RunInjarMains"/> + </inc-compile> + <run class="packageOne.Main" + options="in longer packageOne.Main.main(..), + before main InjarOneMain, + before main InjarTwoMain, + before main packageOne.Main"/> + </ajc-test> + + <ajc-test dir="bugs" pr="34206" + keywords="knownLimitation" + title="before():execution(new(..)) does not throw NoAspectBoundException" + comment="correct behavior of this case needs to be thought through"> + <compile files="AspectInitError.java"/> + <run class="AspectInitError"/> + </ajc-test> + + <ajc-test dir="new/binaryWarnings/src" pr="37020" + keywords="knownLimitation" + comment="source loc of binary jp depends on first code, not block start" + title="declare error on handler/method execution with no code on binary ajc 1.1 classes"> + <compile files="aspects/MainExecStartLinesErrors.java,../injars/appStartLines-ajc-1.1.jar"> + <message kind="error" file="app/MainExecStartLines.java" + line="6" text="execution(void MainExecStartLines.main(String[]))"/> + <message kind="error" file="app/MainExecStartLines.java" + line="17" text="handler(RuntimeException)"/> + </compile> + </ajc-test> + + <ajc-test dir="new/binaryWarnings/src" pr="37020" + keywords="knownLimitation" + comment="source loc of binary jp depends on first code, not block start; XXX need javac inlining example" + title="declare error on handler/method execution with no code on binary javac 1.4 classes"> + <compile files="aspects/MainExecStartLinesErrors.java,../injars/appStartLines-javac-1.4.jar"> + <message kind="error" file="app/MainExecStartLines.java" + line="6" text="execution(void MainExecStartLines.main(String[]))"/> + <message kind="error" file="app/MainExecStartLines.java" + line="17" text="handler(RuntimeException)"/> + </compile> + </ajc-test> + + <ajc-test dir="harness" + keywords="command-line-error,knownLimitation" + comment="can't test -help: has to abort, but returns 0, normal status" + title="CLE: -help usage"> + <compile badInput="true" options="-help"> + <message kind="abort" text="Usage"/> + </compile> + </ajc-test> + + <!-- The next three tests are all about the same issue. The source + line for a constructor execution is returned as the first executable + line within the constructor-execution join point rather than the declaration + line of the constructor. Any other definition will require collusion between + the source->bytecode compiler and the weaver and will only work in + those case where such collusion is possible. + --> + + <ajc-test dir="new/binaryWarnings/src" pr="37020" keywords="knownLimitation" + title="declare warnings on main - constructor execution"> + <compile files="aspects/ConstructorExecutionWarning.java,app/Main.java"> + <message kind="warning" file="app/Main.java" + line="23" text="execution(Main.new())"/> + </compile> + <run class="app.Main"/> + </ajc-test> + + <ajc-test dir="new/binaryWarnings/src" pr="37020" keywords="knownLimitation" + title="declare warnings on binary javac 1.4 main - constructor execution"> + <compile files="aspects/ConstructorExecutionWarning.java,../injars/app-javac-1.4.jar"> + <message kind="warning" file="app/Main.java" + line="23" text="execution(Main.new())"/> + </compile> + <run class="app.Main"/> + </ajc-test> + + <ajc-test dir="new/binaryWarnings/src" pr="37020" keywords="knownLimitation" + title="declare warnings on binary ajc 1.1 main - constructor execution"> + <compile files="aspects/ConstructorExecutionWarning.java,../injars/app-ajc-1.1.jar"> + <message kind="warning" file="app/Main.java" + line="23" text="execution(Main.new())"/> + </compile> + <run class="app.Main"/> + </ajc-test> + + <ajc-test dir="bugs/handlers" pr="37898" keywords="knownLimitation" + title="advice on handler join points should not throw unpermitted checked exceptions"> + <compile files="ExceptionCheckCE.java"> + <message kind="warning" line="8" text="expected"/> + <message kind="error" line="25" text="throw checked exception" /> + <message kind="error" line="8" text="throw checked exception" /> + </compile> + </ajc-test> + + <ajc-test dir="harness" pr="38134" keywords="knownLimitation" + comment="behavior is correct for 1.1 - revisit for 1.2" + title="-nowarn suppresses XLint warnings"> + <compile files="XLintWarningTest.java" options="-nowarn"/> + </ajc-test> + + <ajc-test dir="harness" pr="38134" keywords="knownLimitation" + comment="behavior is correct for 1.1 - revisit for 1.2" + title="warn:none suppresses XLint warnings"> + <compile files="XLintWarningTest.java" options="-warn:none"/> + </ajc-test> + + <ajc-test dir="harness" pr="38134" keywords="knownLimitation" + comment="behavior is correct for 1.1 - revisit for 1.2" + title="-nowarn suppresses declare warnings"> + <compile files="WarningTest.java" options="-nowarn"/> + </ajc-test> + + <ajc-test dir="harness" pr="38134" keywords="knownLimitation" + comment="behavior is correct for 1.1 - revisit for 1.2" + title="-warn:none suppresses declare warnings"> + <compile files="WarningTest.java" options="-warn:none"/> + </ajc-test> + + <ajc-test dir="bugs" pr="38168" keywords="knownLimitation" + title="insertion of lots of advice code can make branch offset for if too large"> + <compile files="WideJumps.java"/> + <run class="WideJumps"/> + </ajc-test> -&tests; - </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava-tests.xml b/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava-tests.xml deleted file mode 100644 index 9864ffe79..000000000 --- a/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava-tests.xml +++ /dev/null @@ -1,1894 +0,0 @@ -<!-- Pure Java Tests --> - - <ajc-test dir="pureJava/test120" title="unicodes and literals" - keywords="from-base,purejava"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="pureJava/test126" title="For Statement" - keywords="from-base,purejava"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="pureJava/test133" - title="correct super call lookup for method().name()" - keywords="from-base,purejava"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="new" pr="99" - title="combined logic expression (handling coericions vs. parens)" - keywords="from-java,purejava"> - <compile files="CombinedLogic.java"/> - <run class="CombinedLogic"/> - </ajc-test> - - <ajc-test dir="new" pr="99" - title="comment after class closes (with no new line at end)" - keywords="from-java,purejava"> - <compile files="CommentAfterClass.java"/> - <run class="CommentAfterClass"/> - </ajc-test> - - <ajc-test dir="new" pr="108" title="multi-dimensional array initializers" - keywords="from-java,purejava"> - <compile files="MultiArrays.java"/> - <run class="MultiArrays"/> - </ajc-test> - - <ajc-test dir="new" pr="125" - title="probelm with the generated names of exceptions" - keywords="from-java,purejava"> - <compile files="ExceptionNames.java"/> - <run class="ExceptionNames"/> - </ajc-test> - - <ajc-test dir="new" pr="109" - title="checks if the class field can be used on all of the primitive types" - keywords="from-java,purejava"> - <compile files="ClassFieldOnPrimitiveType.java"/> - <run class="ClassFieldOnPrimitiveType"/> - </ajc-test> - - <ajc-test dir="new" - title="Doesn't parse an array-returning method that throws an exception" - keywords="from-java,purejava"> - <compile files="ArrayMethod.java"/> - <run class="ArrayMethod"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="check that nested constructions of local classes work" - keywords="from-java,purejava"> - <compile files="NestedConstructionsOfLocalClasses.java"/> - <run class="NestedConstructionsOfLocalClasses"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Make sure anonymous classes can have non-nullary constructors" - keywords="from-java,purejava"> - <compile files="NonNullaryAnonymous.java"/> - <run class="NonNullaryAnonymous"/> - </ajc-test> - - <ajc-test dir="new" pr="417" - title="Full names are dropped from inner interfaces" - keywords="from-java,purejava"> - <compile files="PR417a.java"/> - <run class="PR417a"/> - </ajc-test> - - <ajc-test dir="new" pr="417" - title="Making sure full names stay on static inner classes" - keywords="from-java,purejava"> - <compile files="PR417b.java"/> - <run class="PR417b"/> - </ajc-test> - - <ajc-test dir="new" pr="408" - title="Not binding constructor when using more than one compilation" - keywords="from-java,purejava"> - <compile files="OuterAbstract_PR408.java"/> - <compile files="ExtendsOuterAbstract_PR408.java"/> - <compile files="ConstructorNotFound_PR408.java"/> - <run class="ConstructorNotFound_PR408"/> - </ajc-test> - - <ajc-test dir="pureJava" title="return;;; is not really legal" - keywords="from-java,purejava"> - <compile files="ReachableEmpty.java"> - <message kind="error" line="5"/> - <message kind="error" line="9"/> - <message kind="error" line="13"/> - <message kind="error" line="17"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="ajc treating Throwable as checked, issuing error if not found" - keywords="from-java,purejava"> - <compile files="FalseThrowsCE.java"/> - <run class="FalseThrowsCE"/> - </ajc-test> - - <ajc-test dir="new" pr="328" - title="package protected classes becoming public" - keywords="from-java,purejava"> - <compile files="PR328.java"/> - <run class="PR328"/> - </ajc-test> - - <ajc-test dir="new" title="IOException on windows if nul used as identifier" - keywords="from-java,purejava"> - <compile files="NulIOException.java"> - <message kind="error" line="12"/> - <message kind="error" line="14"/> - <message kind="error" line="17"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="NullPointerException (not compiler error) when extending non-static inner class" - keywords="from-java,purejava"> - <compile files="ExtendInnerCE.java"> - <message kind="error" line="3"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="compiler flags final static variable as indefinite in member assignment." - keywords="from-java,purejava"> - <compile files="DefiniteStatic.java"/> - <run class="DefiniteStatic"/> - </ajc-test> - - <ajc-test dir="new" - title="confirm no IOException on windows if nul used as identifier" - keywords="from-java,purejava"> - <compile files="NulIOException2.java"/> - <run class="NulIOException2"/> - </ajc-test> - - <ajc-test dir="new" - title="final constructor parameter causes incorrect compiler error" - keywords="from-java,purejava"> - <compile files="FinalConstructorParm.java"/> - <run class="FinalConstructorParm"/> - </ajc-test> - - <ajc-test dir="new" title="Error expected for field of type void" - keywords="from-java,purejava"> - <compile files="VoidField.java"> - <message kind="error" line="2"/> - <message kind="error" line="4"/> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="new" title="Error expected for constructor in interfaces" - keywords="from-java,purejava"> - <compile files="InterfaceConstructor.java"> - <message kind="error" line="2"/> - <message kind="error" line="6"/> - <message kind="error" line="8"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="558" - title="class name for identifier as String should provoke error" - keywords="from-java,purejava"> - <compile files="PR558.java"> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="567" - title="cyclic interface inheritance not detected if no classes implement the interfaces" - keywords="from-java,purejava,messages-vary"> - <compile files="CyclicInterfaceInheritance.java" - options="!eclipse"> - <message kind="error" line="14"/> - <message kind="error" line="15"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="567" title="cyclic class inheritance" - keywords="from-java,purejava"> - <compile files="CyclicClassInheritance.java"> - <message kind="error" line="11"/> - <message kind="error" line="12"/> - </compile> - </ajc-test> - - <!-- broken test - both javac and eclipse give error on line 35 --> - <!-- - <ajc-test dir="pureJava" title="Type names are not expressions on their own" - keywords="from-java,purejava"> - <compile files="TypeExprErrors.java"> - <message kind="error" line="10"/> - <message kind="error" line="17"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - <message kind="error" line="20"/> - <message kind="error" line="21"/> - <message kind="error" line="22"/> - <message kind="error" line="23"/> - <message kind="error" line="24"/> - <message kind="error" line="25"/> - <message kind="error" line="26"/> - <message kind="error" line="27"/> - <message kind="error" line="28"/> - <message kind="error" line="29"/> - <message kind="error" line="30"/> - <message kind="error" line="31"/> - <message kind="error" line="32"/> - <message kind="error" line="33"/> - <message kind="error" line="34"/> - <message kind="error" line="36"/> - <message kind="error" line="37"/> - </compile> - </ajc-test> - --> - - <ajc-test dir="pureJava/nameConflicts" - title="type and package name conflicts are resolved happily (1a)" - keywords="from-java,purejava"> - <compile files="p1/Main1.java,p1/Foo.java,p1/p2.java"/> - <run class="p1.Main1"/> - </ajc-test> - - <ajc-test dir="pureJava/nameConflicts" - title="(fails in USEJAVAC) type and package name conflicts are resolved happily (1b)" - keywords="from-java,purejava"> - <compile files="p1.java,p1/p2/Foo.java"/> - <compile files="p1/Main1.java,p1/Foo.java,p1/p2.java"/> - <run class="p1.Main1"/> - </ajc-test> - - <ajc-test dir="pureJava/nameConflicts" - title="type and package name conflicts caught as errors (1)" - keywords="from-java,purejava"> - <compile files="p1/p2.java,p1/Main1.java,p1/Foo.java,p1/p2/Foo.java"> - <message kind="error" line="3"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="flow analysis where final variable set in another constructor" - keywords="from-java,purejava"> - <compile files="ConstructorFlow.java"/> - <run class="ConstructorFlow"/> - </ajc-test> - - <ajc-test dir="new" pr="584" - title="Can construct inner classes using qualified expressions" - keywords="from-java,purejava"> - <compile files="PR584.java"/> - <run class="PR584"/> - </ajc-test> - - <ajc-test dir="new/protectedStatic" pr="585" - title="subclass unable to access protected static methods using type-qualified references" - keywords="from-java,purejava"> - <compile files="SubClass.java,pack/SuperClass.java"/> - <run class="SubClass"/> - </ajc-test> - - <ajc-test dir="new" pr="588" title="Undefined inner class constructor" - keywords="from-java,purejava"> - <compile files="UndefinedInner.java"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="new/packagePrefix" pr="574" - title="classes that are package prefixes are illegal" - keywords="from-java,purejava,messages-vary"> - <compile files="p/prefix.java,p/prefix/SomeClass.java" - options="!eclipse"> - <message kind="error" line="2"/> - </compile> - </ajc-test> - - <ajc-test dir="new/introTypeMissing" - title="valid type expressions for introduced type testing" - keywords="from-java,purejava"> - <compile files="TargetClass.java,Util.java"/> - <run class="TargetClass"/> - </ajc-test> - - <ajc-test dir="new" - title="PR591 compiler error expected when directly calling unimplemented abstract method using super" - keywords="from-java,purejava"> - <compile files="AbstractMethodCall.java"> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="suggested by Jacks 15.28-qualified-namestr tests" - keywords="from-java,purejava,messages-vary"> - <compile files="NonConstants.java" - options="!eclipse"> - <message kind="error" line="13"/> - <message kind="error" line="14"/> - <message kind="error" line="15"/> - <message kind="error" line="16"/> - <message kind="error" line="17"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="suggested by jacks 3.7-15 all comments must be closed" - keywords="from-java,purejava"> - <compile files="OpenComment.java"> - <message kind="error" line="7"/> - </compile> - </ajc-test> - - <ajc-test dir="new/classaccess" - title="package class access not enforced outside of package" - keywords="from-java,purejava"> - <compile files="main/Main.java,pack1/Target.java"> - <message kind="error" line="7"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="631" title="expecting CE for ambiguous reference" - keywords="from-java,purejava"> - <compile files="AmbiguousClassReference.java"> - <message kind="error" line="11"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="643" title="try without catch or finally" - keywords="from-java,purejava,message-vary"> - <compile files="TryNoCatchCE.java" - options="!eclipse"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="642" title="invalid floating-point constant" - keywords="from-java,purejava,messages-vary"> - <compile files="ParsingFloatCE.java" - options="!eclipse"> - <message kind="error" line="5"/> - </compile> - </ajc-test> - - <ajc-test dir="new/subaspects" pr="647" - title="concrete aspect unable to access abstract package-private method in parent for overriding" - keywords="from-java,purejava,messages-vary" - comment="XXX fix source - package-private"> - <compile files="parent/ParentMethodCE.java,child/ChildMethodCE.java" - options="!eclipse"> - <message kind="warning" line="28"/> - <message kind="error" line="27"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="super reference used to disambiguate names of different but compatible types" - keywords="from-java,purejava"> - <compile files="SuperDisambiguatingType.java"/> - <run class="SuperDisambiguatingType"/> - </ajc-test> - - <ajc-test dir="pureJava" title="anonymous explicit inner constructors" - keywords="from-java,purejava"> - <compile files="QualifiedNewCP.java"/> - <run class="QualifiedNewCP"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Overruning the lineStarts buffer, DO NOT EDIT THIS FILE!!!!" - keywords="from-java,purejava"> - <compile files="AJError.java"/> - <run class="AJError"/> - </ajc-test> - - <ajc-test dir="new" pr="701" title="no CE for unambiguous type reference" - keywords="from-java,purejava"> - <compile files="UnambiguousClassReference3CP.java"/> - <run class="UnambiguousClassReference3CP"/> - </ajc-test> - - <ajc-test dir="new" pr="701" - title="CE for ambiguous type reference (imports)" - keywords="from-java,purejava"> - <compile files="AmbiguousClassReference2CE.java"> - <message kind="error" line="2"/> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="701" - title="CE for ambiguous type reference (two type declarations)" - keywords="from-java,purejava,messages-vary"> - <compile files="AmbiguousClassReference3CE.java" - options="!eclipse"> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="701" - title="CE for ambiguous type reference (two inner types)" - keywords="from-java,purejava,messages-vary"> - <compile files="AmbiguousClassReference4CE.java" - options="!eclipse"> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="709" title="final assignment in loop" - keywords="from-java,purejava"> - <compile files="FinalInLoop.java"/> - <run class="FinalInLoop"/> - </ajc-test> - - <ajc-test dir="pureJava" title="private super access in inners" - keywords="from-java,purejava"> - <compile files="PrivateSuperInnerAccess.java"/> - <run class="PrivateSuperInnerAccess"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested interface does not require new qualifier (8)" - keywords="from-java,purejava"> - <compile files="InvalidNewQualifier8CE.java"> - <message kind="error" line="8"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested interface does not require new qualifier (9)" - keywords="from-java,purejava"> - <compile files="InvalidNewQualifier9CE.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested interface does not require new qualifier (10)" - keywords="from-java,purejava"> - <compile files="InvalidNewQualifier10CE.java"> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested interface does not require new qualifier (14)" - keywords="from-java,purejava"> - <compile files="InvalidNewQualifier14CE.java"> - <message kind="error" line="14"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested interface does not require new qualifier (15)" - keywords="from-java,purejava"> - <compile files="InvalidNewQualifier15CE.java"> - <message kind="error" line="15"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested interface does not require new qualifier (16)" - keywords="from-java,purejava"> - <compile files="InvalidNewQualifier16CE.java"> - <message kind="error" line="16"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="check that constructor name's match the enclosing type" - keywords="from-errors,purejava"> - <compile files="BadConstructorName.java"> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="errors for not applicable or accessible methods" - keywords="from-errors,purejava"> - <compile files="MethodsNotFound.java"> - <message kind="error" line="4"/> - <message kind="error" line="8"/> - <message kind="error" line="12"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" pr="218" - title="import statement within class body crashes compiler" - keywords="from-errors,purejava"> - <compile files="ImportWithinClassBody.java"> - <message kind="error" line="8"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="Accessing instance fields and instance methods statically." - keywords="from-errors,purejava"> - <compile files="AccessingInstanceFieldsStatically.java"> - <message kind="error" line="15"/> - <message kind="error" line="16"/> - <message kind="error" line="17"/> - <message kind="error" line="18"/> - <message kind="error" line="26"/> - <message kind="error" line="27"/> - <message kind="error" line="30"/> - <message kind="error" line="38"/> - <message kind="error" line="39"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Crashes when a cast is within another cast" - keywords="from-errors,purejava"> - <compile files="CastInCast.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Crashes when a cast of the form )int) appears" - keywords="from-errors,purejava,messages-vary"> - <compile files="BadCast.java" - options="!eclipse"> - <message kind="error" line="9"/> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Crashes when the closing brace is reversed" - keywords="from-errors,purejava,messages-vary"> - <compile files="ClosingBrace.java" - options="!eclipse"> - <message kind="error" line="11"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="Crashes when a method name is missing in a call -- e.g. 'System.out.();'" - keywords="from-errors,purejava"> - <compile files="NoMethodName.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Crashes when a bad r-value appears." - keywords="from-errors,purejava"> - <compile files="BadValue.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Two underscores as a variables causes a crash" - keywords="from-errors,purejava"> - <compile files="BadVar.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="Crashes when assigning to a final static in an intializer and declaration" - keywords="from-errors,purejava"> - <compile files="FinalStatic.java"> - <message kind="error" line="13"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Crashes when two dots appear instead of one" - keywords="from-errors,purejava"> - <compile files="TwoDots.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Crashes when there're stray dots" - keywords="from-errors,purejava"> - <compile files="StrayDot.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Stray characters cause a crash" - comment="XXX public class in wrong file" - keywords="from-errors,purejava"> - <compile files="StraySlash.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Colon instead of a semi-colon causes a crash" - comment="XXX public class in wrong file" - keywords="from-errors,purejava"> - <compile files="Colon.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="type error in initializer caught by ajc, not javac" - keywords="from-errors,purejava"> - <compile files="ArrayInitializerType.java"> - <message kind="error" line="2"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="Circular inheritance with classes causes a stack overflow." - keywords="from-errors,purejava"> - <compile files="CircularExtends.java"> - <message kind="error" line="7"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="Missing ;" keywords="from-errors,purejava"> - <compile files="PR405.java"> - <message kind="error" line="15"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="cast expressions should not allow casts between ifaces and array types" - keywords="from-errors,purejava"> - <compile files="InterfaceArrayCast.java"> - <message kind="error" line="9"/> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="parsing errors for various bad forms of NewArrayExprs." - keywords="from-errors,purejava"> - <compile files="BadNewArrayExprs.java"> - <message kind="error" line="4"/> - <message kind="error" line="5"/> - <message kind="error" line="6"/> - <message kind="error" line="7"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="good error for bad field and inner class references" - keywords="from-errors,purejava"> - <compile files="BadReferences.java"> - <message kind="error" line="3"/> - <message kind="error" line="5"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="Implementing a non-interface used to crash the compiler." - keywords="from-errors,purejava"> - <compile files="PR333.java"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="error of no return statement detected not by ajc but by javac (line 4)" - keywords="from-errors,purejava"> - <compile files="NoReturnStatementSimple.java"> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="class and interface extension" - keywords="from-errors,purejava,messages-vary"> - <compile files="BadExtension.java" - options="!eclipse"> - <message kind="error" line="7"/> - <message kind="error" line="9"/> - <message kind="error" line="16"/> - <message kind="error" line="17"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - <message kind="error" line="21"/> - <message kind="error" line="35"/> - <message kind="error" line="38"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="types in throws clauses" - keywords="from-errors,purejava"> - <compile files="ThrowsClause.java"> - <message kind="error" line="2"/> - <message kind="error" line="4"/> - <message kind="error" line="13"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="bad switch syntax" - keywords="from-errors,purejava"> - <compile files="Switch.java"> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="Referencing various things from static contexts" - keywords="from-errors,purejava"> - <compile files="StaticContexts.java"> - <message kind="error" line="11"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - <message kind="error" line="20"/> - <message kind="error" line="21"/> - <message kind="error" line="27"/> - <message kind="error" line="28"/> - <message kind="error" line="31"/> - <message kind="error" line="35"/> - <message kind="error" line="36"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="Some expressions are illegal expression statements" - keywords="from-errors,purejava"> - <compile files="BadExpressionStatement.java"> - <message kind="error" line="3"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="illegal forward reference" - keywords="from-errors,purejava"> - <compile files="IllegalForwardReference.java"> - <message kind="error" line="9"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="protected accessibility" - keywords="from-errors,purejava"> - <compile files="protectedAccess/Main.java,protectedAccess/p1/C1.java"> - <message kind="error" line="26"/> - <message kind="error" line="28"/> - <message kind="error" line="29"/> - <message kind="error" line="31"/> - <message kind="error" line="37"/> - <message kind="error" line="45"/> - <message kind="error" line="46"/> - <message kind="error" line="54"/> - <message kind="error" line="55"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="parse-time illegal modifiers" - keywords="from-errors,purejava"> - <compile files="Modifiers1.java"> - <message kind="error" line="2"/> - <message kind="error" line="3"/> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="check-time illegal modifiers" - keywords="from-errors,purejava"> - <compile files="Modifiers.java"> - <message kind="error" line="2"/> - <message kind="error" line="3"/> - <message kind="error" line="4"/> - <message kind="error" line="6"/> - <message kind="error" line="7"/> - <message kind="error" line="8"/> - <message kind="error" line="9"/> - <message kind="error" line="11"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" title="illegal synchronized stmts" - keywords="from-errors,purejava,messages-vary"> - <compile files="BadSynchronized.java" - options="!eclipse"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="modifiers on interface members" - keywords="from-errors,purejava"> - <compile files="InterfaceMembers.java"> - <message kind="error" line="2"/> - <message kind="error" line="3"/> - <message kind="error" line="4"/> - <message kind="error" line="5"/> - <message kind="error" line="7"/> - <message kind="error" line="8"/> - <message kind="error" line="9"/> - <message kind="error" line="10"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="good errors (and not too many) for missing members" - comment="XXX import of class in default package" - - keywords="from-errors,purejava"> - <compile files="NotFound.java"> - <message kind="error" line="1"/> - <message kind="error" line="2"/> - <message kind="error" line="6"/> - <message kind="error" line="9"/> - <message kind="error" line="10"/> - <message kind="error" line="14"/> - <message kind="error" line="16"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="536" - title="expecting compile failures with subclass narrowing scope of superclass methods or accessing private superclass variables" - keywords="from-errors,purejava"> - <compile files="RestrictingVisibilityCF.java"> - <message kind="error" line="27"/> - <message kind="error" line="29"/> - <message kind="error" line="31"/> - <message kind="error" line="39"/> - <message kind="error" line="41"/> - <message kind="error" line="46"/> - <message kind="error" line="48"/> - <message kind="error" line="53"/> - </compile> - </ajc-test> - - <ajc-test dir="errors" - title="inner classes may not have static non-constant members" - keywords="from-errors,purejava"> - <compile files="InnerMembers.java"> - <message kind="error" line="8"/> - <message kind="error" line="9"/> - <message kind="error" line="10"/> - <message kind="error" line="11"/> - <message kind="error" line="16"/> - <message kind="error" line="17"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="flow analysis with local types" - keywords="from-errors,purejava"> - <compile files="InnerFlow.java"> - <message kind="error" line="5"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="PR584 Can construct inner classes using qualified expressions" - keywords="from-resolved_10rc3,purejava"> - <compile files="PR584.java"/> - <run class="PR584"/> - </ajc-test> - - <ajc-test dir="new" pr="715" title="incrementing objects, arrays - 2" - keywords="from-resolved_104,purejava"> - <compile files="ArrayInc2CE.java"> - <message kind="error" line="12"/> - <message kind="error" line="13"/> - <message kind="error" line="14"/> - <message kind="error" line="15"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="715" title="incrementing objects, arrays CE" - keywords="from-resolved_104,purejava,messages-vary"> - <compile files="ArrayIncCE.java" - options="!eclipse"> - <message kind="error" line="15"/> - <message kind="error" line="16"/> - <message kind="error" line="17"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="715" title="incrementing objects, arrays - 3" - keywords="from-resolved_104,purejava"> - <compile files="ArrayInc3CE.java"> - <message kind="error" line="15"/> - <message kind="error" line="16"/> - <message kind="error" line="17"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - </compile> - </ajc-test> - - <ajc-test dir="new" pr="715" title="incrementing objects, arrays" - keywords="from-resolved_104,purejava"> - <compile files="ArrayInc.java"/> - <run class="ArrayInc"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="737" - title="no circularity errors simply because of inners (1)" - keywords="from-resolved_105,purejava"> - <compile files="circle/Test1CP.java"/> - <run class="circle.Test1CP"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="737" - title="no circularity errors simply because of inners (2)" - keywords="from-resolved_105,purejava"> - <compile files="circle/Test2CP.java"/> - <run class="circle.Test2CP"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="737" - title="should have circular inheritance errors (1)" - keywords="from-resolved_105,purejava,messages-vary"> - <compile files="circle/Test1CF.java" - options="!eclipse"> - <message kind="error" line="7"/> - <message kind="error" line="15"/> - <message kind="error" line="17"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="737" - title="should have circular inheritance errors (2)" - keywords="from-resolved_105,purejava,messages-vary"> - <compile files="circle/Test2CF.java" - options="!eclipse"> - <message kind="error" line="6"/> - <message kind="error" line="10"/> - <message kind="error" line="15"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="728" - title="interface using preceding subinterface in its definition" - keywords="from-resolved_105,purejava"> - <compile files="ParentUsingChild.java"/> - <run class="ParentUsingChild"/> - </ajc-test> - - <ajc-test dir="new" pr="645" - title="Parent interface using public inner interface of child in same file" - keywords="from-resolved_105,purejava"> - <compile files="ParentInterfaceUsingChildInnerInterface.java"/> - <run class="ParentInterfaceUsingChildInnerInterface"/> - </ajc-test> - - <ajc-test dir="errors" - title="a type is not allowed to extend or implement its own innner type" - keywords="from-resolved_105,purejava"> - <compile files="NestedInterfaceTest.java"> - <message kind="error" line="1"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="try requires block JLS 14.19" - keywords="from-resolved_105,purejava,messages-vary"> - <compile files="TryBlockRequiredCE.java" - options="!eclipse"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="722" title="loop expressions not declarations" - keywords="from-resolved_105,purejava,messages-vary"> - <compile files="DeclarationsInLoopsCE.java" - options="!eclipse"> - <message kind="error" line="7"/> - </compile> - </ajc-test> - - - - - - - - - <ajc-test dir="new" pr="663" - title="no error when public class is in file of a different name" - keywords="from-resolved_105,purejava"> - <compile options="-strict" files="PublicClassWrongFilename.java"> - <message kind="error" line="3"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="739" - title="local variables must be final to be accessed from inner class" - keywords="from-resolved_105,purejava"> - <compile files="LocalsFromInnerCE.java"> - <message kind="error" line="6"/> - <message kind="error" line="13"/> - <message kind="error" line="19"/> - <message kind="error" line="25"/> - <message kind="error" line="32"/> - <message kind="error" line="40"/> - <message kind="error" line="51"/> - <message kind="error" line="61"/> - <message kind="error" line="67"/> - <message kind="error" line="75"/> - <message kind="error" line="81"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="739" - title="final local variables may be accessed from inner class" - keywords="from-resolved_105,purejava"> - <compile files="LocalsFromInnerCP.java"/> - <run class="LocalsFromInnerCP"/> - </ajc-test> - - - <ajc-test dir="pureJava" pr="723" title="missing package identifier" - keywords="from-resolved_105,purejava"> - <compile files="MissingPackageCE.java"> - <message kind="error" line="2"/> - </compile> - </ajc-test> - <ajc-test dir="new" pr="701" - title="CE for ambiguous type reference (two files in package)" - keywords="from-resolved_105,purejava"> - <compile - files="ambiguousClass/AmbiguousReferent.java,ambiguousClass/AmbiguousClassReference.java"> - <message kind="error" line="5"/> - </compile> - </ajc-test> - - - <ajc-test dir="new" - title="initializer can throw so long as all constructors declare so" - keywords="from-resolved_105,purejava"> - <compile files="InitializerWithThrow.java"/> - <run class="InitializerWithThrow"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="interfaces may not contain initializers (bug found by jacks)" - keywords="from-resolved_105,purejava"> - <compile files="InterfaceMembersCf.java"> - <message kind="error" line="2"/> - <message kind="error" line="3"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="initializers must be able to complete normally (found by jacks)" - keywords="from-resolved_105,purejava,messages-vary"> - <compile files="InitializerFlowCf.java" - options="!eclipse"> - <message kind="error" line="2"/> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="more tests of super alone" - keywords="from-resolved_105,purejava"> - <compile files="SuperIsWeird.java"> - <message kind="error" line="9"/> - <message kind="error" line="13"/> - <message kind="error" line="20"/> - <message kind="error" line="21"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="752" - title="subclass access to enclosing super class private members" - keywords="from-resolved_105,purejava,fail-unimplemented"> - <compile files="SubclassAccessToEnclosingSuperClassPrivate.java"/> - <run class="SubclassAccessToEnclosingSuperClassPrivate"/> - </ajc-test> - - <ajc-test dir="pureJava" title="various tests of switch bounds" - keywords="from-resolved_106,purejava"> - <compile files="SwitchBounds.java"/> - <run class="SwitchBounds"/> - </ajc-test> - - <ajc-test dir="new" pr="601" - title="VerifyError if nested sync returning result" - comment="XXX inconsistent behavior?" - keywords="from-resolved_10final,purejava"> - <compile files="NestedSyncWithResult.java"/> - <run class="NestedSyncWithResult"/> - </ajc-test> - - - <ajc-test dir="new" pr="134" - title="import of a class in the default package" - keywords="from-broken14usejavac,purejava"> - <compile files="ImportFromUnnamed.java,DeclaredExcs.java"/> - <run class="ImportFromUnnamed"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing static interfaces with import statements" - keywords="from-broken14usejavac,purejava"> - <compile files="ClassWithStaticInnerInterfaces.java"/> - <compile files="ImportingStaticInnerInterfaces_PR386.java"/> - <run class="ImportingStaticInnerInterfaces_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing static interfaces with import statements stars" - keywords="purejava,from-broken14usejavac"> - <compile files="ClassWithStaticInnerInterfaces.java"/> - <compile files="ImportingStaticInnerInterfacesStars_PR386.java"/> - <run class="ImportingStaticInnerInterfacesStars_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing static interfaces with import statements stars 2" - keywords="purejava,from-broken14usejavac"> - <compile files="ClassWithStaticInnerInterfaces.java"/> - <compile files="ImportingStaticInnerInterfacesStars2_PR386.java"/> - <run class="ImportingStaticInnerInterfacesStars2_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing static interfaces with import statements stars 3" - keywords="purejava,from-broken14usejavac"> - <compile files="ClassWithStaticInnerInterfaces.java"/> - <compile files="ImportingStaticInnerInterfacesStars3_PR386.java"/> - <run class="ImportingStaticInnerInterfacesStars3_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing interfaces with import statements" - keywords="purejava,from-broken14usejavac"> - <compile - files="ClassWithInnerInterfaces.java,ImportingInnerInterfaces_PR386.java"/> - <run class="ImportingInnerInterfaces_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing interfaces with import statements stars" - keywords="purejava,from-broken14usejavac"> - <compile - files="ClassWithInnerInterfaces.java,ImportingInnerInterfacesStars_PR386.java"/> - <run class="ImportingInnerInterfacesStars_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing interfaces with import statements stars 2" - keywords="purejava,from-broken14usejavac"> - <compile - files="ClassWithInnerInterfaces.java,ImportingInnerInterfacesStars2_PR386.java"/> - <run class="ImportingInnerInterfacesStars2_PR386"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="386" - title="Referencing interfaces with import statements stars 3" - keywords="purejava,from-broken14usejavac"> - <compile - files="ClassWithInnerInterfaces.java,ImportingInnerInterfacesStars3_PR386.java"/> - <run class="ImportingInnerInterfacesStars3_PR386"/> - </ajc-test> - - <ajc-test dir="new/PR862" pr="862" - title="import any inner from interface implementor" - keywords="purejava"> - <compile files="pack/ImportInnerFromInterfaceImplementor.java"> - <dir-changes added="pack.ImportInnerFromInterfaceImplementor"/> - </compile> - <run class="pack.ImportInnerFromInterfaceImplementor"/> - </ajc-test> - - <ajc-test dir="pureJava/equalsMethOnStr" pr="214" - title="equals method on quoted strings" keywords="from-java"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="pureJava/anonInnerClass" pr="294" - title="anonymous inner class" keywords="from-java"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="parsing of parenthesized 'this' (in returns)" keywords="from-java"> - <compile files="ReturnThis.java"/> - <run class="ReturnThis"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Strings are folded and interned correctly" - keywords="from-java"> - <compile files="StringFold.java"/> - <run class="StringFold"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Cast binds tighter than equality tests" - keywords="from-java"> - <compile files="CastAndBinary.java"/> - <run class="CastAndBinary"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Boundary base values can be parsed" - keywords="from-java"> - <compile files="BoundaryNums.java"/> - <run class="BoundaryNums"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="State is passed correctly across nested annonymous inners" - keywords="from-java"> - <compile files="NestedInners.java"/> - <run class="NestedInners"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="?: expressions should typecheck in interesting ways" - keywords="from-java"> - <compile files="TriTestTypecheck.java"/> - <run class="TriTestTypecheck"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="cast expressions should allow casts to/from interfaces at compile-time." - keywords="from-java"> - <compile files="InterfaceCast.java"/> - <run class="InterfaceCast"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="various anonymous inner classes plus super types tests" - keywords="from-java"> - <compile files="InnerSuper.java"/> - <run class="InnerSuper"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Various comment syntaxes should be handled." - keywords="from-java"> - <compile files="CommentSyntax.java"/> - <run class="CommentSyntax"/> - </ajc-test> - - <ajc-test dir="pureJava/abstractInner" - title="Abstract inner classes across package boundaries" - keywords="from-java"> - <compile files="C.java,pkg/A.java"/> - <run class="C"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="inner classes accessing outers and some more inner class names" - keywords="from-java"> - <compile files="InnerAccess.java"/> - <run class="InnerAccess"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="remember to cast folded values down to the proper types." - keywords="from-java"> - <compile files="CastingFoldedValues.java"/> - <run class="CastingFoldedValues"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="inner classes can be built using protected constructors in super" - keywords="from-java"> - <compile files="VariousConstructors.java"/> - <run class="VariousConstructors"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="401" - title="The current AspectJ compiler cannot parse qualified superclass constructor invocations" - keywords="from-java"> - <compile files="QualifiedSuperClassConstructorInvocations_PR401.java"/> - <run class="QualifiedSuperClassConstructorInvocations_PR401"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="421" - title="More thourough test of static members using full names" - keywords="from-java"> - <compile - files="Statics.java,StaticMembers_PR421.java,p1/C1.java,p1/P1Statics.java,p1/subp1/SubC1.java,p1/p2/P1P2Statics.java"/> - <run class="StaticMembers_PR421"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="421" - title="More thourough test of static members using imports" - keywords="from-java"> - <compile - files="Statics.java,StaticMembersImports_PR421.java,p1/C1.java,p1/P1Statics.java,p1/subp1/SubC1.java,p1/p2/P1P2Statics.java"/> - <run class="StaticMembersImports_PR421"/> - </ajc-test> - - <ajc-test dir="pureJava/conflictingPackageNames" pr="437" - title="Looking in class Java for java.lang.String WITH separate compilation" - keywords="from-java"> - <compile files="Java.java"/> - <compile files="Main.java"/> - <run class="Main"/> - </ajc-test> - - <ajc-test dir="pureJava/conflictingPackageNames" pr="437" - title="Looking in class Java for java.lang.String WITHOUT separate compilation" - keywords="from-java"> - <compile files="Main.java,Java.java"/> - <run class="Main"/> - </ajc-test> - - <ajc-test dir="pureJava/conflictingPackageNamesWithPackages" pr="437" - title="Looking in class Java for java.lang.String WITH separate compilation with packages" - keywords="from-java"> - <compile files="Java.java"/> - <compile files="Main.java"/> - <run class="conflictingPackageNamesWithPackages.Main"/> - </ajc-test> - - <ajc-test dir="pureJava/conflictingPackageNamesWithPackages" pr="437" - title="Looking in class Java for java.lang.String WITHOUT separate compilation with packages" - keywords="from-java"> - <compile files="Main.java,Java.java"/> - <run class="conflictingPackageNamesWithPackages.Main"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Testing ternary operations." - keywords="from-java"> - <compile files="MultiTernaryOps.java"/> - <run class="MultiTernaryOps"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Lifting locals in switch statements." - keywords="from-java"> - <compile files="SwitchStmtLocals.java"/> - <run class="SwitchStmtLocals"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Getting confused when looking up method signatures" - keywords="from-java"> - <compile files="MethodSigs.java"/> - <run class="MethodSigs"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Not recognizing the chars '\0', '\1', '\2', '\3', '\4', '\5', '\6', '\7'" - keywords="from-java"> - <compile files="Chars.java"/> - <run class="Chars"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Test chars '\0', '\1', '\2', '\3', '\4', '\5', '\6', '\7' with a case statement" - keywords="from-java"> - <compile files="CaseClauses.java"/> - <run class="CaseClauses"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Checking character values with all the unicode chars." - keywords="from-java"> - <compile files="CharsUnicode.java"/> - <run class="CharsUnicode"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Trouble finding methods with the same name and different parameter types" - keywords="from-java"> - <compile files="MethodsWithTheSameName.java"/> - <run class="MethodsWithTheSameName"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Binding non-public static inner classes of interfaces in other packages" - keywords="from-java"> - <compile - files="StaticClassesInInterfaces.java,anotherPackage/AnotherPackageInterface.java"/> - <run class="StaticClassesInInterfaces"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Not recognizing the octal chars '\0', '\1', '\2', '\3', '\4', '\5', '\6', '\7'" - keywords="from-java"> - <compile files="OctalChars.java"/> - <run class="OctalChars"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Members with the same name as their package cause confusion with fully-qualified names." - keywords="from-java"> - <compile files="samenames/Main.java,samenames/Other.java"/> - <run class="samenames.Main"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Fully-qual'ed names with same start as variable names" - keywords="from-java"> - <compile files="FullNames.java"/> - <run class="FullNames"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Fully qualifying inner classes within annonymous classes causes problems." - keywords="from-java"> - <compile files="InnerClassesInAnnonymousClasses.java"/> - <run class="InnerClassesInAnnonymousClasses"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Calls to methods in outer annonymous classes are being qual's incorrectly with 'this'" - keywords="from-java"> - <compile files="MisplacedThisInAnnonymousInnerClasses.java"/> - <run class="MisplacedThisInAnnonymousInnerClasses"/> - </ajc-test> - - <ajc-test dir="pureJava/innersFromSourceAndBytecode" - title="Reading inner classes from source and bytecode (1) -- was failing" - keywords="from-java"> - <compile files="C.java,D.java"/> - <compile files="Main.java,C.java" - includeClassesDir="true"/> - <run class="Main"/> - </ajc-test> - - <ajc-test dir="pureJava/innersFromSourceAndBytecode" - title="Reading inner classes from source and bytecode (2)" - keywords="from-java"> - <compile files="Main.java,C.java,D.java"/> - <run class="Main"/> - </ajc-test> - - <ajc-test dir="pureJava/innersFromSourceAndBytecode" - title="Reading inner classes from source and bytecode (3)" - keywords="from-java"> - <compile files="C.java,D.java"/> - <compile files="Main.java,C.java,D.java" - includeClassesDir="true"/> - <run class="Main"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Not lifting types correctly with bytes and shorts with ternary ops" - keywords="from-java"> - <compile files="TernaryPrimitiveOps.java"/> - <run class="TernaryPrimitiveOps"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Not looking up methods inside of anonymous declarations correctly." - keywords="from-java"> - <compile files="AnonymousMethodLookup.java"/> - <run class="AnonymousMethodLookup"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Resolving extended classes with array parameters" - keywords="from-java"> - <compile files="ResolvingArrayParameters.java"/> - <run class="ResolvingArrayParameters"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Assignments as second arguments in ternary operators." - keywords="from-java"> - <compile files="TernaryAssignments.java"/> - <run class="TernaryAssignments"/> - </ajc-test> - - - <ajc-test dir="pureJava" title="Conflicting inner classes with interfaces." - keywords="from-java"> - <compile files="PR413.java"/> - <run class="PR413"/> - </ajc-test> - - <ajc-test dir="pureJava" title="confusions of casts and parens" - keywords="from-java"> - <compile files="CastVsParen.java"/> - <run class="CastVsParen"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="default constructors seen by inner classes subtyping outers" - keywords="from-java"> - <compile files="DefaultConsAndInner.java"/> - <run class="DefaultConsAndInner"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="folding fields set to anonymous instances containing self-references" - keywords="from-java"> - <compile files="AnonFolding.java"/> - <run class="AnonFolding"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="finally at the end of a method that needs to return" - keywords="from-java"> - <compile files="FinallyAndReturns.java"/> - <run class="FinallyAndReturns"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="overriding methods from object in interfaces and multiple-inheritance" - keywords="from-java"> - <compile files="InterfaceAndObject.java"/> - <run class="InterfaceAndObject"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="private fields in an outer class accessed by an inner which also extends the outer" - keywords="from-java"> - <compile files="PrivateFields.java"/> - <run class="PrivateFields"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="breaking out of a labeled block inside of an if" - keywords="from-java"> - <compile files="Breaks.java"/> - <run class="Breaks"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="abstractifying a method and getting it back through super" - keywords="from-java"> - <compile files="Abstracts.java"/> - <run class="Abstracts"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Packages and static classes with the same name produce compile errors." - keywords="from-java"> - <compile files="PackagesAndStaticClassesWithTheSameName.java"/> - <run class="PackagesAndStaticClassesWithTheSameName"/> - </ajc-test> - - <ajc-test dir="pureJava/innerTypeModifiers" - title="Inner types must generate classfiles with only Public/Default access flags." - keywords="from-java"> - <compile files="pkg1/Main.java,pkg2/Foo.java"/> - <run class="pkg1.Main"/> - </ajc-test> - - <ajc-test dir="pureJava/innerDefaultConstructors" - title="Default constructors have same access as their enclosing type" - keywords="from-java"> - <compile files="pkg1/Main.java,pkg2/Foo.java"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="Returning primitive values matching method return type (minimal)" - keywords="from-java"> - <compile files="ReturnTypes.java"/> - <run class="ReturnTypes"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Flow analysis and if(true)" - keywords="from-java"> - <compile files="Flow.java"/> - <run class="Flow"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="packages and generated inner types (for I.class)" - keywords="from-java"> - <compile files="InterfaceAndClass.java"/> - <run class="p.InterfaceAndClass"/> - </ajc-test> - - <ajc-test dir="pureJava" title="A.this exprs match by exact type matching" - keywords="from-java"> - <compile files="QualifiedThisMatchesExactly.java"> - <message kind="error" line="14"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="Implicit this for new inner instance must be avaliable" - keywords="from-java"> - <compile files="ImplicitThisMissing.java"> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="Inners can reference protected fields of their outer's super." - keywords="from-java"> - <compile - files="protectedFieldRefInInner/Main.java,protectedFieldRefInInner/p1/C.java"/> - <run class="protectedFieldRefInInner.Main"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Primitives that special case for a constant arm should work" - keywords="from-java"> - <compile files="OneArmedPrimitiveTests.java"/> - <run class="OneArmedPrimitiveTests"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Parenthesized true and false don't parse" - keywords="from-java"> - <compile files="ParenKeywords.java"/> - <run class="ParenKeywords"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Field sets to public fields of private fields of enclosing types" - keywords="from-java"> - <compile files="InnerFieldRef.java"/> - <run class="InnerFieldRef"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Constant values should be stored with the correct type of their fields" - keywords="from-java"> - <compile files="ConstantValueConversion.java"/> - <run class="ConstantValueConversion"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Local variables in initializers should not be treated as blank final fields" - keywords="from-java"> - <compile files="LocalInitializerVariableNotBlank.java"/> - <run class="LocalInitializerVariableNotBlank"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Binops aren't allowed as update stmts in for loops" - keywords="from-java"> - <compile files="NonStmtInFor.java"> - <message kind="error" line="3"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="Can't avoid doing division in case of div by zero" - keywords="from-java"> - <compile files="DivOpMustHappen.java"/> - <run class="DivOpMustHappen"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="Testing frames w/greater than FF locals and 7F incs (i.e., WIDE instruction)" - keywords="from-java"> - <compile files="BigFrameTest.java"/> - <run class="BigFrameTest"/> - </ajc-test> - - <ajc-test dir="pureJava" title="correct numeric literals" - keywords="from-java"> - <compile files="LiteralsCp.java"/> - <run class="LiteralsCp"/> - </ajc-test> - - <ajc-test dir="pureJava" title="invalid numeric literals" - keywords="from-java"> - <compile files="LiteralsCf.java"> - <message kind="error" line="8"/> - <message kind="error" line="9"/> - <message kind="error" line="10"/> - <message kind="error" line="11"/> - <message kind="error" line="12"/> - <message kind="error" line="17"/> - <message kind="error" line="18"/> - <message kind="error" line="19"/> - <message kind="error" line="20"/> - <message kind="error" line="21"/> - <message kind="error" line="22"/> - <message kind="error" line="23"/> - <message kind="error" line="25"/> - <message kind="error" line="27"/> - <message kind="error" line="28"/> - <message kind="error" line="29"/> - <message kind="error" line="30"/> - <message kind="error" line="32"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" pr="538" - title="inner types can't have the same simple name as an enclosing type" - keywords="from-java"> - <compile files="InnerNameConflictsCf.java"> - <message kind="error" line="9"/> - <message kind="error" line="14"/> - <message kind="error" line="20"/> - <message kind="error" line="21"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="test the unops and binops with various values" keywords="from-java"> - <compile files="BigOps.java"/> - <run class="BigOps"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="test + and += for strings and variously typed values" - keywords="from-java"> - <compile files="BigString.java"/> - <run class="BigString"/> - </ajc-test> - - <ajc-test dir="pureJava" title="test try/catch/finally statements" - keywords="from-java"> - <compile files="TryCatchFinally.java"/> - <run class="TryCatchFinally"/> - </ajc-test> - - - <ajc-test dir="pureJava" pr="547" - title="local types can be bound in the signatures of other local types" - keywords="from-resolved_10rc3,from-java"> - <compile files="LocalInners.java"/> - <run class="LocalInners"/> - </ajc-test> - - <ajc-test dir="pureJava/nameConflicts" - title="type and package name conflicts are resolved happily (2)" - keywords="from-java"> - <compile files="p1/Main2.java,p1/p2/Foo.java"/> - <run class="p1.Main2"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="try statements work sorta like scoped items for exception flow control" - keywords="from-java"> - <compile files="TryWorksLikeEnvironment.java"/> - <run class="TryWorksLikeEnvironment"/> - </ajc-test> - - <ajc-test dir="pureJava" - title="qualified this must work exactly, not based on subtypes" - keywords="from-java"> - <compile files="QualifiedThisExactness.java"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="nested finally blocks have interesting frame location problems" - keywords="from-java"> - <compile files="NestedFinally.java"/> - <run class="NestedFinally"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="601" - title="nested synchronized blocks have interesting frame location problems" - keywords="from-java"> - <compile files="NestedSynchronized.java"/> - <run class="NestedSynchronized"/> - </ajc-test> - - <ajc-test dir="pureJava" title="anonymous inner classes with inner types" - keywords="from-java"> - <compile files="AnonymousWithInner.java"/> - <run class="AnonymousWithInner"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="651" title="qualified super call expr" - keywords="from-java"> - <compile files="QualifiedSuperCall.java"/> - <run class="QualifiedSuperCall"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="680" - title="interfaces with non-explicitly static inner classes" - keywords="from-java"> - <compile files="InterfaceAndInnerHelper.java"/> - <compile files="InterfaceAndInner.java" - includeClassesDir="true"/> - <run class="InterfaceAndInner"/> - </ajc-test> - - <ajc-test dir="pureJava" title="Operands work correctly" - keywords="from-bigjava"> - <compile files="Ops.java"/> - <run class="Ops"/> - </ajc-test> - - <ajc-test dir="pureJava" title="simple tests of throws and for stmt typing" - keywords="from-errors"> - <compile files="SimpleSpec.java"> - <message kind="error" line="4"/> - <message kind="error" line="7"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="test for not folding circular constants" - keywords="from-errors"> - <compile files="CircularFolding.java"> - <message kind="error" line="6"/> - <message kind="error" line="7"/> - <message kind="error" line="8"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" title="continue targets must be continuable" - keywords="from-errors"> - <compile files="BadContinueTarget.java"> - <message kind="error" line="6"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="qualified this to non-inner should be caught" - keywords="from-errors"> - <compile files="BadQualifiedNew.java"> - <message kind="error" line="4"/> - </compile> - </ajc-test> - - <ajc-test dir="new" - title="Cannot bind a name." keywords="from-resolved_10x,purejava"> - <compile files="CannotReferenceSuper.java"/> - <run class="CannotReferenceSuper"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="721" - title="interface declaration not permitted in local method scope" - keywords="from-resolved_105"> - <compile files="LocalInterfaceCE.java"> - <message kind="error" line="5"/> - <message kind="error" line="8"/> - <message kind="error" line="11"/> - <message kind="error" line="15"/> - </compile> - </ajc-test> - - <ajc-test dir="pureJava" - title="Locals inside other locals, ordering of processing [eh]" - keywords="from-resolved_105"> - <compile files="LocalInners2.java"/> - <run class="LocalInners2"/> - </ajc-test> - - <ajc-test dir="pureJava" pr="866" - title="non-constant static final fields marked as final in .class"> - <compile files="FinalStaticField.java"/> - <run class="FinalStaticField"/> - </ajc-test> - - <ajc-test dir="new" title="handle multiple nested inner classes" - keywords="from-java"> - <compile files="InnerHell.java"/> - <run class="InnerHell"/> - </ajc-test> - - <ajc-test dir="new/volatileKeyword" pr="151" - title="advice on a static method" keywords="from-java"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="new/innerConsSyntax" pr="192" - title="inner constructor syntax causes compile error" keywords="from-java"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="new/paramWidening" pr="195" - title="widening of method parameters to match javac" keywords="from-java"> - <compile files="Driver.java"/> - <run class="Driver"/> - </ajc-test> - - <ajc-test dir="new" pr="313" - title="parenthesized string literals matching primitive type names" - keywords="from-java"> - <compile files="ParenPrimitive.java"/> - <run class="ParenPrimitive"/> - </ajc-test> - - <ajc-test dir="new" title="simple type coercions tests" keywords="from-java"> - <compile files="TypeCoercions.java"/> - <run class="TypeCoercions"/> - </ajc-test> - - <ajc-test dir="new" title="order of type declarations shouldn't matter" - keywords="from-java"> - <compile files="OrderOfTypes.java"/> - <run class="OrderOfTypes"/> - </ajc-test> - - <ajc-test dir="new" title="Scanner non recognizing strictfp." - keywords="from-java"> - <compile files="StrictFp.java"/> - <run class="StrictFp"/> - </ajc-test> - - <ajc-test dir="new" - title="Crashes when a lot of zeros are in front of a double variable [!!! purejava]" - keywords="from-java"> - <compile files="Zeros.java"/> - <run class="Zeros"/> - </ajc-test> - diff --git a/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava.xml b/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava.xml index 1eb4b9f60..b7aa09fb5 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/purejava/pureJava.xml @@ -1,10 +1,1897 @@ -<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[ -<!ENTITY tests SYSTEM "../tests/src/org/aspectj/systemtest/purejava/pureJava-tests.xml"> -]> -<!-- Pure Java Tests --> - <suite> -&tests; + <!-- Pure Java Tests --> + + <ajc-test dir="pureJava/test120" title="unicodes and literals" + keywords="from-base,purejava"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="pureJava/test126" title="For Statement" + keywords="from-base,purejava"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="pureJava/test133" + title="correct super call lookup for method().name()" + keywords="from-base,purejava"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="new" pr="99" + title="combined logic expression (handling coericions vs. parens)" + keywords="from-java,purejava"> + <compile files="CombinedLogic.java"/> + <run class="CombinedLogic"/> + </ajc-test> + + <ajc-test dir="new" pr="99" + title="comment after class closes (with no new line at end)" + keywords="from-java,purejava"> + <compile files="CommentAfterClass.java"/> + <run class="CommentAfterClass"/> + </ajc-test> + + <ajc-test dir="new" pr="108" title="multi-dimensional array initializers" + keywords="from-java,purejava"> + <compile files="MultiArrays.java"/> + <run class="MultiArrays"/> + </ajc-test> + + <ajc-test dir="new" pr="125" + title="probelm with the generated names of exceptions" + keywords="from-java,purejava"> + <compile files="ExceptionNames.java"/> + <run class="ExceptionNames"/> + </ajc-test> + + <ajc-test dir="new" pr="109" + title="checks if the class field can be used on all of the primitive types" + keywords="from-java,purejava"> + <compile files="ClassFieldOnPrimitiveType.java"/> + <run class="ClassFieldOnPrimitiveType"/> + </ajc-test> + + <ajc-test dir="new" + title="Doesn't parse an array-returning method that throws an exception" + keywords="from-java,purejava"> + <compile files="ArrayMethod.java"/> + <run class="ArrayMethod"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="check that nested constructions of local classes work" + keywords="from-java,purejava"> + <compile files="NestedConstructionsOfLocalClasses.java"/> + <run class="NestedConstructionsOfLocalClasses"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Make sure anonymous classes can have non-nullary constructors" + keywords="from-java,purejava"> + <compile files="NonNullaryAnonymous.java"/> + <run class="NonNullaryAnonymous"/> + </ajc-test> + + <ajc-test dir="new" pr="417" + title="Full names are dropped from inner interfaces" + keywords="from-java,purejava"> + <compile files="PR417a.java"/> + <run class="PR417a"/> + </ajc-test> + + <ajc-test dir="new" pr="417" + title="Making sure full names stay on static inner classes" + keywords="from-java,purejava"> + <compile files="PR417b.java"/> + <run class="PR417b"/> + </ajc-test> + + <ajc-test dir="new" pr="408" + title="Not binding constructor when using more than one compilation" + keywords="from-java,purejava"> + <compile files="OuterAbstract_PR408.java"/> + <compile files="ExtendsOuterAbstract_PR408.java"/> + <compile files="ConstructorNotFound_PR408.java"/> + <run class="ConstructorNotFound_PR408"/> + </ajc-test> + + <ajc-test dir="pureJava" title="return;;; is not really legal" + keywords="from-java,purejava"> + <compile files="ReachableEmpty.java"> + <message kind="error" line="5"/> + <message kind="error" line="9"/> + <message kind="error" line="13"/> + <message kind="error" line="17"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="ajc treating Throwable as checked, issuing error if not found" + keywords="from-java,purejava"> + <compile files="FalseThrowsCE.java"/> + <run class="FalseThrowsCE"/> + </ajc-test> + + <ajc-test dir="new" pr="328" + title="package protected classes becoming public" + keywords="from-java,purejava"> + <compile files="PR328.java"/> + <run class="PR328"/> + </ajc-test> + + <ajc-test dir="new" title="IOException on windows if nul used as identifier" + keywords="from-java,purejava"> + <compile files="NulIOException.java"> + <message kind="error" line="12"/> + <message kind="error" line="14"/> + <message kind="error" line="17"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="NullPointerException (not compiler error) when extending non-static inner class" + keywords="from-java,purejava"> + <compile files="ExtendInnerCE.java"> + <message kind="error" line="3"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="compiler flags final static variable as indefinite in member assignment." + keywords="from-java,purejava"> + <compile files="DefiniteStatic.java"/> + <run class="DefiniteStatic"/> + </ajc-test> + + <ajc-test dir="new" + title="confirm no IOException on windows if nul used as identifier" + keywords="from-java,purejava"> + <compile files="NulIOException2.java"/> + <run class="NulIOException2"/> + </ajc-test> + + <ajc-test dir="new" + title="final constructor parameter causes incorrect compiler error" + keywords="from-java,purejava"> + <compile files="FinalConstructorParm.java"/> + <run class="FinalConstructorParm"/> + </ajc-test> + + <ajc-test dir="new" title="Error expected for field of type void" + keywords="from-java,purejava"> + <compile files="VoidField.java"> + <message kind="error" line="2"/> + <message kind="error" line="4"/> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="new" title="Error expected for constructor in interfaces" + keywords="from-java,purejava"> + <compile files="InterfaceConstructor.java"> + <message kind="error" line="2"/> + <message kind="error" line="6"/> + <message kind="error" line="8"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="558" + title="class name for identifier as String should provoke error" + keywords="from-java,purejava"> + <compile files="PR558.java"> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="567" + title="cyclic interface inheritance not detected if no classes implement the interfaces" + keywords="from-java,purejava,messages-vary"> + <compile files="CyclicInterfaceInheritance.java" + options="!eclipse"> + <message kind="error" line="14"/> + <message kind="error" line="15"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="567" title="cyclic class inheritance" + keywords="from-java,purejava"> + <compile files="CyclicClassInheritance.java"> + <message kind="error" line="11"/> + <message kind="error" line="12"/> + </compile> + </ajc-test> + + <!-- broken test - both javac and eclipse give error on line 35 --> + <!-- + <ajc-test dir="pureJava" title="Type names are not expressions on their own" + keywords="from-java,purejava"> + <compile files="TypeExprErrors.java"> + <message kind="error" line="10"/> + <message kind="error" line="17"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + <message kind="error" line="22"/> + <message kind="error" line="23"/> + <message kind="error" line="24"/> + <message kind="error" line="25"/> + <message kind="error" line="26"/> + <message kind="error" line="27"/> + <message kind="error" line="28"/> + <message kind="error" line="29"/> + <message kind="error" line="30"/> + <message kind="error" line="31"/> + <message kind="error" line="32"/> + <message kind="error" line="33"/> + <message kind="error" line="34"/> + <message kind="error" line="36"/> + <message kind="error" line="37"/> + </compile> + </ajc-test> + --> + + <ajc-test dir="pureJava/nameConflicts" + title="type and package name conflicts are resolved happily (1a)" + keywords="from-java,purejava"> + <compile files="p1/Main1.java,p1/Foo.java,p1/p2.java"/> + <run class="p1.Main1"/> + </ajc-test> + + <ajc-test dir="pureJava/nameConflicts" + title="(fails in USEJAVAC) type and package name conflicts are resolved happily (1b)" + keywords="from-java,purejava"> + <compile files="p1.java,p1/p2/Foo.java"/> + <compile files="p1/Main1.java,p1/Foo.java,p1/p2.java"/> + <run class="p1.Main1"/> + </ajc-test> + + <ajc-test dir="pureJava/nameConflicts" + title="type and package name conflicts caught as errors (1)" + keywords="from-java,purejava"> + <compile files="p1/p2.java,p1/Main1.java,p1/Foo.java,p1/p2/Foo.java"> + <message kind="error" line="3"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="flow analysis where final variable set in another constructor" + keywords="from-java,purejava"> + <compile files="ConstructorFlow.java"/> + <run class="ConstructorFlow"/> + </ajc-test> + + <ajc-test dir="new" pr="584" + title="Can construct inner classes using qualified expressions" + keywords="from-java,purejava"> + <compile files="PR584.java"/> + <run class="PR584"/> + </ajc-test> + + <ajc-test dir="new/protectedStatic" pr="585" + title="subclass unable to access protected static methods using type-qualified references" + keywords="from-java,purejava"> + <compile files="SubClass.java,pack/SuperClass.java"/> + <run class="SubClass"/> + </ajc-test> + + <ajc-test dir="new" pr="588" title="Undefined inner class constructor" + keywords="from-java,purejava"> + <compile files="UndefinedInner.java"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="new/packagePrefix" pr="574" + title="classes that are package prefixes are illegal" + keywords="from-java,purejava,messages-vary"> + <compile files="p/prefix.java,p/prefix/SomeClass.java" + options="!eclipse"> + <message kind="error" line="2"/> + </compile> + </ajc-test> + + <ajc-test dir="new/introTypeMissing" + title="valid type expressions for introduced type testing" + keywords="from-java,purejava"> + <compile files="TargetClass.java,Util.java"/> + <run class="TargetClass"/> + </ajc-test> + + <ajc-test dir="new" + title="PR591 compiler error expected when directly calling unimplemented abstract method using super" + keywords="from-java,purejava"> + <compile files="AbstractMethodCall.java"> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="suggested by Jacks 15.28-qualified-namestr tests" + keywords="from-java,purejava,messages-vary"> + <compile files="NonConstants.java" + options="!eclipse"> + <message kind="error" line="13"/> + <message kind="error" line="14"/> + <message kind="error" line="15"/> + <message kind="error" line="16"/> + <message kind="error" line="17"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="suggested by jacks 3.7-15 all comments must be closed" + keywords="from-java,purejava"> + <compile files="OpenComment.java"> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + <ajc-test dir="new/classaccess" + title="package class access not enforced outside of package" + keywords="from-java,purejava"> + <compile files="main/Main.java,pack1/Target.java"> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="631" title="expecting CE for ambiguous reference" + keywords="from-java,purejava"> + <compile files="AmbiguousClassReference.java"> + <message kind="error" line="11"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="643" title="try without catch or finally" + keywords="from-java,purejava,message-vary"> + <compile files="TryNoCatchCE.java" + options="!eclipse"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="642" title="invalid floating-point constant" + keywords="from-java,purejava,messages-vary"> + <compile files="ParsingFloatCE.java" + options="!eclipse"> + <message kind="error" line="5"/> + </compile> + </ajc-test> + + <ajc-test dir="new/subaspects" pr="647" + title="concrete aspect unable to access abstract package-private method in parent for overriding" + keywords="from-java,purejava,messages-vary" + comment="XXX fix source - package-private"> + <compile files="parent/ParentMethodCE.java,child/ChildMethodCE.java" + options="!eclipse"> + <message kind="warning" line="28"/> + <message kind="error" line="27"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="super reference used to disambiguate names of different but compatible types" + keywords="from-java,purejava"> + <compile files="SuperDisambiguatingType.java"/> + <run class="SuperDisambiguatingType"/> + </ajc-test> + + <ajc-test dir="pureJava" title="anonymous explicit inner constructors" + keywords="from-java,purejava"> + <compile files="QualifiedNewCP.java"/> + <run class="QualifiedNewCP"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Overruning the lineStarts buffer, DO NOT EDIT THIS FILE!!!!" + keywords="from-java,purejava"> + <compile files="AJError.java"/> + <run class="AJError"/> + </ajc-test> + + <ajc-test dir="new" pr="701" title="no CE for unambiguous type reference" + keywords="from-java,purejava"> + <compile files="UnambiguousClassReference3CP.java"/> + <run class="UnambiguousClassReference3CP"/> + </ajc-test> + + <ajc-test dir="new" pr="701" + title="CE for ambiguous type reference (imports)" + keywords="from-java,purejava"> + <compile files="AmbiguousClassReference2CE.java"> + <message kind="error" line="2"/> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="701" + title="CE for ambiguous type reference (two type declarations)" + keywords="from-java,purejava,messages-vary"> + <compile files="AmbiguousClassReference3CE.java" + options="!eclipse"> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="701" + title="CE for ambiguous type reference (two inner types)" + keywords="from-java,purejava,messages-vary"> + <compile files="AmbiguousClassReference4CE.java" + options="!eclipse"> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="709" title="final assignment in loop" + keywords="from-java,purejava"> + <compile files="FinalInLoop.java"/> + <run class="FinalInLoop"/> + </ajc-test> + + <ajc-test dir="pureJava" title="private super access in inners" + keywords="from-java,purejava"> + <compile files="PrivateSuperInnerAccess.java"/> + <run class="PrivateSuperInnerAccess"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested interface does not require new qualifier (8)" + keywords="from-java,purejava"> + <compile files="InvalidNewQualifier8CE.java"> + <message kind="error" line="8"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested interface does not require new qualifier (9)" + keywords="from-java,purejava"> + <compile files="InvalidNewQualifier9CE.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested interface does not require new qualifier (10)" + keywords="from-java,purejava"> + <compile files="InvalidNewQualifier10CE.java"> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested interface does not require new qualifier (14)" + keywords="from-java,purejava"> + <compile files="InvalidNewQualifier14CE.java"> + <message kind="error" line="14"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested interface does not require new qualifier (15)" + keywords="from-java,purejava"> + <compile files="InvalidNewQualifier15CE.java"> + <message kind="error" line="15"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested interface does not require new qualifier (16)" + keywords="from-java,purejava"> + <compile files="InvalidNewQualifier16CE.java"> + <message kind="error" line="16"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="check that constructor name's match the enclosing type" + keywords="from-errors,purejava"> + <compile files="BadConstructorName.java"> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="errors for not applicable or accessible methods" + keywords="from-errors,purejava"> + <compile files="MethodsNotFound.java"> + <message kind="error" line="4"/> + <message kind="error" line="8"/> + <message kind="error" line="12"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" pr="218" + title="import statement within class body crashes compiler" + keywords="from-errors,purejava"> + <compile files="ImportWithinClassBody.java"> + <message kind="error" line="8"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="Accessing instance fields and instance methods statically." + keywords="from-errors,purejava"> + <compile files="AccessingInstanceFieldsStatically.java"> + <message kind="error" line="15"/> + <message kind="error" line="16"/> + <message kind="error" line="17"/> + <message kind="error" line="18"/> + <message kind="error" line="26"/> + <message kind="error" line="27"/> + <message kind="error" line="30"/> + <message kind="error" line="38"/> + <message kind="error" line="39"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Crashes when a cast is within another cast" + keywords="from-errors,purejava"> + <compile files="CastInCast.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Crashes when a cast of the form )int) appears" + keywords="from-errors,purejava,messages-vary"> + <compile files="BadCast.java" + options="!eclipse"> + <message kind="error" line="9"/> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Crashes when the closing brace is reversed" + keywords="from-errors,purejava,messages-vary"> + <compile files="ClosingBrace.java" + options="!eclipse"> + <message kind="error" line="11"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="Crashes when a method name is missing in a call -- e.g. 'System.out.();'" + keywords="from-errors,purejava"> + <compile files="NoMethodName.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Crashes when a bad r-value appears." + keywords="from-errors,purejava"> + <compile files="BadValue.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Two underscores as a variables causes a crash" + keywords="from-errors,purejava"> + <compile files="BadVar.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="Crashes when assigning to a final static in an intializer and declaration" + keywords="from-errors,purejava"> + <compile files="FinalStatic.java"> + <message kind="error" line="13"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Crashes when two dots appear instead of one" + keywords="from-errors,purejava"> + <compile files="TwoDots.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Crashes when there're stray dots" + keywords="from-errors,purejava"> + <compile files="StrayDot.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Stray characters cause a crash" + comment="XXX public class in wrong file" + keywords="from-errors,purejava"> + <compile files="StraySlash.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Colon instead of a semi-colon causes a crash" + comment="XXX public class in wrong file" + keywords="from-errors,purejava"> + <compile files="Colon.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="type error in initializer caught by ajc, not javac" + keywords="from-errors,purejava"> + <compile files="ArrayInitializerType.java"> + <message kind="error" line="2"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="Circular inheritance with classes causes a stack overflow." + keywords="from-errors,purejava"> + <compile files="CircularExtends.java"> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="Missing ;" keywords="from-errors,purejava"> + <compile files="PR405.java"> + <message kind="error" line="15"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="cast expressions should not allow casts between ifaces and array types" + keywords="from-errors,purejava"> + <compile files="InterfaceArrayCast.java"> + <message kind="error" line="9"/> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="parsing errors for various bad forms of NewArrayExprs." + keywords="from-errors,purejava"> + <compile files="BadNewArrayExprs.java"> + <message kind="error" line="4"/> + <message kind="error" line="5"/> + <message kind="error" line="6"/> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="good error for bad field and inner class references" + keywords="from-errors,purejava"> + <compile files="BadReferences.java"> + <message kind="error" line="3"/> + <message kind="error" line="5"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="Implementing a non-interface used to crash the compiler." + keywords="from-errors,purejava"> + <compile files="PR333.java"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="error of no return statement detected not by ajc but by javac (line 4)" + keywords="from-errors,purejava"> + <compile files="NoReturnStatementSimple.java"> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="class and interface extension" + keywords="from-errors,purejava,messages-vary"> + <compile files="BadExtension.java" + options="!eclipse"> + <message kind="error" line="7"/> + <message kind="error" line="9"/> + <message kind="error" line="16"/> + <message kind="error" line="17"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + <message kind="error" line="21"/> + <message kind="error" line="35"/> + <message kind="error" line="38"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="types in throws clauses" + keywords="from-errors,purejava"> + <compile files="ThrowsClause.java"> + <message kind="error" line="2"/> + <message kind="error" line="4"/> + <message kind="error" line="13"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="bad switch syntax" + keywords="from-errors,purejava"> + <compile files="Switch.java"> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="Referencing various things from static contexts" + keywords="from-errors,purejava"> + <compile files="StaticContexts.java"> + <message kind="error" line="11"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + <message kind="error" line="27"/> + <message kind="error" line="28"/> + <message kind="error" line="31"/> + <message kind="error" line="35"/> + <message kind="error" line="36"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="Some expressions are illegal expression statements" + keywords="from-errors,purejava"> + <compile files="BadExpressionStatement.java"> + <message kind="error" line="3"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="illegal forward reference" + keywords="from-errors,purejava"> + <compile files="IllegalForwardReference.java"> + <message kind="error" line="9"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="protected accessibility" + keywords="from-errors,purejava"> + <compile files="protectedAccess/Main.java,protectedAccess/p1/C1.java"> + <message kind="error" line="26"/> + <message kind="error" line="28"/> + <message kind="error" line="29"/> + <message kind="error" line="31"/> + <message kind="error" line="37"/> + <message kind="error" line="45"/> + <message kind="error" line="46"/> + <message kind="error" line="54"/> + <message kind="error" line="55"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="parse-time illegal modifiers" + keywords="from-errors,purejava"> + <compile files="Modifiers1.java"> + <message kind="error" line="2"/> + <message kind="error" line="3"/> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="check-time illegal modifiers" + keywords="from-errors,purejava"> + <compile files="Modifiers.java"> + <message kind="error" line="2"/> + <message kind="error" line="3"/> + <message kind="error" line="4"/> + <message kind="error" line="6"/> + <message kind="error" line="7"/> + <message kind="error" line="8"/> + <message kind="error" line="9"/> + <message kind="error" line="11"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" title="illegal synchronized stmts" + keywords="from-errors,purejava,messages-vary"> + <compile files="BadSynchronized.java" + options="!eclipse"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="modifiers on interface members" + keywords="from-errors,purejava"> + <compile files="InterfaceMembers.java"> + <message kind="error" line="2"/> + <message kind="error" line="3"/> + <message kind="error" line="4"/> + <message kind="error" line="5"/> + <message kind="error" line="7"/> + <message kind="error" line="8"/> + <message kind="error" line="9"/> + <message kind="error" line="10"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="good errors (and not too many) for missing members" + comment="XXX import of class in default package" + + keywords="from-errors,purejava"> + <compile files="NotFound.java"> + <message kind="error" line="1"/> + <message kind="error" line="2"/> + <message kind="error" line="6"/> + <message kind="error" line="9"/> + <message kind="error" line="10"/> + <message kind="error" line="14"/> + <message kind="error" line="16"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="536" + title="expecting compile failures with subclass narrowing scope of superclass methods or accessing private superclass variables" + keywords="from-errors,purejava"> + <compile files="RestrictingVisibilityCF.java"> + <message kind="error" line="27"/> + <message kind="error" line="29"/> + <message kind="error" line="31"/> + <message kind="error" line="39"/> + <message kind="error" line="41"/> + <message kind="error" line="46"/> + <message kind="error" line="48"/> + <message kind="error" line="53"/> + </compile> + </ajc-test> + + <ajc-test dir="errors" + title="inner classes may not have static non-constant members" + keywords="from-errors,purejava"> + <compile files="InnerMembers.java"> + <message kind="error" line="8"/> + <message kind="error" line="9"/> + <message kind="error" line="10"/> + <message kind="error" line="11"/> + <message kind="error" line="16"/> + <message kind="error" line="17"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="flow analysis with local types" + keywords="from-errors,purejava"> + <compile files="InnerFlow.java"> + <message kind="error" line="5"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="PR584 Can construct inner classes using qualified expressions" + keywords="from-resolved_10rc3,purejava"> + <compile files="PR584.java"/> + <run class="PR584"/> + </ajc-test> + + <ajc-test dir="new" pr="715" title="incrementing objects, arrays - 2" + keywords="from-resolved_104,purejava"> + <compile files="ArrayInc2CE.java"> + <message kind="error" line="12"/> + <message kind="error" line="13"/> + <message kind="error" line="14"/> + <message kind="error" line="15"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="715" title="incrementing objects, arrays CE" + keywords="from-resolved_104,purejava,messages-vary"> + <compile files="ArrayIncCE.java" + options="!eclipse"> + <message kind="error" line="15"/> + <message kind="error" line="16"/> + <message kind="error" line="17"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="715" title="incrementing objects, arrays - 3" + keywords="from-resolved_104,purejava"> + <compile files="ArrayInc3CE.java"> + <message kind="error" line="15"/> + <message kind="error" line="16"/> + <message kind="error" line="17"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + </compile> + </ajc-test> + + <ajc-test dir="new" pr="715" title="incrementing objects, arrays" + keywords="from-resolved_104,purejava"> + <compile files="ArrayInc.java"/> + <run class="ArrayInc"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="737" + title="no circularity errors simply because of inners (1)" + keywords="from-resolved_105,purejava"> + <compile files="circle/Test1CP.java"/> + <run class="circle.Test1CP"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="737" + title="no circularity errors simply because of inners (2)" + keywords="from-resolved_105,purejava"> + <compile files="circle/Test2CP.java"/> + <run class="circle.Test2CP"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="737" + title="should have circular inheritance errors (1)" + keywords="from-resolved_105,purejava,messages-vary"> + <compile files="circle/Test1CF.java" + options="!eclipse"> + <message kind="error" line="7"/> + <message kind="error" line="15"/> + <message kind="error" line="17"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="737" + title="should have circular inheritance errors (2)" + keywords="from-resolved_105,purejava,messages-vary"> + <compile files="circle/Test2CF.java" + options="!eclipse"> + <message kind="error" line="6"/> + <message kind="error" line="10"/> + <message kind="error" line="15"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="728" + title="interface using preceding subinterface in its definition" + keywords="from-resolved_105,purejava"> + <compile files="ParentUsingChild.java"/> + <run class="ParentUsingChild"/> + </ajc-test> + + <ajc-test dir="new" pr="645" + title="Parent interface using public inner interface of child in same file" + keywords="from-resolved_105,purejava"> + <compile files="ParentInterfaceUsingChildInnerInterface.java"/> + <run class="ParentInterfaceUsingChildInnerInterface"/> + </ajc-test> + + <ajc-test dir="errors" + title="a type is not allowed to extend or implement its own innner type" + keywords="from-resolved_105,purejava"> + <compile files="NestedInterfaceTest.java"> + <message kind="error" line="1"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="try requires block JLS 14.19" + keywords="from-resolved_105,purejava,messages-vary"> + <compile files="TryBlockRequiredCE.java" + options="!eclipse"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="722" title="loop expressions not declarations" + keywords="from-resolved_105,purejava,messages-vary"> + <compile files="DeclarationsInLoopsCE.java" + options="!eclipse"> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + + + + + + + + <ajc-test dir="new" pr="663" + title="no error when public class is in file of a different name" + keywords="from-resolved_105,purejava"> + <compile options="-strict" files="PublicClassWrongFilename.java"> + <message kind="error" line="3"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="739" + title="local variables must be final to be accessed from inner class" + keywords="from-resolved_105,purejava"> + <compile files="LocalsFromInnerCE.java"> + <message kind="error" line="6"/> + <message kind="error" line="13"/> + <message kind="error" line="19"/> + <message kind="error" line="25"/> + <message kind="error" line="32"/> + <message kind="error" line="40"/> + <message kind="error" line="51"/> + <message kind="error" line="61"/> + <message kind="error" line="67"/> + <message kind="error" line="75"/> + <message kind="error" line="81"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="739" + title="final local variables may be accessed from inner class" + keywords="from-resolved_105,purejava"> + <compile files="LocalsFromInnerCP.java"/> + <run class="LocalsFromInnerCP"/> + </ajc-test> + + + <ajc-test dir="pureJava" pr="723" title="missing package identifier" + keywords="from-resolved_105,purejava"> + <compile files="MissingPackageCE.java"> + <message kind="error" line="2"/> + </compile> + </ajc-test> + <ajc-test dir="new" pr="701" + title="CE for ambiguous type reference (two files in package)" + keywords="from-resolved_105,purejava"> + <compile + files="ambiguousClass/AmbiguousReferent.java,ambiguousClass/AmbiguousClassReference.java"> + <message kind="error" line="5"/> + </compile> + </ajc-test> + + + <ajc-test dir="new" + title="initializer can throw so long as all constructors declare so" + keywords="from-resolved_105,purejava"> + <compile files="InitializerWithThrow.java"/> + <run class="InitializerWithThrow"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="interfaces may not contain initializers (bug found by jacks)" + keywords="from-resolved_105,purejava"> + <compile files="InterfaceMembersCf.java"> + <message kind="error" line="2"/> + <message kind="error" line="3"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="initializers must be able to complete normally (found by jacks)" + keywords="from-resolved_105,purejava,messages-vary"> + <compile files="InitializerFlowCf.java" + options="!eclipse"> + <message kind="error" line="2"/> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="more tests of super alone" + keywords="from-resolved_105,purejava"> + <compile files="SuperIsWeird.java"> + <message kind="error" line="9"/> + <message kind="error" line="13"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="752" + title="subclass access to enclosing super class private members" + keywords="from-resolved_105,purejava,fail-unimplemented"> + <compile files="SubclassAccessToEnclosingSuperClassPrivate.java"/> + <run class="SubclassAccessToEnclosingSuperClassPrivate"/> + </ajc-test> + + <ajc-test dir="pureJava" title="various tests of switch bounds" + keywords="from-resolved_106,purejava"> + <compile files="SwitchBounds.java"/> + <run class="SwitchBounds"/> + </ajc-test> + + <ajc-test dir="new" pr="601" + title="VerifyError if nested sync returning result" + comment="XXX inconsistent behavior?" + keywords="from-resolved_10final,purejava"> + <compile files="NestedSyncWithResult.java"/> + <run class="NestedSyncWithResult"/> + </ajc-test> + + + <ajc-test dir="new" pr="134" + title="import of a class in the default package" + keywords="from-broken14usejavac,purejava"> + <compile files="ImportFromUnnamed.java,DeclaredExcs.java"/> + <run class="ImportFromUnnamed"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing static interfaces with import statements" + keywords="from-broken14usejavac,purejava"> + <compile files="ClassWithStaticInnerInterfaces.java"/> + <compile files="ImportingStaticInnerInterfaces_PR386.java"/> + <run class="ImportingStaticInnerInterfaces_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing static interfaces with import statements stars" + keywords="purejava,from-broken14usejavac"> + <compile files="ClassWithStaticInnerInterfaces.java"/> + <compile files="ImportingStaticInnerInterfacesStars_PR386.java"/> + <run class="ImportingStaticInnerInterfacesStars_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing static interfaces with import statements stars 2" + keywords="purejava,from-broken14usejavac"> + <compile files="ClassWithStaticInnerInterfaces.java"/> + <compile files="ImportingStaticInnerInterfacesStars2_PR386.java"/> + <run class="ImportingStaticInnerInterfacesStars2_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing static interfaces with import statements stars 3" + keywords="purejava,from-broken14usejavac"> + <compile files="ClassWithStaticInnerInterfaces.java"/> + <compile files="ImportingStaticInnerInterfacesStars3_PR386.java"/> + <run class="ImportingStaticInnerInterfacesStars3_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing interfaces with import statements" + keywords="purejava,from-broken14usejavac"> + <compile + files="ClassWithInnerInterfaces.java,ImportingInnerInterfaces_PR386.java"/> + <run class="ImportingInnerInterfaces_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing interfaces with import statements stars" + keywords="purejava,from-broken14usejavac"> + <compile + files="ClassWithInnerInterfaces.java,ImportingInnerInterfacesStars_PR386.java"/> + <run class="ImportingInnerInterfacesStars_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing interfaces with import statements stars 2" + keywords="purejava,from-broken14usejavac"> + <compile + files="ClassWithInnerInterfaces.java,ImportingInnerInterfacesStars2_PR386.java"/> + <run class="ImportingInnerInterfacesStars2_PR386"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="386" + title="Referencing interfaces with import statements stars 3" + keywords="purejava,from-broken14usejavac"> + <compile + files="ClassWithInnerInterfaces.java,ImportingInnerInterfacesStars3_PR386.java"/> + <run class="ImportingInnerInterfacesStars3_PR386"/> + </ajc-test> + + <ajc-test dir="new/PR862" pr="862" + title="import any inner from interface implementor" + keywords="purejava"> + <compile files="pack/ImportInnerFromInterfaceImplementor.java"> + <dir-changes added="pack.ImportInnerFromInterfaceImplementor"/> + </compile> + <run class="pack.ImportInnerFromInterfaceImplementor"/> + </ajc-test> + + <ajc-test dir="pureJava/equalsMethOnStr" pr="214" + title="equals method on quoted strings" keywords="from-java"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="pureJava/anonInnerClass" pr="294" + title="anonymous inner class" keywords="from-java"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="parsing of parenthesized 'this' (in returns)" keywords="from-java"> + <compile files="ReturnThis.java"/> + <run class="ReturnThis"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Strings are folded and interned correctly" + keywords="from-java"> + <compile files="StringFold.java"/> + <run class="StringFold"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Cast binds tighter than equality tests" + keywords="from-java"> + <compile files="CastAndBinary.java"/> + <run class="CastAndBinary"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Boundary base values can be parsed" + keywords="from-java"> + <compile files="BoundaryNums.java"/> + <run class="BoundaryNums"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="State is passed correctly across nested annonymous inners" + keywords="from-java"> + <compile files="NestedInners.java"/> + <run class="NestedInners"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="?: expressions should typecheck in interesting ways" + keywords="from-java"> + <compile files="TriTestTypecheck.java"/> + <run class="TriTestTypecheck"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="cast expressions should allow casts to/from interfaces at compile-time." + keywords="from-java"> + <compile files="InterfaceCast.java"/> + <run class="InterfaceCast"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="various anonymous inner classes plus super types tests" + keywords="from-java"> + <compile files="InnerSuper.java"/> + <run class="InnerSuper"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Various comment syntaxes should be handled." + keywords="from-java"> + <compile files="CommentSyntax.java"/> + <run class="CommentSyntax"/> + </ajc-test> + + <ajc-test dir="pureJava/abstractInner" + title="Abstract inner classes across package boundaries" + keywords="from-java"> + <compile files="C.java,pkg/A.java"/> + <run class="C"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="inner classes accessing outers and some more inner class names" + keywords="from-java"> + <compile files="InnerAccess.java"/> + <run class="InnerAccess"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="remember to cast folded values down to the proper types." + keywords="from-java"> + <compile files="CastingFoldedValues.java"/> + <run class="CastingFoldedValues"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="inner classes can be built using protected constructors in super" + keywords="from-java"> + <compile files="VariousConstructors.java"/> + <run class="VariousConstructors"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="401" + title="The current AspectJ compiler cannot parse qualified superclass constructor invocations" + keywords="from-java"> + <compile files="QualifiedSuperClassConstructorInvocations_PR401.java"/> + <run class="QualifiedSuperClassConstructorInvocations_PR401"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="421" + title="More thourough test of static members using full names" + keywords="from-java"> + <compile + files="Statics.java,StaticMembers_PR421.java,p1/C1.java,p1/P1Statics.java,p1/subp1/SubC1.java,p1/p2/P1P2Statics.java"/> + <run class="StaticMembers_PR421"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="421" + title="More thourough test of static members using imports" + keywords="from-java"> + <compile + files="Statics.java,StaticMembersImports_PR421.java,p1/C1.java,p1/P1Statics.java,p1/subp1/SubC1.java,p1/p2/P1P2Statics.java"/> + <run class="StaticMembersImports_PR421"/> + </ajc-test> + + <ajc-test dir="pureJava/conflictingPackageNames" pr="437" + title="Looking in class Java for java.lang.String WITH separate compilation" + keywords="from-java"> + <compile files="Java.java"/> + <compile files="Main.java"/> + <run class="Main"/> + </ajc-test> + + <ajc-test dir="pureJava/conflictingPackageNames" pr="437" + title="Looking in class Java for java.lang.String WITHOUT separate compilation" + keywords="from-java"> + <compile files="Main.java,Java.java"/> + <run class="Main"/> + </ajc-test> + + <ajc-test dir="pureJava/conflictingPackageNamesWithPackages" pr="437" + title="Looking in class Java for java.lang.String WITH separate compilation with packages" + keywords="from-java"> + <compile files="Java.java"/> + <compile files="Main.java"/> + <run class="conflictingPackageNamesWithPackages.Main"/> + </ajc-test> + + <ajc-test dir="pureJava/conflictingPackageNamesWithPackages" pr="437" + title="Looking in class Java for java.lang.String WITHOUT separate compilation with packages" + keywords="from-java"> + <compile files="Main.java,Java.java"/> + <run class="conflictingPackageNamesWithPackages.Main"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Testing ternary operations." + keywords="from-java"> + <compile files="MultiTernaryOps.java"/> + <run class="MultiTernaryOps"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Lifting locals in switch statements." + keywords="from-java"> + <compile files="SwitchStmtLocals.java"/> + <run class="SwitchStmtLocals"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Getting confused when looking up method signatures" + keywords="from-java"> + <compile files="MethodSigs.java"/> + <run class="MethodSigs"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Not recognizing the chars '\0', '\1', '\2', '\3', '\4', '\5', '\6', '\7'" + keywords="from-java"> + <compile files="Chars.java"/> + <run class="Chars"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Test chars '\0', '\1', '\2', '\3', '\4', '\5', '\6', '\7' with a case statement" + keywords="from-java"> + <compile files="CaseClauses.java"/> + <run class="CaseClauses"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Checking character values with all the unicode chars." + keywords="from-java"> + <compile files="CharsUnicode.java"/> + <run class="CharsUnicode"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Trouble finding methods with the same name and different parameter types" + keywords="from-java"> + <compile files="MethodsWithTheSameName.java"/> + <run class="MethodsWithTheSameName"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Binding non-public static inner classes of interfaces in other packages" + keywords="from-java"> + <compile + files="StaticClassesInInterfaces.java,anotherPackage/AnotherPackageInterface.java"/> + <run class="StaticClassesInInterfaces"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Not recognizing the octal chars '\0', '\1', '\2', '\3', '\4', '\5', '\6', '\7'" + keywords="from-java"> + <compile files="OctalChars.java"/> + <run class="OctalChars"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Members with the same name as their package cause confusion with fully-qualified names." + keywords="from-java"> + <compile files="samenames/Main.java,samenames/Other.java"/> + <run class="samenames.Main"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Fully-qual'ed names with same start as variable names" + keywords="from-java"> + <compile files="FullNames.java"/> + <run class="FullNames"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Fully qualifying inner classes within annonymous classes causes problems." + keywords="from-java"> + <compile files="InnerClassesInAnnonymousClasses.java"/> + <run class="InnerClassesInAnnonymousClasses"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Calls to methods in outer annonymous classes are being qual's incorrectly with 'this'" + keywords="from-java"> + <compile files="MisplacedThisInAnnonymousInnerClasses.java"/> + <run class="MisplacedThisInAnnonymousInnerClasses"/> + </ajc-test> + + <ajc-test dir="pureJava/innersFromSourceAndBytecode" + title="Reading inner classes from source and bytecode (1) -- was failing" + keywords="from-java"> + <compile files="C.java,D.java"/> + <compile files="Main.java,C.java" + includeClassesDir="true"/> + <run class="Main"/> + </ajc-test> + + <ajc-test dir="pureJava/innersFromSourceAndBytecode" + title="Reading inner classes from source and bytecode (2)" + keywords="from-java"> + <compile files="Main.java,C.java,D.java"/> + <run class="Main"/> + </ajc-test> + + <ajc-test dir="pureJava/innersFromSourceAndBytecode" + title="Reading inner classes from source and bytecode (3)" + keywords="from-java"> + <compile files="C.java,D.java"/> + <compile files="Main.java,C.java,D.java" + includeClassesDir="true"/> + <run class="Main"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Not lifting types correctly with bytes and shorts with ternary ops" + keywords="from-java"> + <compile files="TernaryPrimitiveOps.java"/> + <run class="TernaryPrimitiveOps"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Not looking up methods inside of anonymous declarations correctly." + keywords="from-java"> + <compile files="AnonymousMethodLookup.java"/> + <run class="AnonymousMethodLookup"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Resolving extended classes with array parameters" + keywords="from-java"> + <compile files="ResolvingArrayParameters.java"/> + <run class="ResolvingArrayParameters"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Assignments as second arguments in ternary operators." + keywords="from-java"> + <compile files="TernaryAssignments.java"/> + <run class="TernaryAssignments"/> + </ajc-test> + + + <ajc-test dir="pureJava" title="Conflicting inner classes with interfaces." + keywords="from-java"> + <compile files="PR413.java"/> + <run class="PR413"/> + </ajc-test> + + <ajc-test dir="pureJava" title="confusions of casts and parens" + keywords="from-java"> + <compile files="CastVsParen.java"/> + <run class="CastVsParen"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="default constructors seen by inner classes subtyping outers" + keywords="from-java"> + <compile files="DefaultConsAndInner.java"/> + <run class="DefaultConsAndInner"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="folding fields set to anonymous instances containing self-references" + keywords="from-java"> + <compile files="AnonFolding.java"/> + <run class="AnonFolding"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="finally at the end of a method that needs to return" + keywords="from-java"> + <compile files="FinallyAndReturns.java"/> + <run class="FinallyAndReturns"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="overriding methods from object in interfaces and multiple-inheritance" + keywords="from-java"> + <compile files="InterfaceAndObject.java"/> + <run class="InterfaceAndObject"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="private fields in an outer class accessed by an inner which also extends the outer" + keywords="from-java"> + <compile files="PrivateFields.java"/> + <run class="PrivateFields"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="breaking out of a labeled block inside of an if" + keywords="from-java"> + <compile files="Breaks.java"/> + <run class="Breaks"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="abstractifying a method and getting it back through super" + keywords="from-java"> + <compile files="Abstracts.java"/> + <run class="Abstracts"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Packages and static classes with the same name produce compile errors." + keywords="from-java"> + <compile files="PackagesAndStaticClassesWithTheSameName.java"/> + <run class="PackagesAndStaticClassesWithTheSameName"/> + </ajc-test> + + <ajc-test dir="pureJava/innerTypeModifiers" + title="Inner types must generate classfiles with only Public/Default access flags." + keywords="from-java"> + <compile files="pkg1/Main.java,pkg2/Foo.java"/> + <run class="pkg1.Main"/> + </ajc-test> + + <ajc-test dir="pureJava/innerDefaultConstructors" + title="Default constructors have same access as their enclosing type" + keywords="from-java"> + <compile files="pkg1/Main.java,pkg2/Foo.java"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="Returning primitive values matching method return type (minimal)" + keywords="from-java"> + <compile files="ReturnTypes.java"/> + <run class="ReturnTypes"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Flow analysis and if(true)" + keywords="from-java"> + <compile files="Flow.java"/> + <run class="Flow"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="packages and generated inner types (for I.class)" + keywords="from-java"> + <compile files="InterfaceAndClass.java"/> + <run class="p.InterfaceAndClass"/> + </ajc-test> + + <ajc-test dir="pureJava" title="A.this exprs match by exact type matching" + keywords="from-java"> + <compile files="QualifiedThisMatchesExactly.java"> + <message kind="error" line="14"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="Implicit this for new inner instance must be avaliable" + keywords="from-java"> + <compile files="ImplicitThisMissing.java"> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="Inners can reference protected fields of their outer's super." + keywords="from-java"> + <compile + files="protectedFieldRefInInner/Main.java,protectedFieldRefInInner/p1/C.java"/> + <run class="protectedFieldRefInInner.Main"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Primitives that special case for a constant arm should work" + keywords="from-java"> + <compile files="OneArmedPrimitiveTests.java"/> + <run class="OneArmedPrimitiveTests"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Parenthesized true and false don't parse" + keywords="from-java"> + <compile files="ParenKeywords.java"/> + <run class="ParenKeywords"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Field sets to public fields of private fields of enclosing types" + keywords="from-java"> + <compile files="InnerFieldRef.java"/> + <run class="InnerFieldRef"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Constant values should be stored with the correct type of their fields" + keywords="from-java"> + <compile files="ConstantValueConversion.java"/> + <run class="ConstantValueConversion"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Local variables in initializers should not be treated as blank final fields" + keywords="from-java"> + <compile files="LocalInitializerVariableNotBlank.java"/> + <run class="LocalInitializerVariableNotBlank"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Binops aren't allowed as update stmts in for loops" + keywords="from-java"> + <compile files="NonStmtInFor.java"> + <message kind="error" line="3"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="Can't avoid doing division in case of div by zero" + keywords="from-java"> + <compile files="DivOpMustHappen.java"/> + <run class="DivOpMustHappen"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="Testing frames w/greater than FF locals and 7F incs (i.e., WIDE instruction)" + keywords="from-java"> + <compile files="BigFrameTest.java"/> + <run class="BigFrameTest"/> + </ajc-test> + + <ajc-test dir="pureJava" title="correct numeric literals" + keywords="from-java"> + <compile files="LiteralsCp.java"/> + <run class="LiteralsCp"/> + </ajc-test> + + <ajc-test dir="pureJava" title="invalid numeric literals" + keywords="from-java"> + <compile files="LiteralsCf.java"> + <message kind="error" line="8"/> + <message kind="error" line="9"/> + <message kind="error" line="10"/> + <message kind="error" line="11"/> + <message kind="error" line="12"/> + <message kind="error" line="17"/> + <message kind="error" line="18"/> + <message kind="error" line="19"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + <message kind="error" line="22"/> + <message kind="error" line="23"/> + <message kind="error" line="25"/> + <message kind="error" line="27"/> + <message kind="error" line="28"/> + <message kind="error" line="29"/> + <message kind="error" line="30"/> + <message kind="error" line="32"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" pr="538" + title="inner types can't have the same simple name as an enclosing type" + keywords="from-java"> + <compile files="InnerNameConflictsCf.java"> + <message kind="error" line="9"/> + <message kind="error" line="14"/> + <message kind="error" line="20"/> + <message kind="error" line="21"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="test the unops and binops with various values" keywords="from-java"> + <compile files="BigOps.java"/> + <run class="BigOps"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="test + and += for strings and variously typed values" + keywords="from-java"> + <compile files="BigString.java"/> + <run class="BigString"/> + </ajc-test> + + <ajc-test dir="pureJava" title="test try/catch/finally statements" + keywords="from-java"> + <compile files="TryCatchFinally.java"/> + <run class="TryCatchFinally"/> + </ajc-test> + + + <ajc-test dir="pureJava" pr="547" + title="local types can be bound in the signatures of other local types" + keywords="from-resolved_10rc3,from-java"> + <compile files="LocalInners.java"/> + <run class="LocalInners"/> + </ajc-test> + + <ajc-test dir="pureJava/nameConflicts" + title="type and package name conflicts are resolved happily (2)" + keywords="from-java"> + <compile files="p1/Main2.java,p1/p2/Foo.java"/> + <run class="p1.Main2"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="try statements work sorta like scoped items for exception flow control" + keywords="from-java"> + <compile files="TryWorksLikeEnvironment.java"/> + <run class="TryWorksLikeEnvironment"/> + </ajc-test> + + <ajc-test dir="pureJava" + title="qualified this must work exactly, not based on subtypes" + keywords="from-java"> + <compile files="QualifiedThisExactness.java"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="nested finally blocks have interesting frame location problems" + keywords="from-java"> + <compile files="NestedFinally.java"/> + <run class="NestedFinally"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="601" + title="nested synchronized blocks have interesting frame location problems" + keywords="from-java"> + <compile files="NestedSynchronized.java"/> + <run class="NestedSynchronized"/> + </ajc-test> + + <ajc-test dir="pureJava" title="anonymous inner classes with inner types" + keywords="from-java"> + <compile files="AnonymousWithInner.java"/> + <run class="AnonymousWithInner"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="651" title="qualified super call expr" + keywords="from-java"> + <compile files="QualifiedSuperCall.java"/> + <run class="QualifiedSuperCall"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="680" + title="interfaces with non-explicitly static inner classes" + keywords="from-java"> + <compile files="InterfaceAndInnerHelper.java"/> + <compile files="InterfaceAndInner.java" + includeClassesDir="true"/> + <run class="InterfaceAndInner"/> + </ajc-test> + + <ajc-test dir="pureJava" title="Operands work correctly" + keywords="from-bigjava"> + <compile files="Ops.java"/> + <run class="Ops"/> + </ajc-test> + + <ajc-test dir="pureJava" title="simple tests of throws and for stmt typing" + keywords="from-errors"> + <compile files="SimpleSpec.java"> + <message kind="error" line="4"/> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="test for not folding circular constants" + keywords="from-errors"> + <compile files="CircularFolding.java"> + <message kind="error" line="6"/> + <message kind="error" line="7"/> + <message kind="error" line="8"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" title="continue targets must be continuable" + keywords="from-errors"> + <compile files="BadContinueTarget.java"> + <message kind="error" line="6"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="qualified this to non-inner should be caught" + keywords="from-errors"> + <compile files="BadQualifiedNew.java"> + <message kind="error" line="4"/> + </compile> + </ajc-test> + + <ajc-test dir="new" + title="Cannot bind a name." keywords="from-resolved_10x,purejava"> + <compile files="CannotReferenceSuper.java"/> + <run class="CannotReferenceSuper"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="721" + title="interface declaration not permitted in local method scope" + keywords="from-resolved_105"> + <compile files="LocalInterfaceCE.java"> + <message kind="error" line="5"/> + <message kind="error" line="8"/> + <message kind="error" line="11"/> + <message kind="error" line="15"/> + </compile> + </ajc-test> + + <ajc-test dir="pureJava" + title="Locals inside other locals, ordering of processing [eh]" + keywords="from-resolved_105"> + <compile files="LocalInners2.java"/> + <run class="LocalInners2"/> + </ajc-test> + + <ajc-test dir="pureJava" pr="866" + title="non-constant static final fields marked as final in .class"> + <compile files="FinalStaticField.java"/> + <run class="FinalStaticField"/> + </ajc-test> + + <ajc-test dir="new" title="handle multiple nested inner classes" + keywords="from-java"> + <compile files="InnerHell.java"/> + <run class="InnerHell"/> + </ajc-test> + + <ajc-test dir="new/volatileKeyword" pr="151" + title="advice on a static method" keywords="from-java"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="new/innerConsSyntax" pr="192" + title="inner constructor syntax causes compile error" keywords="from-java"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="new/paramWidening" pr="195" + title="widening of method parameters to match javac" keywords="from-java"> + <compile files="Driver.java"/> + <run class="Driver"/> + </ajc-test> + + <ajc-test dir="new" pr="313" + title="parenthesized string literals matching primitive type names" + keywords="from-java"> + <compile files="ParenPrimitive.java"/> + <run class="ParenPrimitive"/> + </ajc-test> + + <ajc-test dir="new" title="simple type coercions tests" keywords="from-java"> + <compile files="TypeCoercions.java"/> + <run class="TypeCoercions"/> + </ajc-test> + + <ajc-test dir="new" title="order of type declarations shouldn't matter" + keywords="from-java"> + <compile files="OrderOfTypes.java"/> + <run class="OrderOfTypes"/> + </ajc-test> + + <ajc-test dir="new" title="Scanner non recognizing strictfp." + keywords="from-java"> + <compile files="StrictFp.java"/> + <run class="StrictFp"/> + </ajc-test> + + <ajc-test dir="new" + title="Crashes when a lot of zeros are in front of a double variable [!!! purejava]" + keywords="from-java"> + <compile files="Zeros.java"/> + <run class="Zeros"/> + </ajc-test> -</suite>
\ No newline at end of file +</suite> diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java index fecf38e47..1f4ee65b4 100644 --- a/util/src/main/java/org/aspectj/util/LangUtil.java +++ b/util/src/main/java/org/aspectj/util/LangUtil.java @@ -126,7 +126,7 @@ public class LangUtil { } @Deprecated - public static boolean isOnePointThreeVMOrGreater() { + public static boolean is1dot3VMOrGreater() { return 1.3 <= vmVersion; } @@ -136,25 +136,25 @@ public class LangUtil { } @Deprecated - public static boolean is15VMOrGreater() { + public static boolean is1dot5VMOrGreater() { return 1.5 <= vmVersion; } @Deprecated - public static boolean is16VMOrGreater() { + public static boolean is1dot6VMOrGreater() { return 1.6 <= vmVersion; } @Deprecated - public static boolean is17VMOrGreater() { + public static boolean is1dot7VMOrGreater() { return 1.7 <= vmVersion; } - public static boolean is18VMOrGreater() { + public static boolean is1dot8VMOrGreater() { return 1.8 <= vmVersion; } - public static boolean is19VMOrGreater() { + public static boolean is9VMOrGreater() { return 9 <= vmVersion; } @@ -178,6 +178,10 @@ public class LangUtil { return 14 <= vmVersion; } + public static boolean is15VMOrGreater() { + return 15 <= vmVersion; + } + /** * Shorthand for "if null, throw IllegalArgumentException" * diff --git a/util/src/test/java/org/aspectj/util/LangUtilTest.java b/util/src/test/java/org/aspectj/util/LangUtilTest.java index 87b976957..fddc6f946 100644 --- a/util/src/test/java/org/aspectj/util/LangUtilTest.java +++ b/util/src/test/java/org/aspectj/util/LangUtilTest.java @@ -101,9 +101,9 @@ public class LangUtilTest extends TestCase { // } public void testVersion() { - assertTrue(LangUtil.is18VMOrGreater()); // min vm now - floor may change + assertTrue(LangUtil.is1dot8VMOrGreater()); // min vm now - floor may change if (LangUtil.is11VMOrGreater()) { - assertTrue(LangUtil.is19VMOrGreater()); + assertTrue(LangUtil.is9VMOrGreater()); assertTrue(LangUtil.is10VMOrGreater()); } } diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java b/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java index 76acc6e7f..2b8cc5ceb 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java @@ -351,7 +351,7 @@ public class ClassPathManager { String jdkHome = new File(jrtFsPath).getParentFile().getParent(); FileSystem fs = null; try { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { Map<String, String> env = new HashMap<>(); env.put("java.home", jdkHome); fs = FileSystems.newFileSystem(JRT_URI, env); diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java index f191da13b..a27824635 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -149,7 +149,7 @@ public class WeavingAdaptor implements IMessageContext { } // On Java9 it is possible to fail to find a URLClassLoader from which to derive a suitable classpath // For now we can determine it from the java.class.path: - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { list.add(0, LangUtil.getJrtFsFilePath()); List<String> javaClassPathEntries = makeClasspath(System.getProperty("java.class.path")); for (int i=javaClassPathEntries.size()-1;i>=0;i--) { @@ -945,4 +945,4 @@ public class WeavingAdaptor implements IMessageContext { public void setActiveProtectionDomain(ProtectionDomain protectionDomain) { activeProtectionDomain = protectionDomain; } -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java index 78566e523..4ef5bf3e0 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.weaver; @@ -110,7 +110,7 @@ public class WeaverModuleTests extends TestCase { suite.addTestSuite(FieldSetTestCase.class); suite.addTestSuite(HierarchyDependsTestCase.class); suite.addTestSuite(IdWeaveTestCase.class); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { suite.addTestSuite(JImageTestCase.class); } suite.addTestSuite(MegaZipTestCase.class); @@ -125,7 +125,7 @@ public class WeaverModuleTests extends TestCase { suite.addTestSuite(WorldTestCase.class); suite.addTestSuite(ZipTestCase.class); suite.addTestSuite(TypeXTestCase.class); - + suite.addTestSuite(AnnotationPatternMatchingTestCase.class); suite.addTestSuite(AnnotationPatternTestCase.class); suite.addTestSuite(ConcretizationTestCase.class); diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java index abb8c08b2..faa645f84 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2017 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html * ******************************************************************/ package org.aspectj.weaver.bcel; @@ -35,7 +35,7 @@ import junit.framework.TestCase; /** * Exercise the JImage handling in @link {@link org.aspectj.weaver.bcel.ClassPathManager}. - * + * * @author Andy Clement */ public class JImageTestCase extends TestCase { @@ -47,15 +47,15 @@ public class JImageTestCase extends TestCase { paths.add(LangUtil.getJrtFsFilePath()); cpm = new ClassPathManager(paths,new TestMessageHandler()); } - + public void testOnJava9() { - if (!LangUtil.is19VMOrGreater()) { + if (!LangUtil.is9VMOrGreater()) { System.out.println("SKIPPING JIMAGE TESTS AS NOT ON 1.9 OR LATER"); } } - - public void testBasicStructureAndCapabilities() { - if (!LangUtil.is19VMOrGreater()) return; + + public void testBasicStructureAndCapabilities() { + if (!LangUtil.is9VMOrGreater()) return; // Should be one entry for finding JRT contents List<Entry> entries = cpm.getEntries(); assertEquals(1,entries.size()); @@ -65,11 +65,11 @@ public class JImageTestCase extends TestCase { assertNotNull(stringClassFile); assertEquals("java/lang/String.class",stringClassFile.getPath()); } - + public void testBehaviour() throws Exception { - if (!LangUtil.is19VMOrGreater()) return; + if (!LangUtil.is9VMOrGreater()) return; JImageEntry jie = getJImageEntry(); - + Map<String, Path> packageCache = jie.getPackageCache(); assertTrue(packageCache.size()>0); // Note: seems to be about 1625 entries in it for Java9 @@ -77,12 +77,12 @@ public class JImageTestCase extends TestCase { assertEquals("modules/java.base/java/lang", path.toString()); path = packageCache.get("java/io"); assertEquals("modules/java.base/java/io", path.toString()); - + assertNotNull(jie.find("java/lang/String")); assertNotNull(jie.find("java/io/File")); // TODO test the filecache, hard because difficult to simulate collection of SoftReferences } - + static class TestMessageHandler implements IMessageHandler { @@ -103,11 +103,11 @@ public class JImageTestCase extends TestCase { @Override public void ignore(Kind kind) { } - + } // --- - + private JImageEntry getJImageEntry() { return (JImageEntry) cpm.getEntries().get(0); } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java index bd7c2ae65..da3e9f79e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.weaver.bcel; @@ -55,6 +55,11 @@ public class MoveInstructionsWeaveTestCase extends WeaveTestCase { static int counter = 0; public void testFancyHello() throws IOException { + // Reset counter, just in case this test runs multiple times in one JVM. This can happen e.g. due to "run all tests" + // in IntelliJ IDEA, which directly runs this test class and als WeaverModuleTests, both of which implement + // junit.framework.TestCase. In that case, during the second run the counter would start at a higher base count, + // making the 2nd test run fail. + counter = 0; BcelAdvice p = new BcelAdvice(null, makePointcutAll(), null, 0, -1, -1, null, null) { public void specializeOn(Shadow s) { super.specializeOn(s); @@ -63,7 +68,7 @@ public class MoveInstructionsWeaveTestCase extends WeaveTestCase { public boolean implementOn(Shadow s) { BcelShadow shadow = (BcelShadow) s; - LazyMethodGen newMethod = + LazyMethodGen newMethod = shadow.extractShadowInstructionsIntoNewMethod(NameMangler.getExtractableName(shadow .getSignature()) + "_extracted" + counter++, 0, this.getSourceLocation(), new ArrayList(),shadow.getEnclosingClass().isInterface()); |