From bd6a4b2b2fc1633ff2e64cc2d61c88918cc8c1ea Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 30 Jan 2019 08:39:41 -0800 Subject: [PATCH] mavenizing ajdoc - done --- ajdoc/pom.xml | 15 ++++++++ .../aspectj/tools/ajdoc/AjdocModuleTests.java | 27 -------------- .../tools/ajdoc/AjdocOutputChecker.java | 4 +-- .../aspectj/tools/ajdoc/AjdocTestCase.java | 6 ++-- .../org/aspectj/tools/ajdoc/AjdocTests.java | 36 +++++++++---------- .../ajdoc/{BugTests.java => BugTest.java} | 2 +- .../aspectj/tools/ajdoc/CoverageTestCase.java | 6 ++-- org.aspectj.ajdt.core/pom.xml | 18 ++++++++++ 8 files changed, 60 insertions(+), 54 deletions(-) delete mode 100644 ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java rename ajdoc/src/test/java/org/aspectj/tools/ajdoc/{BugTests.java => BugTest.java} (99%) diff --git a/ajdoc/pom.xml b/ajdoc/pom.xml index 558d1d1c2..bfe1c2c3f 100644 --- a/ajdoc/pom.xml +++ b/ajdoc/pom.xml @@ -35,5 +35,20 @@ org.aspectj.ajdt.core ${project.version} + + + + com.github.olivergondza + maven-jdk-tools-wrapper + 0.1 + + + + asm + asm + 1.0 + system + ${project.basedir}/../lib/asm/asm-7.0-beta.renamed.jar + diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java deleted file mode 100644 index 19202e9e3..000000000 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java +++ /dev/null @@ -1,27 +0,0 @@ -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 - * ******************************************************************/ - -import junit.framework.Test; -import junit.framework.TestSuite; - - -/** - * @author Mik Kersten - */ -public class AjdocModuleTests { - public static Test suite() { - TestSuite suite = new TestSuite(AjdocModuleTests.class.getName()); - suite.addTest(AjdocTests.suite()); - 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 485b5d80b..2100f7dba 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java @@ -119,9 +119,9 @@ public class AjdocOutputChecker { * @return List of those requiredStrings not found * @throws Exception */ - public static List /*String*/ getMissingStringsInSection(File htmlFile, + public static List getMissingStringsInSection(File htmlFile, String[] requiredStrings, String sectionHeader) throws Exception { - List missingStrings = new ArrayList(); + List missingStrings = new ArrayList(); for (int i = 0; i < requiredStrings.length; i++) { String string = requiredStrings[i]; if (!containsStringWithinSection(htmlFile,string,sectionHeader)) { 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 e3674086e..26dda1187 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java @@ -15,7 +15,7 @@ import java.io.IOException; import java.util.Iterator; import java.util.List; -import org.aspectj.tools.ajc.Ajc; +import org.aspectj.testing.util.TestUtil; import org.aspectj.util.LangUtil; import junit.framework.AssertionFailedError; @@ -25,7 +25,7 @@ import junit.framework.TestCase; * This class is the super class of all Ajdoc tests. It creates a sandbox directory and provides utility methods for copying over * the test projects and running the ajdoc command */ -public class AjdocTestCase extends TestCase { +public abstract class AjdocTestCase extends TestCase { public final static String testdataSrcDir = "../ajdoc/testdata"; protected static File sandboxDir; @@ -37,7 +37,7 @@ public class AjdocTestCase extends TestCase { docOutdir = null; projectDir = null; // Create a sandbox in which to work - sandboxDir = Ajc.createEmptySandbox(); + sandboxDir = TestUtil.createEmptySandbox(); // create the ajdocworkdingdir in the sandbox Main.setOutputWorkingDir(getWorkingDir().getAbsolutePath()); } 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 6debbe13b..52fe56b03 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java @@ -21,7 +21,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -public class AjdocTests extends TestCase { +public class AjdocTests {//extends TestCase { public static File ASPECTJRT_PATH; @@ -32,22 +32,22 @@ public class AjdocTests extends TestCase { "../runtime/bin"}; ASPECTJRT_PATH = FileUtil.getBestFile(paths); } - - public static Test suite() { - TestSuite suite = new TestSuite(AjdocTests.class.getName()); - //$JUnit-BEGIN$ - suite.addTestSuite(DeclareFormsTest.class); - suite.addTestSuite(SpacewarTestCase.class); - suite.addTestSuite(PatternsTestCase.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(BugTests.class); - //$JUnit-END$ - return suite; - } +// +// public static Test suite() { +// TestSuite suite = new TestSuite(AjdocTests.class.getName()); +// //$JUnit-BEGIN$ +// suite.addTestSuite(DeclareFormsTest.class); +// suite.addTestSuite(SpacewarTestCase.class); +// suite.addTestSuite(PatternsTestCase.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(BugTest.class); +// //$JUnit-END$ +// return suite; +// } } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java similarity index 99% rename from ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTests.java rename to ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java index 163774864..6caf5d79d 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTests.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java @@ -14,7 +14,7 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -public class BugTests extends AjdocTestCase { +public class BugTest extends AjdocTestCase { public void testPr160302() throws Exception { initialiseProject("pr160302"); 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 e73b94dae..70aaa8b35 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java @@ -74,7 +74,7 @@ public class CoverageTestCase extends AjdocTestCase { // the file contains the getI() method but doesn't contain // the private ClassBar, Bazz and Jazz classes. String[] strings = { "private", "getI()","ClassBar", "Bazz", "Jazz"}; - List missing = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); + List missing = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings); assertEquals("There should be 4 missing strings",4,missing.size()); assertTrue(htmlFile.getName() + " should not contain the private modifier",missing.contains("private")); assertTrue(htmlFile.getName() + " should not contain the private ClassBar class",missing.contains("ClassBar")); @@ -186,7 +186,7 @@ public class CoverageTestCase extends AjdocTestCase { "Aspect ClassA", "public abstract aspect ClassA
extends java.lang.Object
"}; } - List classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings); + List 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")); if (LangUtil.is18VMOrGreater()) { @@ -222,7 +222,7 @@ public class CoverageTestCase extends AjdocTestCase { "before(int):", "before(int): named()..", "before():"}; - List missing = AjdocOutputChecker.getMissingStringsInSection( + List missing = AjdocOutputChecker.getMissingStringsInSection( htmlFile, strings,"ADVICE DETAIL SUMMARY"); assertTrue(htmlFile.getName() + " should contain all advice in the Advice Detail section",missing.isEmpty()); missing = AjdocOutputChecker.getMissingStringsInSection( diff --git a/org.aspectj.ajdt.core/pom.xml b/org.aspectj.ajdt.core/pom.xml index 47bd8c56c..bafee1460 100644 --- a/org.aspectj.ajdt.core/pom.xml +++ b/org.aspectj.ajdt.core/pom.xml @@ -71,4 +71,22 @@ ${project.version} + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + test-jar + + + + + + + -- 2.39.5