diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-04 07:58:52 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-04 07:58:52 +0700 |
commit | 49cb924f5402c9d24379ae1af62def6fa5892649 (patch) | |
tree | 69844405209043e2e18aa9eef0f01f287bc1ae52 /ajdoc | |
parent | 82df3f0fc9842758f15f12299c9113e48f1ccb5c (diff) | |
download | aspectj-49cb924f5402c9d24379ae1af62def6fa5892649.tar.gz aspectj-49cb924f5402c9d24379ae1af62def6fa5892649.zip |
Upgrade license from CPLv1/EPLv1 to EPLv2
This was required by the Eclipse team as one precondition for the next
release.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'ajdoc')
24 files changed, 319 insertions, 319 deletions
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java index 5af5610a9..f32f45d24 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java index 500e8603a..13bb6f8e9 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java @@ -3,9 +3,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java index 0c8bc3575..b7144965a 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andrew Huff initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Andrew Huff initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; 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 56565e05a..8d36a2433 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -3,9 +3,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java index 21c56d160..8b32dfa66 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java @@ -3,9 +3,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java index 9f728a946..a32c1bd8a 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * Mik Kersten port to AspectJ 1.1+ code base * ******************************************************************/ @@ -40,7 +40,7 @@ import org.aspectj.util.LangUtil; /** * This is an old implementation of ajdoc that does not use an OO style. However, it does the job, and should serve to evolve a * lightweight ajdoc implementation until we can make a properly extended javadoc implementation. - * + * * @author Mik Kersten */ public class Main implements Config { diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java index 4db92d66a..b615078ba 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.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: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -27,7 +27,7 @@ public class StructureUtil { /** * Calculate the targets for a given IProgramElement (and it's immediate children if its not a type or if the child is CODE) and * relationship kind - * + * * @return null if a relationship of that kind is not found */ public static List<String> getTargets(IProgramElement node, IRelationship.Kind kind) { @@ -37,7 +37,7 @@ public class StructureUtil { /** * Calculate the targets for a given IProgramElement (and it's immediate children if its not a type or if the child is CODE) and * relationship kind with the specified relationship name. - * + * * @return null if a relationship of that kind is not found */ public static List<String> getTargets(IProgramElement node, IRelationship.Kind kind, String relName) { @@ -166,7 +166,7 @@ public class StructureUtil { return isIntName || node.getName().startsWith("new "); // return isIntName; // if (!isIntName) { - // + // // return node.getName().startsWith("new "); // } else { // return false; diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java index 64d7aebf2..3dd6a25b5 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * Mik Kersten port to AspectJ 1.1+ code base * ******************************************************************/ @@ -48,7 +48,7 @@ class StubFileGenerator { FileUtil.copyFile(inputFile, signatureFile); return; } - + String path = StructureUtil.translateAjPathName(signatureFile.getCanonicalPath()); PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(path))); @@ -190,7 +190,7 @@ class StubFileGenerator { /** * We want to go: just before the first period just before the first @ just before the end of the comment - * + * * Adds a place holder for the period ('#') if one will need to be replaced. */ static String addToFormal(String formalComment, String string) { diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java index c5eb5f921..3636d98d6 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -20,5 +20,5 @@ public class Util { String version = System.getProperty("java.class.version","44.0"); return version.equals("49.0"); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java index 50bddfb5d..8bf87bb73 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2019 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,5 +14,5 @@ package org.aspectj.tools.ajdoc; public class AJDocConstants { public final static String VERSION = "1.7"; - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java index 6210647e0..89c4e7f2e 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java @@ -1,14 +1,14 @@ package org.aspectj.tools.ajdoc; /* ******************************************************************* * 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: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ import junit.framework.Test; @@ -24,12 +24,12 @@ public class AjdocModuleTests { suite.addTestSuite(DeclareFormsTest.class); suite.addTestSuite(SpacewarTestCase.class); suite.addTestSuite(PatternsTestCase.class); - suite.addTestSuite(CoverageTestCase.class); + suite.addTestSuite(CoverageTestCase.class); suite.addTestSuite(ITDTest.class); suite.addTestSuite(FullyQualifiedArgumentTest.class); suite.addTestSuite(EnumTest.class); suite.addTestSuite(PointcutVisibilityTest.class); - suite.addTestSuite(ExecutionTestCase.class); + suite.addTestSuite(ExecutionTestCase.class); suite.addTestSuite(BugTest.class); return suite; } 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 3e69f4887..dd90652cb 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java @@ -1,9 +1,9 @@ /******************************************************************** * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version 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 0baeb7dcd..35916f030 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java @@ -1,9 +1,9 @@ /******************************************************************** * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java index 2fbe19b44..a3594819f 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ @@ -18,9 +18,9 @@ import java.io.File; import org.aspectj.util.FileUtil; public class AjdocTests {//extends TestCase { - + public static File ASPECTJRT_PATH; - + static { String[] paths = { "sp:aspectjrt.path", "sp:aspectjrt.jar", "../lib/test/aspectjrt.jar", "../aj-build/jars/aspectj5rt-all.jar", diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java index 6cbec3ebe..42d2c6f43 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -28,7 +28,7 @@ public class BugTest extends AjdocTestCase { assertFalse("expected all decorating tags to be removed but found that they" + " weren't",AjdocOutputChecker.containsString(html, Config.DECL_ID_STRING)); } - + /** * Passing the "-Xlint:error" option through to the compiler should * cause the ajc build to fail because the advice did not match @@ -60,7 +60,7 @@ public class BugTest extends AjdocTestCase { "advice defined in AdviceDidNotMatch has not been applied [Xlint:adviceDidNotMatch]", Main.getErrors()[0].getMessage()); } - + /** * Passing the -aspectpath option though to the compiler should * result in relationships being displayed @@ -76,12 +76,12 @@ public class BugTest extends AjdocTestCase { fail("couldn't find " + getAbsolutePathOutdir() + File.separator + "C.html - were there javadoc/compilation errors?"); } assertTrue("expected to find 'Advised by' in the html output but did " + - " not",AjdocOutputChecker.containsString(html, + " not",AjdocOutputChecker.containsString(html, HtmlDecorator.HtmlRelationshipKind.ADVISED_BY.getName())); } - + /** - * Passing an option starting with "-" that doesn't require a second entry + * Passing an option starting with "-" that doesn't require a second entry * should mean everything is correctly given to the compiler. For example: * '-outxml -aspectpath <file>" should mean both '-outxml' and the aspectpath * options are given correctly. @@ -97,15 +97,15 @@ public class BugTest extends AjdocTestCase { fail("couldn't find " + getAbsolutePathOutdir() + File.separator + "C.html - were there javadoc/compilation errors?"); } assertTrue("expected to find 'Advised by' in the html output but did " + - " not",AjdocOutputChecker.containsString(html, + " not",AjdocOutputChecker.containsString(html, HtmlDecorator.HtmlRelationshipKind.ADVISED_BY.getName())); - File aopFile = new File(getAbsolutePathOutdir() + File.separator + File aopFile = new File(getAbsolutePathOutdir() + File.separator + "META-INF" + File.separator + "aop-ajc.xml"); - assertTrue("couldn't find " + getAbsolutePathOutdir() + File.separator - + "META-INF" + File.separator + "aop-ajc.xml" , + assertTrue("couldn't find " + getAbsolutePathOutdir() + File.separator + + "META-INF" + File.separator + "aop-ajc.xml" , aopFile.exists()); - } - + } + /** * Passing bogus option to ajc */ @@ -116,7 +116,7 @@ public class BugTest extends AjdocTestCase { runAjdoc(files,"1.5",ajOptions); assertTrue("expected build of project to abort",Main.hasAborted()); } - + /** * Not passing any files to ajdoc should result in both the ajdoc * and ajc usage messages @@ -127,11 +127,11 @@ public class BugTest extends AjdocTestCase { options.add("-verbose"); runAjdoc(options); assertTrue("expected the ajdoc usage message to be reported",Main.hasShownAjdocUsageMessage()); - assertTrue("expected build of project to abort",Main.hasAborted()); + assertTrue("expected build of project to abort",Main.hasAborted()); } - + /** - * javadoc comments should still appear even if preceded by + * javadoc comments should still appear even if preceded by * 'normal' comments */ public void testPr164356() throws Exception { @@ -140,7 +140,7 @@ public class BugTest extends AjdocTestCase { runAjdoc(files); File htmlFile = new File(getAbsolutePathOutdir() + "/C.html"); if (!htmlFile.exists()) { - fail("couldn't find " + htmlFile.getAbsolutePath() + + fail("couldn't find " + htmlFile.getAbsolutePath() + " (ajc aborted: " + Main.hasAborted() + ")"); } String foo = "description of foo"; @@ -148,19 +148,19 @@ public class BugTest extends AjdocTestCase { String goo = "description of goo"; String bas = "description of bas"; assertTrue("expected method description 'description of foo' to appear" + - " in ajdoc output but it did not", + " in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, foo)); assertTrue("expected method description 'description of bar' to " + - "appear in ajdoc output but it did not", + "appear in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, bar)); assertFalse("didn't expect method description 'description of goo' to " + - "appear in ajdoc output but it did not", + "appear in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, goo)); assertTrue("expected method description 'description of bas' to appear" + - " in ajdoc output but it did not", + " in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, bas)); } - + /** * Comments for a constructor should be included in the ajdoc output */ @@ -170,16 +170,16 @@ public class BugTest extends AjdocTestCase { runAjdoc(files); File htmlFile = new File(getAbsolutePathOutdir() + "/C.html"); if (!htmlFile.exists()) { - fail("couldn't find " + htmlFile.getAbsolutePath() + + fail("couldn't find " + htmlFile.getAbsolutePath() + " (ajc aborted: " + Main.hasAborted() + ")"); } String methodDesc = "This is method foo"; String constDesc = "This is a constructor"; assertTrue("expected method description 'This is method foo' to appear" + - " in ajdoc output but it did not", + " in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, methodDesc)); assertTrue("expected constructor description 'This is a constructor' to " + - "appear in ajdoc output but it did not", + "appear in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, constDesc)); } } 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 ab2fc8ec2..412d2d4eb 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java index 6f2e36959..ab132ed46 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.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: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -28,20 +28,20 @@ public class DeclareFormsTest extends AjdocTestCase { private String declareParentsImpl = "declare parents: implements Serializable"; private String declareSoft = "declare soft: foo.SizeException2"; private String declarePrecedence = "declare precedence: foo.DeclareCoverage2, foo.InterTypeDecCoverage2"; - + private String doItHref = "HREF=\"../foo/Main2.html#doIt()\""; private String pointHref = "HREF=\"../foo/Point2.html\""; private String cHref = "HREF=\"../foo/C.html\""; - + private String doIt = "doIt()"; - + public void testCoverage() { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage.java")}; runAjdoc("private","1.6",files); } - + /** * Test that the declare statements appear in the Declare Detail * and Declare Summary sections of the ajdoc @@ -50,14 +50,14 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } // check the contents of the declare detail summary - String[] strings = { + String[] strings = { declareError, declareWarning, declareParentsImpl, @@ -68,7 +68,7 @@ public class DeclareFormsTest extends AjdocTestCase { htmlFile,strings,"DECLARE DETAIL SUMMARY"); assertTrue(htmlFile.getName() + " should contain all declare statements in " + "the Declare Detail section",missing.isEmpty()); - + // check the contents of the declare summary - should contain // the same strings missing = AjdocOutputChecker.getMissingStringsInSection( @@ -76,7 +76,7 @@ public class DeclareFormsTest extends AjdocTestCase { assertTrue(htmlFile.getName() + " should contain all declare statements in " + "the Declare Summary section",missing.isEmpty()); } - + /** * Declare warning's should have the 'matched by' relationship * in the ajdoc for the declaring aspect @@ -85,31 +85,31 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY", declareWarningQuotes, HtmlDecorator.HtmlRelationshipKind.MATCHED_BY, doItHref); - assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + + assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", declareWarningQuotes, HtmlDecorator.HtmlRelationshipKind.MATCHED_BY, doItHref); - assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + + assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare warning should have the 'matches + * The target of a declare warning should have the 'matches * declare' relationship in the ajdoc - test the case when * the declare warning matches a call join point */ @@ -117,31 +117,31 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Main2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName(doIt), HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, declareWarningQuotes); - assertTrue("Should have '" + doIt + " matches declare " + + assertTrue("Should have '" + doIt + " matches declare " + declareWarningQuotes + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", toName(doIt), HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, declareWarningQuotes); - assertTrue("Should have '" + doIt + " matches declare " + + assertTrue("Should have '" + doIt + " matches declare " + declareWarningQuotes + "' in the Declare Summary section", b); } - + /** - * The target of a declare warning should have the 'matches + * The target of a declare warning should have the 'matches * declare' relationship in the ajdoc - test the case when * the declare warning matches an execution join point */ @@ -149,20 +149,20 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Point2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("setX(int)"), // LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)", HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;blahquot;"); - assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + + assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", @@ -170,10 +170,10 @@ public class DeclareFormsTest extends AjdocTestCase { // LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)", HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;blahquot;"); - assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + + assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + "' in the Method Summary section", b); } - + /** * Declare parents's should have the 'declared on' relationship * in the ajdoc for the declaring aspect @@ -182,38 +182,38 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY", declareParentsImpl, HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, pointHref); - assertTrue("Should have ' " + declareParentsImpl + " declared on " + + assertTrue("Should have ' " + declareParentsImpl + " declared on " + pointHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", declareParentsImpl, HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, pointHref); - assertTrue("Should have ' " + declareParentsImpl + " declared on " + + assertTrue("Should have ' " + declareParentsImpl + " declared on " + pointHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare parent should have the 'aspect + * The target of a declare parent should have the 'aspect * declarations' relationship in the ajdoc */ public void testAspectDeclarations() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Point2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() @@ -227,7 +227,7 @@ public class DeclareFormsTest extends AjdocTestCase { " declare parents: implements Serializable'",b); } - + /** * Declare soft's should have the 'softens' relationship * in the ajdoc for the declaring aspect @@ -236,60 +236,60 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY", declareSoft, HtmlDecorator.HtmlRelationshipKind.SOFTENS, doItHref); - assertTrue("Should have '" + declareSoft + " softens " + doItHref + + assertTrue("Should have '" + declareSoft + " softens " + doItHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", declareSoft, HtmlDecorator.HtmlRelationshipKind.SOFTENS, doItHref); - assertTrue("Should have '" + declareSoft + " softens " + doItHref + + assertTrue("Should have '" + declareSoft + " softens " + doItHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare soft should have the 'softened + * The target of a declare soft should have the 'softened * by' relationship in the ajdoc */ public void testSoftenedBy() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Main2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName(doIt), HtmlDecorator.HtmlRelationshipKind.SOFTENED_BY, declareSoft); - assertTrue("Should have '" + doIt + " softened by " + declareSoft + + assertTrue("Should have '" + doIt + " softened by " + declareSoft + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", toName(doIt), HtmlDecorator.HtmlRelationshipKind.SOFTENED_BY, declareSoft); - assertTrue("Should have '" + doIt + " softened by " + declareSoft + + assertTrue("Should have '" + doIt + " softened by " + declareSoft + "' in the Method Summary section", b); } - + private String toName(String name) { if (!LangUtil.is11VMOrGreater()) { name = name.replace('(','-'); @@ -297,7 +297,7 @@ public class DeclareFormsTest extends AjdocTestCase { } return name; } - + /** * Declare annotation should have the 'annotates' relationship * in the ajdoc for the declaring aspect @@ -306,7 +306,7 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtType.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + // Aspect AnnotationTest should contain within it's declare // detail and summary the declare annotation statement. // Check for this.... @@ -332,19 +332,19 @@ public class DeclareFormsTest extends AjdocTestCase { "declare @type: foo.C : @MyAnnotation", HtmlDecorator.HtmlRelationshipKind.ANNOTATES, cHref); - assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + cHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", "declare @type: foo.C : @MyAnnotation", HtmlDecorator.HtmlRelationshipKind.ANNOTATES, cHref); - assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + cHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -352,19 +352,19 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtMethod.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @method: public * foo.C.*(..) : @MyAnnotation"); assertTrue("Should have 'amethod() annotated by " + - "declare @method: public * foo.C.*(..) : @MyAnnotation" + + "declare @method: public * foo.C.*(..) : @MyAnnotation" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", @@ -372,12 +372,12 @@ public class DeclareFormsTest extends AjdocTestCase { HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @method: public * foo.C.*(..) : @MyAnnotation"); assertTrue("Should have 'amethod() annotated by " + - "declare @method: public * foo.C.*(..) : @MyAnnotation" + + "declare @method: public * foo.C.*(..) : @MyAnnotation" + "' in the Method Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -385,33 +385,33 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtConstructor.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== CONSTRUCTOR DETAIL", LangUtil.is11VMOrGreater()?"<init>(java.lang.String)":toName("C(java.lang.String)"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @constructor: foo.C.new(..) : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @constructor: foo.C.new(..) : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @constructor: foo.C.new(..) : @MyAnnotation" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== CONSTRUCTOR SUMMARY", LangUtil.is11VMOrGreater()?"#%3Cinit%3E(java.lang.String)":toName("C(java.lang.String)"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @constructor: foo.C.new(..) : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @constructor: foo.C.new(..) : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @constructor: foo.C.new(..) : @MyAnnotation" + "' in the Method Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -419,33 +419,33 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtField.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== FIELD DETAIL", "x", HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @field: int foo.C.* : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @field: int foo.C.* : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @field: int foo.C.* : @MyAnnotation" + "' in the Field Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== FIELD SUMMARY", "x", HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @field: int foo.C.* : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @field: int foo.C.* : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @field: int foo.C.* : @MyAnnotation" + "' in the Field Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -466,7 +466,7 @@ public class DeclareFormsTest extends AjdocTestCase { assertTrue("The class data section should have 'annotated by" + " declare @type: foo.C : @MyAnnotation'",b); } - + /** * Test that info for both "matches declare" and "advised by" * appear in the ajdoc for a method when the method is affected @@ -476,13 +476,13 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "A.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("amethod()"), @@ -497,24 +497,24 @@ public class DeclareFormsTest extends AjdocTestCase { "declare warning: quot;warningquot;"); assertTrue("Should have 'amethod() matches declare declare warning: " + "quot;warningquot;' in the Method Summary section", b); - + b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "before(): p.."); assertTrue("the Method Detail should have amethod() advised by before(): p..",b); - + b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "before(): p.."); - assertTrue("the Method Summary should have amethod() advised by before(): p..",b); + assertTrue("the Method Summary should have amethod() advised by before(): p..",b); } - + /** - * Test that if there are two declare parents statements within + * Test that if there are two declare parents statements within * an aspect, one which extends and one which implements, that the * ajdoc shows the correct information */ @@ -522,48 +522,48 @@ public class DeclareFormsTest extends AjdocTestCase { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareParents.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareParents.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + String[] strings = { "declare parents: implements Serializable", "HREF=\"../foo/Class1.html\"", "declare parents: extends Observable", "HREF=\"../foo/Class2.html\""}; - + // check that the correct declare statements are there for (int i = 0; i < strings.length - 1; i = i+2) { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY",strings[i], HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, strings[i+1]); - assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + + assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + "' in the Declare Detail section", b); } - + for (int i = 0; i < strings.length - 1; i = i+2) { boolean b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", strings[i], HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, strings[i+1]); - assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + + assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + "' in the Declare Summary section", b); } - - // check that we don't have declare statements for those that don't + + // check that we don't have declare statements for those that don't // exist in the code boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY",strings[0], HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, strings[3]); - assertFalse("Should not have ' " + strings[0] + " declared on " + strings[3] + + assertFalse("Should not have ' " + strings[0] + " declared on " + strings[3] + "' in the Declare Detail section", b); - + } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java index 65ef3b3c9..0ff0c581f 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,7 +14,7 @@ import java.io.File; public class EnumTest extends AjdocTestCase { - + /** * Test for pr122728 - no StringOutOfBoundsException * when processing an Enum @@ -27,14 +27,14 @@ public class EnumTest extends AjdocTestCase { /** * Test for pr122728 - no StringOutOfBoundsException - * when processing an Enum + * when processing an Enum */ public void testInlinedEnum() throws Exception { initialiseProject("pr122728"); File[] files = {new File(getAbsoluteProjectDir() + "/src/pack/ClassWithInnerEnum.java")}; runAjdoc("private","1.5",files); } - + /** * Test for pr122728 - no StringOutOfBoundsException * when processing an Enum diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java index 721977f2c..cbbe8e49f 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.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: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -20,17 +20,17 @@ import org.aspectj.bridge.Version; * @author Mik Kersten */ public class ExecutionTestCase extends AjdocTestCase { - + public void testVersionMatch() { String ajdocVersion = Main.getVersion(); String compilerVersion = Version.getText(); assertTrue("version check", ajdocVersion.endsWith(compilerVersion)); } - + public void testFailingBuild() { initialiseProject("failing-build"); File file1 = new File(getAbsoluteProjectDir() + File.separatorChar + "Fail.java"); - String[] args = { file1.getAbsolutePath() }; + String[] args = { file1.getAbsolutePath() }; org.aspectj.tools.ajdoc.Main.main(args); assertTrue(Main.hasAborted()); } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java index 2d97a82bf..700cd18ab 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,7 +14,7 @@ import java.io.File; import java.util.List; public class FullyQualifiedArgumentTest extends AjdocTestCase { - + /** * Test for pr58520 */ @@ -24,7 +24,7 @@ public class FullyQualifiedArgumentTest extends AjdocTestCase { new File(getAbsoluteProjectDir() + File.separatorChar +"src/pack/C.java"), new File(getAbsoluteProjectDir() + File.separatorChar + "src/pack/A.aj")}; runAjdoc("private",files); - + // check the contents of A.html File htmlA = new File(getAbsolutePathOutdir() + "/pack/A.html"); if (!htmlA.exists()) { @@ -41,5 +41,5 @@ public class FullyQualifiedArgumentTest extends AjdocTestCase { assertEquals("The fully qualified name should appear in the argument", "C.html#method3(String)",missing.get(0)); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java index 899782d88..2444469f9 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,7 +14,7 @@ import java.io.File; import java.util.List; public class ITDTest extends AjdocTestCase { - + /** * Test for pr119453 */ @@ -36,19 +36,19 @@ public class ITDTest extends AjdocTestCase { "C.y", HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, "HREF=\"../pack/C.html\""); - assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + + assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlA,"DECLARE SUMMARY", "C.y", HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, "HREF=\"../pack/C.html\""); - assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + + assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + "' in the Declare Summary section", b); - + // check the modifiers are correct in the declare detail summary String[] stringsA = { "private int", - "public java.lang.String", + "public java.lang.String", "<H3>C.y</H3>", "public </TT><B>C.C", "package void"}; @@ -56,14 +56,14 @@ public class ITDTest extends AjdocTestCase { assertEquals("There should be one missing string ",1,missing.size()); assertEquals("the 'package' and 'void' modifiers shouldn't appear in the 'Declare Detail' section of the ajdoc", "package void", missing.get(0)); - + // check the modifiers are correct in the declare summary String[] stringsA2 = {"private", "int", "public", "String", "package void"}; missing = AjdocOutputChecker.getMissingStringsInSection(htmlA,stringsA2,"DECLARE SUMMARY"); assertEquals("There should be two missing strings ",2,missing.size()); assertTrue("the public modifier shouldn't appear in the 'Declare Summary' section of the ajdoc", missing.contains("public")); assertTrue("the 'package' and 'void' modifiers shouldn't appear in the 'Declare Summary' section of the ajdoc", missing.contains("package void")); - + } /** @@ -86,10 +86,10 @@ public class ITDTest extends AjdocTestCase { // check that the required sections exist assertTrue(htmlC.getAbsolutePath() + " should contain an " - + "'INTER-TYPE METHOD SUMMARY' section", + + "'INTER-TYPE METHOD SUMMARY' section", AjdocOutputChecker.containsString(htmlC, "INTER-TYPE METHOD SUMMARY")); assertTrue(htmlC.getAbsolutePath() + " should contain an " - + "'INTER-TYPE FIELD SUMMARY' section", + + "'INTER-TYPE FIELD SUMMARY' section", AjdocOutputChecker.containsString(htmlC, "INTER-TYPE FIELD SUMMARY")); assertTrue(htmlC.getAbsolutePath() + " should contain an " + "'INTER-TYPE CONSTRUCTOR SUMMARY' section", @@ -105,12 +105,12 @@ public class ITDTest extends AjdocTestCase { String[] stringsC2 = { "private" }; missing = AjdocOutputChecker.getMissingStringsInSection(htmlC,stringsC2,"INTER-TYPE FIELD SUMMARY"); assertTrue("the private modifier for itd methods should appear in the ajdoc ",missing.size() == 0); - + } - + /** * Test that the ITD's do not appear in as 'aspect declarations' in the - * class data information. + * class data information. */ public void testNoAspectDeclarations() throws Exception { initialiseProject("pr119453"); diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java index 61c0d67cd..de8ab5571 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.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: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -16,25 +16,25 @@ import java.io.File; /** * A long way to go until full coverage, but this is the place to add more. - * + * * @author Mik Kersten */ public class PatternsTestCase extends AjdocTestCase { - + public void testSimpleExample() { - + // System.err.println(new File("testdata.figures-demo").exists()); // File file1 = new File("testdata/patterns/allPatterns.lst"); File outdir = new File("testdata/patterns/doc"); File srcdir = new File("../../docs/sandbox/ubc-design-patterns/src"); - - String[] args = { -// "-XajdocDebug", + + String[] args = { +// "-XajdocDebug", "-classpath", AjdocTests.ASPECTJRT_PATH.getPath(), - "-d", + "-d", outdir.getAbsolutePath(), - "-sourcepath", + "-sourcepath", srcdir.getAbsolutePath(), "ca.ubc.cs.spl.aspectPatterns.patternLibrary", "ca.ubc.cs.spl.aspectPatterns.examples.abstractFactory.java", @@ -84,8 +84,8 @@ public class PatternsTestCase extends AjdocTestCase { "ca.ubc.cs.spl.aspectPatterns.examples.visitor.java", "ca.ubc.cs.spl.aspectPatterns.examples.visitor.aspectj" }; - + org.aspectj.tools.ajdoc.Main.main(args); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java index b3544d563..1ea3bbd40 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -18,7 +18,7 @@ import java.util.List; * @author Mik Kersten */ public class PointcutVisibilityTest extends AjdocTestCase { - + /** * Test that passing the "public" argument only shows * public pointcuts in the ajdoc @@ -27,7 +27,7 @@ public class PointcutVisibilityTest extends AjdocTestCase { initialiseProject("bug82340"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "Pointcuts.java")}; runAjdoc("public",files); - + // ajdoc for Pointcut.java should contain info about // the public pointcuts but not the protected and // private one (since "public" was an argument) @@ -43,18 +43,18 @@ public class PointcutVisibilityTest extends AjdocTestCase { assertTrue("passing the 'public' argument means the private pointcut shouldn't appear in the ajdoc", missing.contains("privatePointcut")); assertTrue("passing the 'public' argument means the protected pointcut shouldn't appear in the ajdoc", missing.contains("protectedPointcut")); } - + /** * Test that passing the "protected" argument only shows - * public and protected pointcuts in the ajdoc + * public and protected pointcuts in the ajdoc */ public void testCoverageProtectedMode() throws Exception { initialiseProject("bug82340"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "Pointcuts.java")}; runAjdoc("protected",files); - + // ajdoc for Pointcut.java should contain info about - // the public and protected pointcuts but not the + // the public and protected pointcuts but not the // private one (since "protected" was an argument) // Check that this is the case...... File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Pointcuts.html"); @@ -65,21 +65,21 @@ public class PointcutVisibilityTest extends AjdocTestCase { String[] strings = { "privatePointcut","protectedPointcut","publicPointcut"}; List missing = AjdocOutputChecker.getMissingStringsInSection(htmlFile,strings,"POINTCUT SUMMARY"); assertEquals("There should be one missing strings",1,missing.size()); - assertEquals("passing the 'protected' argument means the private pointcut shouldn't appear in the ajdoc", + assertEquals("passing the 'protected' argument means the private pointcut shouldn't appear in the ajdoc", "privatePointcut", missing.get(0)); } - + /** * Test that passing the "private" argument shows all - * pointcuts (public, protected and private) in the ajdoc + * pointcuts (public, protected and private) in the ajdoc */ public void testCoveragePrivateMode() throws Exception { initialiseProject("bug82340"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "Pointcuts.java")}; runAjdoc("private",files); - + // ajdoc for Pointcut.java should contain info about - // the public, protected and private pointcuts + // the public, protected and private pointcuts // (since "private" was an argument) // Check that this is the case...... File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Pointcuts.html"); @@ -92,5 +92,5 @@ public class PointcutVisibilityTest extends AjdocTestCase { assertTrue("passing the 'private' modifier means that private, protected and public " + "pointcuts should appear in the ajdoc",missing.isEmpty()); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java index 53f7a5ef9..4dab37aab 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.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: - * Mik Kersten initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -18,18 +18,18 @@ import java.io.File; * @author Mik Kersten */ public class SpacewarTestCase extends AjdocTestCase { - + private String[] dirs = {"spacewar","coordination"}; - + protected void setUp() throws Exception { super.setUp(); initialiseProject("spacewar"); } - + public void testSimpleExample() { runAjdoc(dirs); } - + public void testPublicModeExample() { runAjdoc("public",dirs); } |