diff options
author | Andy Clement <aclement@pivotal.io> | 2019-11-28 21:22:23 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2019-11-28 21:22:23 -0800 |
commit | cc88d52fb6c60fbc79a59dec61365b7864baa942 (patch) | |
tree | 2589b7d603cf5b52e7c619144343ab046e8e6c24 /testing | |
parent | a3e5e4104ff31c9f06d90bd0f6876bef305831dc (diff) | |
download | aspectj-cc88d52fb6c60fbc79a59dec61365b7864baa942.tar.gz aspectj-cc88d52fb6c60fbc79a59dec61365b7864baa942.zip |
polish
Diffstat (limited to 'testing')
34 files changed, 273 insertions, 169 deletions
diff --git a/testing/src/test/java/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java b/testing/src/test/java/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java index 8fb274176..0dcc23dfd 100644 --- a/testing/src/test/java/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java +++ b/testing/src/test/java/org/aspectj/internal/tools/ant/taskdefs/Ajctest.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 * ******************************************************************/ @@ -78,10 +78,11 @@ import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Reference; import org.aspectj.util.LangUtil; +@SuppressWarnings("deprecation") public class Ajctest extends Task implements PropertyChangeListener { private static Ajctest CURRENT_AJCTEST; - // todo shutdown hook assumes one task per VM + // todo shutdown hook assumes one task per VM public Ajctest() { super(); CURRENT_AJCTEST = this; @@ -112,13 +113,13 @@ public class Ajctest extends Task implements PropertyChangeListener { private void fire(String prop) { fire(prop, "dummy-old", "dummy-new"); } - + private static boolean dumpresults = false; private Stats ajdocStats = new Stats(); private Stats ajcStats = new Stats(); private Stats runStats = new Stats(); // private Stats errorStats = new Stats(); - private static final String NO_TESTID = "NONE"; + private static final String NO_TESTID = "NONE"; private File workingdir = new File("ajworkingdir"); //XXX //fields @@ -141,7 +142,7 @@ public class Ajctest extends Task implements PropertyChangeListener { public Argfile createArgfile() { return createTestset().createArgfile(); } - + public void setNoverify(boolean input) { if (input != noverify) noverify = input; } @@ -152,13 +153,13 @@ public class Ajctest extends Task implements PropertyChangeListener { //setTestId(target.getName()); } } - + public void setTestId(String str) { if ((null != str) && (0 < str.trim().length())) { testId = str; } } - + public void setArgs(String str) { if (str == null || str.length() < 1) return; StringTokenizer tok = new StringTokenizer(str, ",", false); @@ -221,7 +222,7 @@ public class Ajctest extends Task implements PropertyChangeListener { return arg; } - + public Argument createArg() { Argument arg = new Argument(false); args.add(arg); @@ -279,7 +280,7 @@ public class Ajctest extends Task implements PropertyChangeListener { } public Run createJava() { - Run testclass = new Run(project); + Run testclass = new Run(project); testclasses.add(testclass); return testclass; } @@ -310,11 +311,11 @@ public class Ajctest extends Task implements PropertyChangeListener { ajdoc.createArg().setValue(t.nextToken().trim()); } } - + public void addAjdoc(Ajdoc ajdoc) { this.ajdoc = ajdoc; } - + public Ajdoc createAjdoc() { return ajdoc = new Ajdoc(); } @@ -387,7 +388,7 @@ public class Ajctest extends Task implements PropertyChangeListener { } } //end-methods - + public static class Argfile { private String name; public void setName(String name) { this.name = name; } @@ -457,18 +458,18 @@ public class Ajctest extends Task implements PropertyChangeListener { public void setExcludesfile(File excludesfile) { super.setExcludesfile(excludesfile); havecludes = true; - } - + } + public void setArgfile(String name) { createArgfile().setName(name); } - + public void setArgfiles(String str) { StringTokenizer tok = new StringTokenizer(str, ", ", false); while (tok.hasMoreTokens()) { createArgfile().setName(tok.nextToken().trim()); } - + } public Argfile createArgfile() { Argfile argfile = new Argfile(); @@ -496,7 +497,7 @@ public class Ajctest extends Task implements PropertyChangeListener { public void setTestclass(String testclass) { createJava().setClassname(testclass); } - + public void setClasses(String str) { for (StringTokenizer t = new StringTokenizer(str, ", ", false); t.hasMoreTokens();) { @@ -510,14 +511,14 @@ public class Ajctest extends Task implements PropertyChangeListener { classpath.append(path); } } - + public Path createClasspath() { if (classpath == null) { classpath = new Path(project); } return classpath.createPath(); } - + public void setClasspathRef(Reference r) { createClasspath().setRefid(r); } @@ -528,18 +529,18 @@ public class Ajctest extends Task implements PropertyChangeListener { internalclasspath.append(path); } } - + public Path createInternalclasspath() { if (internalclasspath == null) { internalclasspath = new Path(project); } return internalclasspath.createPath(); } - + public void setInternalclasspathRef(Reference r) { createInternalclasspath().setRefid(r); } - + public void setAjdoc(boolean b) { if (b && ajdoc == null) { createAjdoc(); @@ -574,7 +575,7 @@ public class Ajctest extends Task implements PropertyChangeListener { } } //end-testset-methods - + public void resolve() throws BuildException { if (dir != null) this.setDir(dir); File src = getDir(project); @@ -589,7 +590,7 @@ public class Ajctest extends Task implements PropertyChangeListener { String[] filenames = getDirectoryScanner(project).getIncludedFiles(); for (int j = 0; j < filenames.length; j++) { - String name = filenames[j]; + String name = filenames[j]; if (name.endsWith(".java")) { File file = new File(src, name); if (check(file, name, location)) files.add(file); @@ -638,25 +639,25 @@ public class Ajctest extends Task implements PropertyChangeListener { StringTokenizer tok = new StringTokenizer(str, ",", false); while (tok.hasMoreTokens()) { String name = tok.nextToken().trim(); - parse(name.startsWith("J") ? createJarg() : createArg(), name); + parse(name.startsWith("J") ? createJarg() : createArg(), name); } } - + public Argument createJarg() { Argument arg = new Argument(true); args.add(arg); return arg; } - + public Argument createArg() { Argument arg = new Argument(false); args.add(arg); return arg; - } + } } private void prepare() throws BuildException { - + } private void finish() throws BuildException { @@ -664,7 +665,7 @@ public class Ajctest extends Task implements PropertyChangeListener { log(""); log("There " + w(errors) + " " + errors.size() + " errors:"); for (int i = 0; i < errors.size(); i++) { - log(" ", (Failure)errors.get(i), i); + log(" ", errors.get(i), i); } } allErrors.addAll(errors); @@ -680,13 +681,13 @@ public class Ajctest extends Task implements PropertyChangeListener { log(space + "msgs:" + failure.msgs); } - + private String enough(String str, int size, char filler) { while (str.length() < size) str += filler; return str; } - + private void log(String space, List<?> list, String title) { if (list == null || list.size() < 1) return; log(space + title); @@ -762,9 +763,9 @@ public class Ajctest extends Task implements PropertyChangeListener { } else { throw new Error("unknown compiler: " + compiler); } - + System.out.println("using compiler: " + ajc); - try { + try { if ((exit = ajc.run()) != 0) { post(testset, args, ajc.msgs, exit, "ajc"); goodCompile = false; @@ -782,7 +783,7 @@ public class Ajctest extends Task implements PropertyChangeListener { "couldn't run classes " + testset.testclasses + "due to failed compile", -1, "run"); - + } else if (!isSet("norun")) { for (Iterator<Run> i = testset.testclasses.iterator(); i.hasNext();) { Run testclass = i.next(); @@ -833,7 +834,7 @@ public class Ajctest extends Task implements PropertyChangeListener { execute(testset, args); } } - + // for (Iterator iter = testsets.iterator(); iter.hasNext(); _++) { // Testset testset = (Testset)iter.next(); // testset.resolve(); @@ -850,7 +851,7 @@ public class Ajctest extends Task implements PropertyChangeListener { // execute(testset, args); // log(""); // } -// } +// } finish(); } @@ -886,20 +887,20 @@ public class Ajctest extends Task implements PropertyChangeListener { return true; } - /** + /** * Interpose Wrapper class to catch and report exceptions * by setting a positive value for System.exit(). * (In some cases it seems that Exceptions are not being reported * as errors in the tests.) * This forces the VM to fork. A forked VM is required for * two reasons: - * (1) The wrapper class may have been defined by a different + * (1) The wrapper class may have been defined by a different * class loader than the target class, so it would not be able * to load the target class; * <p> * (2) Since the wrapper class is generic, we have to pass in * the name of the target class. I choose to do this using - * VM properties rather than hacking up the arguments. + * VM properties rather than hacking up the arguments. * <p>todo: relies on name/value of property "taskdef.jar" * to add jar with wrapper to invoking classpath. * <p> @@ -916,7 +917,7 @@ public class Ajctest extends Task implements PropertyChangeListener { public final String PROP_NAME = "MainWrapper.classname"; /** tracked in MainWrapper.CLASSDIR_NAME */ public final String CLASSDIR_NAME = "MainWrapper.classdir"; - public final String WRAPPER_CLASS + public final String WRAPPER_CLASS = "org.aspectj.internal.tools.ant.taskdefs.MainWrapper"; private String classname; protected String classesDir; @@ -951,7 +952,7 @@ public class Ajctest extends Task implements PropertyChangeListener { RunWrapper.this.createClasspath().append(wrapperPath); } } - + /** do setup, then super.execute() */ public int executeJava() { setup(); @@ -967,7 +968,7 @@ public class Ajctest extends Task implements PropertyChangeListener { } public class Run extends RunWrapper { - //public class Run extends Java + //public class Run extends Java private Path bootclasspath; public void setBootbootclasspath(Path path) { if (bootclasspath == null) { @@ -1123,19 +1124,19 @@ public class Ajctest extends Task implements PropertyChangeListener { str += secs + " second" + (secs != 1 ? "s" : "") + " "; return str; } - + public void run() { Ajctest current = CURRENT_AJCTEST; String oneLine = "warning: oneLine not set."; String multiLine = "warning: multiLine not set."; - + // setup oneLine if (null == current) { oneLine = "\nRESULT=\"ERROR\" null ACJTEST"; } else { StringBuffer sb = new StringBuffer("\n"); int errs = Ajctest.allErrors.size(); - int allFails = errs + int allFails = errs + current.ajdocStats.fails + current.ajcStats.fails + current.runStats.fails; @@ -1181,7 +1182,7 @@ public class Ajctest extends Task implements PropertyChangeListener { str += "Total time : " + ms(startTime, stopTime) + "\n"; str += "------------------------------" + - " Summary " + + " Summary " + "------------------------------" + "\n"; str += "Task\tPassed\tFailed" + "\n"; Object[] os = new Object[] { @@ -1194,7 +1195,7 @@ public class Ajctest extends Task implements PropertyChangeListener { } if (allErrors.size() > 0) { str += "" + "\n"; - str += + str += "There " + w(allErrors) + " " + allErrors.size() + " error" + s(allErrors) + ":" + "\n"; @@ -1210,7 +1211,7 @@ public class Ajctest extends Task implements PropertyChangeListener { str += "No errors." + "\n"; } str += "--------------------------" + - " End of Summary " + + " End of Summary " + "---------------------------" + "\n"; multiLine = str; } @@ -1251,7 +1252,7 @@ public class Ajctest extends Task implements PropertyChangeListener { private static String a(List list, String some, String one) { return list == null || list.size() != 1 ? some : one; } - + static class Failure { public final Testset testset; public final List args; @@ -1276,7 +1277,7 @@ public class Ajctest extends Task implements PropertyChangeListener { str += "type:" + type + "\n"; str += testset + "\n"; if (args.size() > 0) { - str += " args: " + args + "\n";; + str += " args: " + args + "\n"; } str += " msgs:" + msgs + "\n"; str += " exit:" + exit; @@ -1378,7 +1379,7 @@ public class Ajctest extends Task implements PropertyChangeListener { public AjcWrapper(Testset testset, List args) { super(testset, args, false); if (testset.noclean) { - setExtraclasspath(new Path(project, + setExtraclasspath(new Path(project, destdir.getAbsolutePath())); } } @@ -1391,7 +1392,7 @@ public class Ajctest extends Task implements PropertyChangeListener { public EAjcWrapper(Testset testset, List args) { super(testset, args, false); if (testset.noclean) { - setExtraclasspath(new Path(project, + setExtraclasspath(new Path(project, destdir.getAbsolutePath())); } } @@ -1445,7 +1446,7 @@ public class Ajctest extends Task implements PropertyChangeListener { protected List args; protected boolean needsClasspath; protected Path extraClasspath; - + public JavaCommandWrapper(Testset testset, List args, boolean needsClasspath) { this.testset = testset; @@ -1456,12 +1457,12 @@ public class Ajctest extends Task implements PropertyChangeListener { public void setExtraclasspath(Path extraClasspath) { this.extraClasspath = extraClasspath; } - + public String toString() { - return LangUtil.unqualifiedClassName(getClass()) + return LangUtil.unqualifiedClassName(getClass()) + "(" + getMainClassName() + ")"; } - + protected Commandline createCommandline() { Commandline cmd = new Commandline(); cmd.setExecutable("java"); @@ -1471,7 +1472,7 @@ public class Ajctest extends Task implements PropertyChangeListener { cp = extraClasspath; } if (extraClasspath == null) { - Path aspectjBuildDir = + Path aspectjBuildDir = new Path(project, project.getProperty("ajctest.pathelement")); // todo: dependency on ant script variable name ajctest.pathelement @@ -1611,7 +1612,7 @@ public class Ajctest extends Task implements PropertyChangeListener { // } // exec.execute(); // } -// +// public void handle(Throwable t) { log("handling " + t); if (t != null) t.printStackTrace(); @@ -1692,7 +1693,7 @@ public class Ajctest extends Task implements PropertyChangeListener { status.runs.fails.inc(); } } - + private abstract static class TitledPanel extends JPanel { public TitledPanel(LayoutManager layout, String title) { super(layout); @@ -1753,7 +1754,7 @@ public class Ajctest extends Task implements PropertyChangeListener { } } } - + private class TablePanel extends TitledPanel { private DefaultTableModel model = new DefaultTableModel(); private TJable table; diff --git a/testing/src/test/java/org/aspectj/testing/AutowiredXMLBasedAjcTestCase.java b/testing/src/test/java/org/aspectj/testing/AutowiredXMLBasedAjcTestCase.java index 0fbbd125e..59974f1b1 100644 --- a/testing/src/test/java/org/aspectj/testing/AutowiredXMLBasedAjcTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/AutowiredXMLBasedAjcTestCase.java @@ -10,21 +10,20 @@ *******************************************************************************/ package org.aspectj.testing; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; -import junit.extensions.TestSetup; - +import java.io.InputStreamReader; import java.lang.reflect.Method; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.HashMap; -import java.io.InputStreamReader; -import java.io.FileInputStream; import org.apache.commons.digester.Digester; import org.aspectj.tools.ajc.Ajc; +import junit.extensions.TestSetup; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + /** * Autowiring of XML test spec file as JUnit tests. * <p/> diff --git a/testing/src/test/java/org/aspectj/testing/TestingModuleTests.java b/testing/src/test/java/org/aspectj/testing/TestingModuleTests.java index 81ff4e1b4..327be6bd4 100644 --- a/testing/src/test/java/org/aspectj/testing/TestingModuleTests.java +++ b/testing/src/test/java/org/aspectj/testing/TestingModuleTests.java @@ -12,11 +12,26 @@ * ******************************************************************/ package org.aspectj.testing; -import org.aspectj.testing.harness.bridge.*; -import org.aspectj.testing.taskdefs.*; -import org.aspectj.testing.util.*; -import org.aspectj.testing.util.options.*; -import org.aspectj.testing.xml.*; +import org.aspectj.testing.harness.bridge.AbstractRunSpecTest; +import org.aspectj.testing.harness.bridge.AjcSpecTest; +import org.aspectj.testing.harness.bridge.CompilerRunSpecTest; +import org.aspectj.testing.harness.bridge.CompilerRunTest; +import org.aspectj.testing.harness.bridge.DirChangesTest; +import org.aspectj.testing.harness.bridge.ParseTestCase; +import org.aspectj.testing.taskdefs.AjcTaskCompileCommandTest; +import org.aspectj.testing.util.BridgeUtilTest; +import org.aspectj.testing.util.FileUtilTest; +import org.aspectj.testing.util.IteratorWrapperTest; +import org.aspectj.testing.util.LangUtilTest; +import org.aspectj.testing.util.MessageUtilTest; +import org.aspectj.testing.util.StreamGrabberTest; +import org.aspectj.testing.util.StructureModelUtilTest; +import org.aspectj.testing.util.TestDiffsTest; +import org.aspectj.testing.util.options.OptionsTest; +import org.aspectj.testing.util.options.ValuesTest; +import org.aspectj.testing.xml.AjcSpecXmlReaderTest; +import org.aspectj.testing.xml.MessageListXmlReaderTest; +import org.aspectj.testing.xml.XMLWriterTest; import junit.framework.Test; import junit.framework.TestCase; diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java index 94d31833a..f8d12e80e 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -39,11 +39,11 @@ import org.aspectj.tools.ajc.AjcTestCase; import org.aspectj.tools.ajc.CompilationResult; import org.aspectj.util.FileUtil; import org.aspectj.weaver.AjAttribute; +import org.aspectj.weaver.AjAttribute.WeaverState; +import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.WeaverStateInfo; -import org.aspectj.weaver.AjAttribute.WeaverState; -import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.bcel.BcelConstantPoolReader; import junit.extensions.TestSetup; diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpecTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpecTest.java index 1f6ab38ab..3ed472c5e 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpecTest.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpecTest.java @@ -16,11 +16,11 @@ package org.aspectj.testing.harness.bridge; import java.io.PrintWriter; import java.util.List; -import junit.framework.TestCase; - import org.aspectj.testing.run.IRunIterator; import org.aspectj.testing.xml.XMLWriter; +import junit.framework.TestCase; + /** * */ diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcMessageHandler.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcMessageHandler.java index f4a88c3b2..b2060480c 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcMessageHandler.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcMessageHandler.java @@ -13,7 +13,7 @@ package org.aspectj.testing.harness.bridge; -import java.util.*; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java index 0c469ec3a..36ade5f2a 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java @@ -13,21 +13,21 @@ package org.aspectj.testing.harness.bridge; -import java.util.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.ListIterator; -import junit.framework.Assert; -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; - -import org.aspectj.bridge.*; import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.MessageUtil; +import junit.framework.Assert; +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; + /** * Primarily used by others to test AjcTest */ diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java index bdebae02c..629b0a0a3 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java @@ -13,13 +13,19 @@ package org.aspectj.testing.harness.bridge; -import java.io.*; +import java.io.BufferedReader; import java.io.File; -import java.util.*; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; //import org.aspectj.bridge.*; import org.aspectj.bridge.IMessageHandler; diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java index 8d6c587fe..c5d4b0b60 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java @@ -14,18 +14,40 @@ package org.aspectj.testing.harness.bridge; -import java.io.*; +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintStream; import java.lang.reflect.Array; -import java.util.*; - -import org.aspectj.bridge.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.aspectj.bridge.ICommand; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessageHandler; +import org.aspectj.bridge.MessageHandler; +import org.aspectj.bridge.MessageUtil; +import org.aspectj.bridge.ReflectionFactory; import org.aspectj.testing.ajde.CompileCommand; -import org.aspectj.testing.run.*; +import org.aspectj.testing.run.IRunIterator; +import org.aspectj.testing.run.IRunStatus; +import org.aspectj.testing.run.WrappedRunIterator; import org.aspectj.testing.taskdefs.AjcTaskCompileCommand; -import org.aspectj.testing.util.options.*; -import org.aspectj.testing.util.options.Option.*; -import org.aspectj.testing.xml.*; -import org.aspectj.util.*; +import org.aspectj.testing.util.options.Option; +import org.aspectj.testing.util.options.Option.Family; +import org.aspectj.testing.util.options.Option.InvalidInputException; +import org.aspectj.testing.util.options.Options; +import org.aspectj.testing.util.options.Values; +import org.aspectj.testing.xml.SoftMessage; +import org.aspectj.testing.xml.XMLWriter; +import org.aspectj.util.FileUtil; +import org.aspectj.util.LangUtil; /** * Run the compiler once. diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunSpecTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunSpecTest.java index 83e14cf10..1a8873072 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunSpecTest.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunSpecTest.java @@ -14,18 +14,20 @@ package org.aspectj.testing.harness.bridge; -import java.util.*; import java.util.Arrays; - -import junit.framework.TestCase; +import java.util.Iterator; +import java.util.Set; import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; import org.aspectj.testing.harness.bridge.CompilerRun.Spec.CRSOptions; -import org.aspectj.testing.util.options.*; +import org.aspectj.testing.util.options.Option; +import org.aspectj.testing.util.options.OptionChecker; import org.aspectj.testing.util.options.Options; import org.aspectj.util.LangUtil; +import junit.framework.TestCase; + /** * */ diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunTest.java index ddfaee1f4..c5f68d03a 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunTest.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRunTest.java @@ -13,15 +13,21 @@ package org.aspectj.testing.harness.bridge; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; -import junit.framework.TestCase; - -import org.aspectj.bridge.*; -import org.aspectj.testing.run.*; -import org.aspectj.util.*; +import org.aspectj.bridge.ICommand; +import org.aspectj.bridge.IMessageHandler; +import org.aspectj.bridge.IMessageHolder; +import org.aspectj.bridge.MessageHandler; +import org.aspectj.testing.run.IRunIterator; +import org.aspectj.testing.run.RunStatus; +import org.aspectj.testing.run.Runner; +import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; +import junit.framework.TestCase; + /** * Use a stub compiler/ICommand to verify command-line passed * to the compiler by the harness. diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChangesTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChangesTest.java index 3ee0fd041..dc3ccec07 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChangesTest.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChangesTest.java @@ -18,9 +18,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; - import org.aspectj.bridge.IMessage; import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; @@ -28,6 +25,9 @@ import org.aspectj.testing.xml.MessageListXmlReader; import org.aspectj.testing.xml.XMLWriter; import org.aspectj.util.LangUtil; +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; + /** * (broken) tests for unutilized feature to read in * expected directory changes as messages. diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java index 8d75d5620..b3249feeb 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java @@ -21,11 +21,11 @@ import java.util.List; import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessage.Kind; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.SourceLocation; -import org.aspectj.bridge.IMessage.Kind; import org.aspectj.testing.util.BridgeUtil; import org.aspectj.testing.util.ObjectChecker; import org.aspectj.testing.util.SFileReader; diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java index 7c7f2c54e..ac707a183 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.aspectj.bridge.AbortException; import org.aspectj.bridge.ICommand; import org.aspectj.bridge.MessageUtil; import org.aspectj.testing.ajde.CompileCommand; @@ -29,8 +28,6 @@ import org.aspectj.testing.run.IRunStatus; import org.aspectj.testing.run.WrappedRunIterator; import org.aspectj.testing.util.StructureModelUtil; import org.aspectj.testing.util.StructureModelUtil.ModelIncorrectException; -import org.aspectj.testing.xml.AjcSpecXmlReader; -import org.aspectj.testing.xml.IXmlWritable; import org.aspectj.testing.xml.SoftMessage; import org.aspectj.testing.xml.XMLWriter; import org.aspectj.util.FileUtil; diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java index aade35f48..c7e282040 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java @@ -12,6 +12,18 @@ package org.aspectj.testing.harness.bridge; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileDescriptor; +import java.io.PrintStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.InetAddress; +import java.net.URL; +import java.security.Permission; +import java.util.ArrayList; +import java.util.Arrays; + import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.MessageUtil; @@ -27,12 +39,6 @@ import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; import org.aspectj.weaver.loadtime.WeavingURLClassLoader; -import java.io.*; -import java.lang.reflect.*; -import java.net.*; -import java.security.Permission; -import java.util.*; - /** * Run a class in this VM using reflection. * Forked mode supported, but through system properties: diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java index cfbc6b0e1..c891f134c 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java @@ -22,8 +22,6 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import junit.framework.TestCase; - import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.ISourceLocation; @@ -40,6 +38,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import junit.framework.TestCase; + public class ParseTestCase extends TestCase { public ParseTestCase(String name) { diff --git a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommand.java b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommand.java index 1f5325e82..09798850c 100644 --- a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommand.java +++ b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommand.java @@ -13,17 +13,23 @@ package org.aspectj.testing.taskdefs; //import java.awt.Frame; -import java.io.*; +import java.io.File; +import java.io.IOException; //import java.lang.reflect.*; -import java.util.*; //import java.util.List; +import java.util.ArrayList; -import org.apache.tools.ant.*; +import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; -import org.aspectj.bridge.*; +import org.aspectj.bridge.ICommand; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessageHandler; +import org.aspectj.bridge.IMessageHolder; +import org.aspectj.bridge.MessageHandler; +import org.aspectj.bridge.MessageUtil; import org.aspectj.tools.ant.taskdefs.AjcTask; -import org.aspectj.util.*; import org.aspectj.util.FileUtil; +import org.aspectj.util.LangUtil; /** * Drive tests using the Ant taskdef. 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 253184c8d..869cb3c4c 100644 --- a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java +++ b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java @@ -14,12 +14,12 @@ package org.aspectj.testing.taskdefs; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; -import org.aspectj.bridge.*; +import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.MessageHandler; +import org.aspectj.bridge.MessageUtil; import org.aspectj.testing.harness.bridge.Globals; -import org.aspectj.util.*; +import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; import junit.framework.TestCase; diff --git a/testing/src/test/java/org/aspectj/testing/util/BridgeUtilTest.java b/testing/src/test/java/org/aspectj/testing/util/BridgeUtilTest.java index a0299889b..83a8b96a3 100644 --- a/testing/src/test/java/org/aspectj/testing/util/BridgeUtilTest.java +++ b/testing/src/test/java/org/aspectj/testing/util/BridgeUtilTest.java @@ -13,14 +13,14 @@ package org.aspectj.testing.util; -import junit.framework.TestCase; - import org.aspectj.bridge.MessageHandler; import org.aspectj.testing.run.IRun; import org.aspectj.testing.run.IRunStatus; import org.aspectj.testing.run.RunStatus; import org.aspectj.testing.run.Runner; +import junit.framework.TestCase; + /** * */ diff --git a/testing/src/test/java/org/aspectj/testing/util/Diffs.java b/testing/src/test/java/org/aspectj/testing/util/Diffs.java index eb09f9700..dd54fa4da 100644 --- a/testing/src/test/java/org/aspectj/testing/util/Diffs.java +++ b/testing/src/test/java/org/aspectj/testing/util/Diffs.java @@ -14,12 +14,13 @@ package org.aspectj.testing.util; import java.io.File; -import java.util.*; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; +import java.util.ListIterator; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; diff --git a/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java b/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java index 0e81b24d3..3317f7746 100644 --- a/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java +++ b/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java @@ -12,16 +12,30 @@ package org.aspectj.testing.util; -import java.io.*; -import java.net.*; -import java.util.*; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PrintStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; import javax.swing.text.MutableAttributeSet; -import javax.swing.text.html.*; +import javax.swing.text.html.HTML; import javax.swing.text.html.HTML.Tag; +import javax.swing.text.html.HTMLEditorKit; -import org.aspectj.bridge.*; +import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; +import org.aspectj.bridge.MessageHandler; +import org.aspectj.bridge.MessageUtil; import org.aspectj.util.LangUtil; //import org.aspectj.util.FileUtil; diff --git a/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java b/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java index 51ec73efd..571633a0c 100644 --- a/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java +++ b/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java @@ -22,8 +22,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import junit.framework.TestCase; - import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; @@ -31,6 +29,8 @@ import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.SourceLocation; +import junit.framework.TestCase; + /** * */ diff --git a/testing/src/test/java/org/aspectj/testing/util/StructureModelUtilTest.java b/testing/src/test/java/org/aspectj/testing/util/StructureModelUtilTest.java index 366727b80..11b9ea2b4 100644 --- a/testing/src/test/java/org/aspectj/testing/util/StructureModelUtilTest.java +++ b/testing/src/test/java/org/aspectj/testing/util/StructureModelUtilTest.java @@ -16,12 +16,12 @@ package org.aspectj.testing.util; import java.io.File; import java.util.List; -import junit.framework.TestSuite; - import org.aspectj.ajde.core.AjdeCoreTestCase; import org.aspectj.ajde.core.TestCompilerConfiguration; import org.aspectj.asm.IProgramElement; +import junit.framework.TestSuite; + /** * @author Mik Kersten */ diff --git a/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java b/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java index af13aed03..17fa8234d 100644 --- a/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java +++ b/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java @@ -20,10 +20,10 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.ListIterator; -import junit.framework.TestCase; - import org.aspectj.util.FileUtil; +import junit.framework.TestCase; + /** * */ diff --git a/testing/src/test/java/org/aspectj/testing/util/UtilLineReader.java b/testing/src/test/java/org/aspectj/testing/util/UtilLineReader.java index ebb6c9d98..f077eba52 100644 --- a/testing/src/test/java/org/aspectj/testing/util/UtilLineReader.java +++ b/testing/src/test/java/org/aspectj/testing/util/UtilLineReader.java @@ -14,7 +14,10 @@ package org.aspectj.testing.util; -import java.io.*; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.LineNumberReader; import java.util.ArrayList; /** diff --git a/testing/src/test/java/org/aspectj/testing/util/options/Option.java b/testing/src/test/java/org/aspectj/testing/util/options/Option.java index e845a89bf..f8ea3d9c4 100644 --- a/testing/src/test/java/org/aspectj/testing/util/options/Option.java +++ b/testing/src/test/java/org/aspectj/testing/util/options/Option.java @@ -12,7 +12,14 @@ package org.aspectj.testing.util.options; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.TreeMap; import org.aspectj.util.LangUtil; diff --git a/testing/src/test/java/org/aspectj/testing/util/options/OptionChecker.java b/testing/src/test/java/org/aspectj/testing/util/options/OptionChecker.java index a8b3b2c5a..87748f0b1 100644 --- a/testing/src/test/java/org/aspectj/testing/util/options/OptionChecker.java +++ b/testing/src/test/java/org/aspectj/testing/util/options/OptionChecker.java @@ -14,10 +14,10 @@ package org.aspectj.testing.util.options; import java.util.Arrays; -import junit.framework.Assert; - import org.aspectj.testing.util.LangUtil; +import junit.framework.Assert; + /** * Drivers to test a given set of Options. * They now throw AssertionFailedError on failure, diff --git a/testing/src/test/java/org/aspectj/testing/util/options/Options.java b/testing/src/test/java/org/aspectj/testing/util/options/Options.java index 04a968d88..f3e52767f 100644 --- a/testing/src/test/java/org/aspectj/testing/util/options/Options.java +++ b/testing/src/test/java/org/aspectj/testing/util/options/Options.java @@ -12,7 +12,8 @@ package org.aspectj.testing.util.options; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; import org.aspectj.util.LangUtil; diff --git a/testing/src/test/java/org/aspectj/testing/util/options/OptionsTest.java b/testing/src/test/java/org/aspectj/testing/util/options/OptionsTest.java index 4d8efdf2e..bd7d98613 100644 --- a/testing/src/test/java/org/aspectj/testing/util/options/OptionsTest.java +++ b/testing/src/test/java/org/aspectj/testing/util/options/OptionsTest.java @@ -12,10 +12,11 @@ package org.aspectj.testing.util.options; -import junit.framework.*; - import org.aspectj.testing.util.options.Option.InvalidInputException; +import junit.framework.Assert; +import junit.framework.TestCase; + /** */ public class OptionsTest extends TestCase { diff --git a/testing/src/test/java/org/aspectj/testing/util/options/Values.java b/testing/src/test/java/org/aspectj/testing/util/options/Values.java index 574969080..d21f03165 100644 --- a/testing/src/test/java/org/aspectj/testing/util/options/Values.java +++ b/testing/src/test/java/org/aspectj/testing/util/options/Values.java @@ -12,7 +12,12 @@ package org.aspectj.testing.util.options; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; import org.aspectj.testing.util.options.Option.Value; import org.aspectj.util.LangUtil; 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 370a9ac91..62e3fd186 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReader.java +++ b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReader.java @@ -15,8 +15,13 @@ package org.aspectj.testing.xml; -import java.io.*; //import java.util.Vector; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; import org.apache.commons.digester.Digester; import org.aspectj.bridge.AbortException; @@ -24,10 +29,17 @@ import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.SourceLocation; -import org.aspectj.testing.harness.bridge.*; +import org.aspectj.testing.harness.bridge.AjcTest; +import org.aspectj.testing.harness.bridge.CompilerRun; +import org.aspectj.testing.harness.bridge.DirChanges; +import org.aspectj.testing.harness.bridge.IncCompilerRun; +import org.aspectj.testing.harness.bridge.JavaRun; +import org.aspectj.testing.harness.bridge.Sandbox; +import org.aspectj.testing.harness.bridge.Validator; import org.aspectj.testing.util.RunUtils; import org.aspectj.util.LangUtil; -import org.xml.sax.*; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; import org.xml.sax.SAXException; /** diff --git a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java index 81842dc30..397e8ccfa 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java +++ b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java @@ -22,14 +22,14 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; -//import junit.framework.*; -import junit.framework.TestCase; - import org.aspectj.testing.harness.bridge.AjcSpecTest; import org.aspectj.testing.harness.bridge.AjcTest; import org.aspectj.testing.harness.bridge.FlatSuiteReader; import org.aspectj.util.LangUtil; +//import junit.framework.*; +import junit.framework.TestCase; + /** * */ diff --git a/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java b/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java index aa393f5de..6d0eeffff 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java +++ b/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java @@ -13,13 +13,13 @@ package org.aspectj.testing.xml; -import org.aspectj.bridge.IMessage; -import org.aspectj.util.LangUtil; - import java.io.File; import java.util.ArrayList; import java.util.Iterator; +import org.aspectj.bridge.IMessage; +import org.aspectj.util.LangUtil; + import junit.framework.TestCase; /** diff --git a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java index f59bf397e..9a39d0cc8 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java +++ b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java @@ -19,8 +19,8 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.aspectj.bridge.*; import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.SourceLocation; |