@@ -35,5 +35,20 @@ | |||
<artifactId>org.aspectj.ajdt.core</artifactId> | |||
<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> | |||
<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> | |||
</project> |
@@ -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; | |||
} | |||
} |
@@ -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<String> getMissingStringsInSection(File htmlFile, | |||
String[] requiredStrings, String sectionHeader) throws Exception { | |||
List missingStrings = new ArrayList(); | |||
List<String> missingStrings = new ArrayList<String>(); | |||
for (int i = 0; i < requiredStrings.length; i++) { | |||
String string = requiredStrings[i]; | |||
if (!containsStringWithinSection(htmlFile,string,sectionHeader)) { |
@@ -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()); | |||
} |
@@ -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; | |||
// } | |||
} |
@@ -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"); |
@@ -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<String> 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</H2>", | |||
"public abstract aspect <B>ClassA</B><DT>extends java.lang.Object<DT>"}; | |||
} | |||
List classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings); | |||
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>")); | |||
if (LangUtil.is18VMOrGreater()) { | |||
@@ -222,7 +222,7 @@ public class CoverageTestCase extends AjdocTestCase { | |||
"before(int):", | |||
"before(int): named()..", | |||
"before():"}; | |||
List missing = AjdocOutputChecker.getMissingStringsInSection( | |||
List<String> 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( |
@@ -71,4 +71,22 @@ | |||
<version>${project.version}</version> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-jar-plugin</artifactId> | |||
<version>2.2</version> | |||
<executions> | |||
<execution> | |||
<goals> | |||
<goal>test-jar</goal> | |||
</goals> | |||
</execution> | |||
</executions> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |