* + "}</head>\n"; | * + "}</head>\n"; | ||||
*/ | */ | ||||
public static String applyProperties(String text, Map map) { | |||||
public static String applyProperties(String text, Map<String,String> map) { | |||||
// ${name} -> map.get(name).toString() | // ${name} -> map.get(name).toString() | ||||
int lastIndex = 0; | int lastIndex = 0; | ||||
StringBuffer buf = new StringBuffer(); | StringBuffer buf = new StringBuffer(); |
} | } | ||||
} | } | ||||
// libraries | // libraries | ||||
for (Iterator iter = result.getLibJars().iterator(); iter.hasNext();) { | |||||
file = (File) iter.next(); | |||||
for (Iterator<File> iter = result.getLibJars().iterator(); iter.hasNext();) { | |||||
file = iter.next(); | |||||
if (outOfDate(time, file)) { | if (outOfDate(time, file)) { | ||||
return true; | return true; | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2005 Contributors. | * 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 v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Wes Isberg initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.internal.tools.build; | package org.aspectj.internal.tools.build; | ||||
import java.io.File; | import java.io.File; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.HashMap; | import java.util.HashMap; | ||||
import java.util.Iterator; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.ListIterator; | import java.util.ListIterator; | ||||
if (null == name) { | if (null == name) { | ||||
throw new IllegalArgumentException("null name"); | throw new IllegalArgumentException("null name"); | ||||
} | } | ||||
return (Result) nameToResult.get(name); | |||||
return nameToResult.get(name); | |||||
} | } | ||||
public static Result[] getResults(String[] names) { | public static Result[] getResults(String[] names) { | ||||
if (null == list) { | if (null == list) { | ||||
return new Result[0]; | return new Result[0]; | ||||
} | } | ||||
return (Result[]) list.toArray(new Result[0]); | |||||
return list.toArray(new Result[0]); | |||||
} | } | ||||
private void initSrcDirs() { | private void initSrcDirs() { |
StringBuffer sampleCode = new StringBuffer(); | StringBuffer sampleCode = new StringBuffer(); | ||||
String anchorName = null; | String anchorName = null; | ||||
String anchorTitle = null; | String anchorTitle = null; | ||||
ArrayList flags = new ArrayList(); | |||||
ArrayList<String> flags = new ArrayList<>(); | |||||
int startLine = -1; // seeking | int startLine = -1; // seeking | ||||
int endLine = Integer.MAX_VALUE; // not seeking | int endLine = Integer.MAX_VALUE; // not seeking | ||||
reader = new FileReader(source); | reader = new FileReader(source); | ||||
source, | source, | ||||
startLine, | startLine, | ||||
endLine, | endLine, | ||||
(String[]) flags.toArray(new String[flags.size()])); | |||||
flags.toArray(new String[flags.size()])); | |||||
sink.addSample(sample); | sink.addSample(sample); | ||||
// back to seeking start | // back to seeking start | ||||
final int endLine; | final int endLine; | ||||
final Kind kind; | final Kind kind; | ||||
/** List of String flags found in the sample */ | /** List of String flags found in the sample */ | ||||
final List flags; | |||||
final List<String> flags; | |||||
public Sample( | public Sample( | ||||
String anchorName, | String anchorName, | ||||
String anchorTitle, | String anchorTitle, | ||||
this.kind = Kind.getKind(sourcePath); | this.kind = Kind.getKind(sourcePath); | ||||
// List theFlags; | // List theFlags; | ||||
if ((null == flags) || (0 == flags.length)) { | if ((null == flags) || (0 == flags.length)) { | ||||
this.flags = Collections.EMPTY_LIST; | |||||
this.flags = Collections.emptyList(); | |||||
} else { | } else { | ||||
this.flags = Collections.unmodifiableList(Arrays.asList(flags)); | this.flags = Collections.unmodifiableList(Arrays.asList(flags)); | ||||
} | } | ||||
protected void renderAuthorIndex(Samples samples, StringBuffer sink) { | protected void renderAuthorIndex(Samples samples, StringBuffer sink) { | ||||
sink.append("<h2><a name=\"authorIndex\"></a>Author Index</h2>"); | sink.append("<h2><a name=\"authorIndex\"></a>Author Index</h2>"); | ||||
List list = samples.getSortedSamples(Sample.AUTHOR_NAME_SOURCE_COMPARER); | |||||
List<Sample> list = samples.getSortedSamples(Sample.AUTHOR_NAME_SOURCE_COMPARER); | |||||
String lastAuthor = null; | String lastAuthor = null; | ||||
for (ListIterator iter = list.listIterator(); iter.hasNext();) { | |||||
Sample sample = (Sample)iter.next(); | |||||
for (ListIterator<Sample> iter = list.listIterator(); iter.hasNext();) { | |||||
Sample sample = iter.next(); | |||||
String author = sample.author; | String author = sample.author; | ||||
if (!author.equals(lastAuthor)) { | if (!author.equals(lastAuthor)) { | ||||
if (null != lastAuthor) { | if (null != lastAuthor) { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 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 | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
import org.apache.tools.ant.types.Reference; | import org.apache.tools.ant.types.Reference; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
@SuppressWarnings("deprecation") | |||||
public class Ajctest extends Task implements PropertyChangeListener { | public class Ajctest extends Task implements PropertyChangeListener { | ||||
private static Ajctest CURRENT_AJCTEST; | private static Ajctest CURRENT_AJCTEST; | ||||
// todo shutdown hook assumes one task per VM | |||||
// todo shutdown hook assumes one task per VM | |||||
public Ajctest() { | public Ajctest() { | ||||
super(); | super(); | ||||
CURRENT_AJCTEST = this; | CURRENT_AJCTEST = this; | ||||
private void fire(String prop) { | private void fire(String prop) { | ||||
fire(prop, "dummy-old", "dummy-new"); | fire(prop, "dummy-old", "dummy-new"); | ||||
} | } | ||||
private static boolean dumpresults = false; | private static boolean dumpresults = false; | ||||
private Stats ajdocStats = new Stats(); | private Stats ajdocStats = new Stats(); | ||||
private Stats ajcStats = new Stats(); | private Stats ajcStats = new Stats(); | ||||
private Stats runStats = new Stats(); | private Stats runStats = new Stats(); | ||||
// private Stats errorStats = 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 | private File workingdir = new File("ajworkingdir"); //XXX | ||||
//fields | //fields | ||||
public Argfile createArgfile() { | public Argfile createArgfile() { | ||||
return createTestset().createArgfile(); | return createTestset().createArgfile(); | ||||
} | } | ||||
public void setNoverify(boolean input) { | public void setNoverify(boolean input) { | ||||
if (input != noverify) noverify = input; | if (input != noverify) noverify = input; | ||||
} | } | ||||
//setTestId(target.getName()); | //setTestId(target.getName()); | ||||
} | } | ||||
} | } | ||||
public void setTestId(String str) { | public void setTestId(String str) { | ||||
if ((null != str) && (0 < str.trim().length())) { | if ((null != str) && (0 < str.trim().length())) { | ||||
testId = str; | testId = str; | ||||
} | } | ||||
} | } | ||||
public void setArgs(String str) { | public void setArgs(String str) { | ||||
if (str == null || str.length() < 1) return; | if (str == null || str.length() < 1) return; | ||||
StringTokenizer tok = new StringTokenizer(str, ",", false); | StringTokenizer tok = new StringTokenizer(str, ",", false); | ||||
return arg; | return arg; | ||||
} | } | ||||
public Argument createArg() { | public Argument createArg() { | ||||
Argument arg = new Argument(false); | Argument arg = new Argument(false); | ||||
args.add(arg); | args.add(arg); | ||||
} | } | ||||
public Run createJava() { | public Run createJava() { | ||||
Run testclass = new Run(project); | |||||
Run testclass = new Run(project); | |||||
testclasses.add(testclass); | testclasses.add(testclass); | ||||
return testclass; | return testclass; | ||||
} | } | ||||
ajdoc.createArg().setValue(t.nextToken().trim()); | ajdoc.createArg().setValue(t.nextToken().trim()); | ||||
} | } | ||||
} | } | ||||
public void addAjdoc(Ajdoc ajdoc) { | public void addAjdoc(Ajdoc ajdoc) { | ||||
this.ajdoc = ajdoc; | this.ajdoc = ajdoc; | ||||
} | } | ||||
public Ajdoc createAjdoc() { | public Ajdoc createAjdoc() { | ||||
return ajdoc = new Ajdoc(); | return ajdoc = new Ajdoc(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//end-methods | //end-methods | ||||
public static class Argfile { | public static class Argfile { | ||||
private String name; | private String name; | ||||
public void setName(String name) { this.name = name; } | public void setName(String name) { this.name = name; } | ||||
public void setExcludesfile(File excludesfile) { | public void setExcludesfile(File excludesfile) { | ||||
super.setExcludesfile(excludesfile); | super.setExcludesfile(excludesfile); | ||||
havecludes = true; | havecludes = true; | ||||
} | |||||
} | |||||
public void setArgfile(String name) { | public void setArgfile(String name) { | ||||
createArgfile().setName(name); | createArgfile().setName(name); | ||||
} | } | ||||
public void setArgfiles(String str) { | public void setArgfiles(String str) { | ||||
StringTokenizer tok = new StringTokenizer(str, ", ", false); | StringTokenizer tok = new StringTokenizer(str, ", ", false); | ||||
while (tok.hasMoreTokens()) { | while (tok.hasMoreTokens()) { | ||||
createArgfile().setName(tok.nextToken().trim()); | createArgfile().setName(tok.nextToken().trim()); | ||||
} | } | ||||
} | } | ||||
public Argfile createArgfile() { | public Argfile createArgfile() { | ||||
Argfile argfile = new Argfile(); | Argfile argfile = new Argfile(); | ||||
public void setTestclass(String testclass) { | public void setTestclass(String testclass) { | ||||
createJava().setClassname(testclass); | createJava().setClassname(testclass); | ||||
} | } | ||||
public void setClasses(String str) { | public void setClasses(String str) { | ||||
for (StringTokenizer t = new StringTokenizer(str, ", ", false); | for (StringTokenizer t = new StringTokenizer(str, ", ", false); | ||||
t.hasMoreTokens();) { | t.hasMoreTokens();) { | ||||
classpath.append(path); | classpath.append(path); | ||||
} | } | ||||
} | } | ||||
public Path createClasspath() { | public Path createClasspath() { | ||||
if (classpath == null) { | if (classpath == null) { | ||||
classpath = new Path(project); | classpath = new Path(project); | ||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
public void setClasspathRef(Reference r) { | public void setClasspathRef(Reference r) { | ||||
createClasspath().setRefid(r); | createClasspath().setRefid(r); | ||||
} | } | ||||
internalclasspath.append(path); | internalclasspath.append(path); | ||||
} | } | ||||
} | } | ||||
public Path createInternalclasspath() { | public Path createInternalclasspath() { | ||||
if (internalclasspath == null) { | if (internalclasspath == null) { | ||||
internalclasspath = new Path(project); | internalclasspath = new Path(project); | ||||
} | } | ||||
return internalclasspath.createPath(); | return internalclasspath.createPath(); | ||||
} | } | ||||
public void setInternalclasspathRef(Reference r) { | public void setInternalclasspathRef(Reference r) { | ||||
createInternalclasspath().setRefid(r); | createInternalclasspath().setRefid(r); | ||||
} | } | ||||
public void setAjdoc(boolean b) { | public void setAjdoc(boolean b) { | ||||
if (b && ajdoc == null) { | if (b && ajdoc == null) { | ||||
createAjdoc(); | createAjdoc(); | ||||
} | } | ||||
} | } | ||||
//end-testset-methods | //end-testset-methods | ||||
public void resolve() throws BuildException { | public void resolve() throws BuildException { | ||||
if (dir != null) this.setDir(dir); | if (dir != null) this.setDir(dir); | ||||
File src = getDir(project); | File src = getDir(project); | ||||
String[] filenames = | String[] filenames = | ||||
getDirectoryScanner(project).getIncludedFiles(); | getDirectoryScanner(project).getIncludedFiles(); | ||||
for (int j = 0; j < filenames.length; j++) { | for (int j = 0; j < filenames.length; j++) { | ||||
String name = filenames[j]; | |||||
String name = filenames[j]; | |||||
if (name.endsWith(".java")) { | if (name.endsWith(".java")) { | ||||
File file = new File(src, name); | File file = new File(src, name); | ||||
if (check(file, name, location)) files.add(file); | if (check(file, name, location)) files.add(file); | ||||
StringTokenizer tok = new StringTokenizer(str, ",", false); | StringTokenizer tok = new StringTokenizer(str, ",", false); | ||||
while (tok.hasMoreTokens()) { | while (tok.hasMoreTokens()) { | ||||
String name = tok.nextToken().trim(); | String name = tok.nextToken().trim(); | ||||
parse(name.startsWith("J") ? createJarg() : createArg(), name); | |||||
parse(name.startsWith("J") ? createJarg() : createArg(), name); | |||||
} | } | ||||
} | } | ||||
public Argument createJarg() { | public Argument createJarg() { | ||||
Argument arg = new Argument(true); | Argument arg = new Argument(true); | ||||
args.add(arg); | args.add(arg); | ||||
return arg; | return arg; | ||||
} | } | ||||
public Argument createArg() { | public Argument createArg() { | ||||
Argument arg = new Argument(false); | Argument arg = new Argument(false); | ||||
args.add(arg); | args.add(arg); | ||||
return arg; | return arg; | ||||
} | |||||
} | |||||
} | } | ||||
private void prepare() throws BuildException { | private void prepare() throws BuildException { | ||||
} | } | ||||
private void finish() throws BuildException { | private void finish() throws BuildException { | ||||
log(""); | log(""); | ||||
log("There " + w(errors) + " " + errors.size() + " errors:"); | log("There " + w(errors) + " " + errors.size() + " errors:"); | ||||
for (int i = 0; i < errors.size(); i++) { | for (int i = 0; i < errors.size(); i++) { | ||||
log(" ", (Failure)errors.get(i), i); | |||||
log(" ", errors.get(i), i); | |||||
} | } | ||||
} | } | ||||
allErrors.addAll(errors); | allErrors.addAll(errors); | ||||
log(space + "msgs:" + failure.msgs); | log(space + "msgs:" + failure.msgs); | ||||
} | } | ||||
private String enough(String str, int size, char filler) { | private String enough(String str, int size, char filler) { | ||||
while (str.length() < size) str += filler; | while (str.length() < size) str += filler; | ||||
return str; | return str; | ||||
} | } | ||||
private void log(String space, List<?> list, String title) { | private void log(String space, List<?> list, String title) { | ||||
if (list == null || list.size() < 1) return; | if (list == null || list.size() < 1) return; | ||||
log(space + title); | log(space + title); | ||||
} else { | } else { | ||||
throw new Error("unknown compiler: " + compiler); | throw new Error("unknown compiler: " + compiler); | ||||
} | } | ||||
System.out.println("using compiler: " + ajc); | System.out.println("using compiler: " + ajc); | ||||
try { | |||||
try { | |||||
if ((exit = ajc.run()) != 0) { | if ((exit = ajc.run()) != 0) { | ||||
post(testset, args, ajc.msgs, exit, "ajc"); | post(testset, args, ajc.msgs, exit, "ajc"); | ||||
goodCompile = false; | goodCompile = false; | ||||
"couldn't run classes " + testset.testclasses + | "couldn't run classes " + testset.testclasses + | ||||
"due to failed compile", | "due to failed compile", | ||||
-1, "run"); | -1, "run"); | ||||
} else if (!isSet("norun")) { | } else if (!isSet("norun")) { | ||||
for (Iterator<Run> i = testset.testclasses.iterator(); i.hasNext();) { | for (Iterator<Run> i = testset.testclasses.iterator(); i.hasNext();) { | ||||
Run testclass = i.next(); | Run testclass = i.next(); | ||||
execute(testset, args); | execute(testset, args); | ||||
} | } | ||||
} | } | ||||
// for (Iterator iter = testsets.iterator(); iter.hasNext(); _++) { | // for (Iterator iter = testsets.iterator(); iter.hasNext(); _++) { | ||||
// Testset testset = (Testset)iter.next(); | // Testset testset = (Testset)iter.next(); | ||||
// testset.resolve(); | // testset.resolve(); | ||||
// execute(testset, args); | // execute(testset, args); | ||||
// log(""); | // log(""); | ||||
// } | // } | ||||
// } | |||||
// } | |||||
finish(); | finish(); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
/** | |||||
/** | |||||
* Interpose Wrapper class to catch and report exceptions | * Interpose Wrapper class to catch and report exceptions | ||||
* by setting a positive value for System.exit(). | * by setting a positive value for System.exit(). | ||||
* (In some cases it seems that Exceptions are not being reported | * (In some cases it seems that Exceptions are not being reported | ||||
* as errors in the tests.) | * as errors in the tests.) | ||||
* This forces the VM to fork. A forked VM is required for | * This forces the VM to fork. A forked VM is required for | ||||
* two reasons: | * 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 | * class loader than the target class, so it would not be able | ||||
* to load the target class; | * to load the target class; | ||||
* <p> | * <p> | ||||
* (2) Since the wrapper class is generic, we have to pass in | * (2) Since the wrapper class is generic, we have to pass in | ||||
* the name of the target class. I choose to do this using | * 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" | * <p>todo: relies on name/value of property "taskdef.jar" | ||||
* to add jar with wrapper to invoking classpath. | * to add jar with wrapper to invoking classpath. | ||||
* <p> | * <p> | ||||
public final String PROP_NAME = "MainWrapper.classname"; | public final String PROP_NAME = "MainWrapper.classname"; | ||||
/** tracked in MainWrapper.CLASSDIR_NAME */ | /** tracked in MainWrapper.CLASSDIR_NAME */ | ||||
public final String CLASSDIR_NAME = "MainWrapper.classdir"; | public final String CLASSDIR_NAME = "MainWrapper.classdir"; | ||||
public final String WRAPPER_CLASS | |||||
public final String WRAPPER_CLASS | |||||
= "org.aspectj.internal.tools.ant.taskdefs.MainWrapper"; | = "org.aspectj.internal.tools.ant.taskdefs.MainWrapper"; | ||||
private String classname; | private String classname; | ||||
protected String classesDir; | protected String classesDir; | ||||
RunWrapper.this.createClasspath().append(wrapperPath); | RunWrapper.this.createClasspath().append(wrapperPath); | ||||
} | } | ||||
} | } | ||||
/** do setup, then super.execute() */ | /** do setup, then super.execute() */ | ||||
public int executeJava() { | public int executeJava() { | ||||
setup(); | setup(); | ||||
} | } | ||||
public class Run extends RunWrapper { | public class Run extends RunWrapper { | ||||
//public class Run extends Java | |||||
//public class Run extends Java | |||||
private Path bootclasspath; | private Path bootclasspath; | ||||
public void setBootbootclasspath(Path path) { | public void setBootbootclasspath(Path path) { | ||||
if (bootclasspath == null) { | if (bootclasspath == null) { | ||||
str += secs + " second" + (secs != 1 ? "s" : "") + " "; | str += secs + " second" + (secs != 1 ? "s" : "") + " "; | ||||
return str; | return str; | ||||
} | } | ||||
public void run() { | public void run() { | ||||
Ajctest current = CURRENT_AJCTEST; | Ajctest current = CURRENT_AJCTEST; | ||||
String oneLine = "warning: oneLine not set."; | String oneLine = "warning: oneLine not set."; | ||||
String multiLine = "warning: multiLine not set."; | String multiLine = "warning: multiLine not set."; | ||||
// setup oneLine | // setup oneLine | ||||
if (null == current) { | if (null == current) { | ||||
oneLine = "\nRESULT=\"ERROR\" null ACJTEST"; | oneLine = "\nRESULT=\"ERROR\" null ACJTEST"; | ||||
} else { | } else { | ||||
StringBuffer sb = new StringBuffer("\n"); | StringBuffer sb = new StringBuffer("\n"); | ||||
int errs = Ajctest.allErrors.size(); | int errs = Ajctest.allErrors.size(); | ||||
int allFails = errs | |||||
int allFails = errs | |||||
+ current.ajdocStats.fails | + current.ajdocStats.fails | ||||
+ current.ajcStats.fails | + current.ajcStats.fails | ||||
+ current.runStats.fails; | + current.runStats.fails; | ||||
str += "Total time : " + ms(startTime, stopTime) + "\n"; | str += "Total time : " + ms(startTime, stopTime) + "\n"; | ||||
str += | str += | ||||
"------------------------------" + | "------------------------------" + | ||||
" Summary " + | |||||
" Summary " + | |||||
"------------------------------" + "\n"; | "------------------------------" + "\n"; | ||||
str += "Task\tPassed\tFailed" + "\n"; | str += "Task\tPassed\tFailed" + "\n"; | ||||
Object[] os = new Object[] { | Object[] os = new Object[] { | ||||
} | } | ||||
if (allErrors.size() > 0) { | if (allErrors.size() > 0) { | ||||
str += "" + "\n"; | str += "" + "\n"; | ||||
str += | |||||
str += | |||||
"There " + w(allErrors) + " " + | "There " + w(allErrors) + " " + | ||||
allErrors.size() + " error" + | allErrors.size() + " error" + | ||||
s(allErrors) + ":" + "\n"; | s(allErrors) + ":" + "\n"; | ||||
str += "No errors." + "\n"; | str += "No errors." + "\n"; | ||||
} | } | ||||
str += "--------------------------" + | str += "--------------------------" + | ||||
" End of Summary " + | |||||
" End of Summary " + | |||||
"---------------------------" + "\n"; | "---------------------------" + "\n"; | ||||
multiLine = str; | multiLine = str; | ||||
} | } | ||||
private static String a(List list, String some, String one) { | private static String a(List list, String some, String one) { | ||||
return list == null || list.size() != 1 ? some : one; | return list == null || list.size() != 1 ? some : one; | ||||
} | } | ||||
static class Failure { | static class Failure { | ||||
public final Testset testset; | public final Testset testset; | ||||
public final List args; | public final List args; | ||||
str += "type:" + type + "\n"; | str += "type:" + type + "\n"; | ||||
str += testset + "\n"; | str += testset + "\n"; | ||||
if (args.size() > 0) { | if (args.size() > 0) { | ||||
str += " args: " + args + "\n";; | |||||
str += " args: " + args + "\n"; | |||||
} | } | ||||
str += " msgs:" + msgs + "\n"; | str += " msgs:" + msgs + "\n"; | ||||
str += " exit:" + exit; | str += " exit:" + exit; | ||||
public AjcWrapper(Testset testset, List args) { | public AjcWrapper(Testset testset, List args) { | ||||
super(testset, args, false); | super(testset, args, false); | ||||
if (testset.noclean) { | if (testset.noclean) { | ||||
setExtraclasspath(new Path(project, | |||||
setExtraclasspath(new Path(project, | |||||
destdir.getAbsolutePath())); | destdir.getAbsolutePath())); | ||||
} | } | ||||
} | } | ||||
public EAjcWrapper(Testset testset, List args) { | public EAjcWrapper(Testset testset, List args) { | ||||
super(testset, args, false); | super(testset, args, false); | ||||
if (testset.noclean) { | if (testset.noclean) { | ||||
setExtraclasspath(new Path(project, | |||||
setExtraclasspath(new Path(project, | |||||
destdir.getAbsolutePath())); | destdir.getAbsolutePath())); | ||||
} | } | ||||
} | } | ||||
protected List args; | protected List args; | ||||
protected boolean needsClasspath; | protected boolean needsClasspath; | ||||
protected Path extraClasspath; | protected Path extraClasspath; | ||||
public JavaCommandWrapper(Testset testset, List args, | public JavaCommandWrapper(Testset testset, List args, | ||||
boolean needsClasspath) { | boolean needsClasspath) { | ||||
this.testset = testset; | this.testset = testset; | ||||
public void setExtraclasspath(Path extraClasspath) { | public void setExtraclasspath(Path extraClasspath) { | ||||
this.extraClasspath = extraClasspath; | this.extraClasspath = extraClasspath; | ||||
} | } | ||||
public String toString() { | public String toString() { | ||||
return LangUtil.unqualifiedClassName(getClass()) | |||||
return LangUtil.unqualifiedClassName(getClass()) | |||||
+ "(" + getMainClassName() + ")"; | + "(" + getMainClassName() + ")"; | ||||
} | } | ||||
protected Commandline createCommandline() { | protected Commandline createCommandline() { | ||||
Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
cmd.setExecutable("java"); | cmd.setExecutable("java"); | ||||
cp = extraClasspath; | cp = extraClasspath; | ||||
} | } | ||||
if (extraClasspath == null) { | if (extraClasspath == null) { | ||||
Path aspectjBuildDir = | |||||
Path aspectjBuildDir = | |||||
new Path(project, | new Path(project, | ||||
project.getProperty("ajctest.pathelement")); | project.getProperty("ajctest.pathelement")); | ||||
// todo: dependency on ant script variable name ajctest.pathelement | // todo: dependency on ant script variable name ajctest.pathelement | ||||
// } | // } | ||||
// exec.execute(); | // exec.execute(); | ||||
// } | // } | ||||
// | |||||
// | |||||
public void handle(Throwable t) { | public void handle(Throwable t) { | ||||
log("handling " + t); | log("handling " + t); | ||||
if (t != null) t.printStackTrace(); | if (t != null) t.printStackTrace(); | ||||
status.runs.fails.inc(); | status.runs.fails.inc(); | ||||
} | } | ||||
} | } | ||||
private abstract static class TitledPanel extends JPanel { | private abstract static class TitledPanel extends JPanel { | ||||
public TitledPanel(LayoutManager layout, String title) { | public TitledPanel(LayoutManager layout, String title) { | ||||
super(layout); | super(layout); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
private class TablePanel extends TitledPanel { | private class TablePanel extends TitledPanel { | ||||
private DefaultTableModel model = new DefaultTableModel(); | private DefaultTableModel model = new DefaultTableModel(); | ||||
private TJable table; | private TJable table; |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.testing; | 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.lang.reflect.Method; | ||||
import java.util.HashMap; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.HashMap; | |||||
import java.io.InputStreamReader; | |||||
import java.io.FileInputStream; | |||||
import org.apache.commons.digester.Digester; | import org.apache.commons.digester.Digester; | ||||
import org.aspectj.tools.ajc.Ajc; | 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. | * Autowiring of XML test spec file as JUnit tests. | ||||
* <p/> | * <p/> |
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.testing; | 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.Test; | ||||
import junit.framework.TestCase; | import junit.framework.TestCase; |
import org.aspectj.tools.ajc.CompilationResult; | import org.aspectj.tools.ajc.CompilationResult; | ||||
import org.aspectj.util.FileUtil; | import org.aspectj.util.FileUtil; | ||||
import org.aspectj.weaver.AjAttribute; | 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.ResolvedMember; | ||||
import org.aspectj.weaver.ResolvedType; | import org.aspectj.weaver.ResolvedType; | ||||
import org.aspectj.weaver.WeaverStateInfo; | import org.aspectj.weaver.WeaverStateInfo; | ||||
import org.aspectj.weaver.AjAttribute.WeaverState; | |||||
import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; | |||||
import org.aspectj.weaver.bcel.BcelConstantPoolReader; | import org.aspectj.weaver.bcel.BcelConstantPoolReader; | ||||
import junit.extensions.TestSetup; | import junit.extensions.TestSetup; |
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.TestCase; | |||||
import org.aspectj.testing.run.IRunIterator; | import org.aspectj.testing.run.IRunIterator; | ||||
import org.aspectj.testing.xml.XMLWriter; | import org.aspectj.testing.xml.XMLWriter; | ||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* | * | ||||
*/ | */ |
package org.aspectj.testing.harness.bridge; | package org.aspectj.testing.harness.bridge; | ||||
import java.util.*; | |||||
import java.util.ArrayList; | |||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.Comparator; | import java.util.Comparator; |
package org.aspectj.testing.harness.bridge; | package org.aspectj.testing.harness.bridge; | ||||
import java.util.*; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | 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.IMessage; | ||||
import org.aspectj.bridge.IMessageHolder; | |||||
import org.aspectj.bridge.ISourceLocation; | import org.aspectj.bridge.ISourceLocation; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import junit.framework.Assert; | |||||
import junit.framework.AssertionFailedError; | |||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* Primarily used by others to test AjcTest | * Primarily used by others to test AjcTest | ||||
*/ | */ |
package org.aspectj.testing.harness.bridge; | package org.aspectj.testing.harness.bridge; | ||||
import java.io.*; | |||||
import java.io.BufferedReader; | |||||
import java.io.File; | 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.Arrays; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.HashMap; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | |||||
import java.util.StringTokenizer; | |||||
//import org.aspectj.bridge.*; | //import org.aspectj.bridge.*; | ||||
import org.aspectj.bridge.IMessageHandler; | import org.aspectj.bridge.IMessageHandler; |
package org.aspectj.testing.harness.bridge; | 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.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.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.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. | * Run the compiler once. |
package org.aspectj.testing.harness.bridge; | package org.aspectj.testing.harness.bridge; | ||||
import java.util.*; | |||||
import java.util.Arrays; | 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.MessageHandler; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.testing.harness.bridge.CompilerRun.Spec.CRSOptions; | 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.testing.util.options.Options; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* | * | ||||
*/ | */ |
package org.aspectj.testing.harness.bridge; | package org.aspectj.testing.harness.bridge; | ||||
import java.io.File; | 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 org.aspectj.util.LangUtil; | ||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* Use a stub compiler/ICommand to verify command-line passed | * Use a stub compiler/ICommand to verify command-line passed | ||||
* to the compiler by the harness. | * to the compiler by the harness. |
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import java.io.StringWriter; | import java.io.StringWriter; | ||||
import junit.framework.AssertionFailedError; | |||||
import junit.framework.TestCase; | |||||
import org.aspectj.bridge.IMessage; | import org.aspectj.bridge.IMessage; | ||||
import org.aspectj.bridge.MessageHandler; | import org.aspectj.bridge.MessageHandler; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.testing.xml.XMLWriter; | import org.aspectj.testing.xml.XMLWriter; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import junit.framework.AssertionFailedError; | |||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* (broken) tests for unutilized feature to read in | * (broken) tests for unutilized feature to read in | ||||
* expected directory changes as messages. | * expected directory changes as messages. |
import org.aspectj.bridge.AbortException; | import org.aspectj.bridge.AbortException; | ||||
import org.aspectj.bridge.IMessage; | import org.aspectj.bridge.IMessage; | ||||
import org.aspectj.bridge.IMessage.Kind; | |||||
import org.aspectj.bridge.ISourceLocation; | import org.aspectj.bridge.ISourceLocation; | ||||
import org.aspectj.bridge.Message; | import org.aspectj.bridge.Message; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.bridge.SourceLocation; | import org.aspectj.bridge.SourceLocation; | ||||
import org.aspectj.bridge.IMessage.Kind; | |||||
import org.aspectj.testing.util.BridgeUtil; | import org.aspectj.testing.util.BridgeUtil; | ||||
import org.aspectj.testing.util.ObjectChecker; | import org.aspectj.testing.util.ObjectChecker; | ||||
import org.aspectj.testing.util.SFileReader; | import org.aspectj.testing.util.SFileReader; |
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.List; | import java.util.List; | ||||
import org.aspectj.bridge.AbortException; | |||||
import org.aspectj.bridge.ICommand; | import org.aspectj.bridge.ICommand; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.testing.ajde.CompileCommand; | import org.aspectj.testing.ajde.CompileCommand; | ||||
import org.aspectj.testing.run.WrappedRunIterator; | import org.aspectj.testing.run.WrappedRunIterator; | ||||
import org.aspectj.testing.util.StructureModelUtil; | import org.aspectj.testing.util.StructureModelUtil; | ||||
import org.aspectj.testing.util.StructureModelUtil.ModelIncorrectException; | 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.SoftMessage; | ||||
import org.aspectj.testing.xml.XMLWriter; | import org.aspectj.testing.xml.XMLWriter; | ||||
import org.aspectj.util.FileUtil; | import org.aspectj.util.FileUtil; |
package org.aspectj.testing.harness.bridge; | 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.AbortException; | ||||
import org.aspectj.bridge.IMessageHandler; | import org.aspectj.bridge.IMessageHandler; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import org.aspectj.weaver.loadtime.WeavingURLClassLoader; | 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. | * Run a class in this VM using reflection. | ||||
* Forked mode supported, but through system properties: | * Forked mode supported, but through system properties: |
import javax.xml.parsers.DocumentBuilderFactory; | import javax.xml.parsers.DocumentBuilderFactory; | ||||
import javax.xml.parsers.ParserConfigurationException; | import javax.xml.parsers.ParserConfigurationException; | ||||
import junit.framework.TestCase; | |||||
import org.aspectj.bridge.IMessage; | import org.aspectj.bridge.IMessage; | ||||
import org.aspectj.bridge.IMessageHolder; | import org.aspectj.bridge.IMessageHolder; | ||||
import org.aspectj.bridge.ISourceLocation; | import org.aspectj.bridge.ISourceLocation; | ||||
import org.w3c.dom.NodeList; | import org.w3c.dom.NodeList; | ||||
import org.xml.sax.SAXException; | import org.xml.sax.SAXException; | ||||
import junit.framework.TestCase; | |||||
public class ParseTestCase extends TestCase { | public class ParseTestCase extends TestCase { | ||||
public ParseTestCase(String name) { | public ParseTestCase(String name) { |
package org.aspectj.testing.taskdefs; | package org.aspectj.testing.taskdefs; | ||||
//import java.awt.Frame; | //import java.awt.Frame; | ||||
import java.io.*; | |||||
import java.io.File; | |||||
import java.io.IOException; | |||||
//import java.lang.reflect.*; | //import java.lang.reflect.*; | ||||
import java.util.*; | |||||
//import java.util.List; | //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.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.tools.ant.taskdefs.AjcTask; | ||||
import org.aspectj.util.*; | |||||
import org.aspectj.util.FileUtil; | import org.aspectj.util.FileUtil; | ||||
import org.aspectj.util.LangUtil; | |||||
/** | /** | ||||
* Drive tests using the Ant taskdef. | * Drive tests using the Ant taskdef. |
import java.io.File; | import java.io.File; | ||||
import java.util.ArrayList; | 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.MessageHandler; | ||||
import org.aspectj.bridge.MessageUtil; | |||||
import org.aspectj.testing.harness.bridge.Globals; | import org.aspectj.testing.harness.bridge.Globals; | ||||
import org.aspectj.util.*; | |||||
import org.aspectj.util.FileUtil; | |||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import junit.framework.TestCase; | import junit.framework.TestCase; |
package org.aspectj.testing.util; | package org.aspectj.testing.util; | ||||
import junit.framework.TestCase; | |||||
import org.aspectj.bridge.MessageHandler; | import org.aspectj.bridge.MessageHandler; | ||||
import org.aspectj.testing.run.IRun; | import org.aspectj.testing.run.IRun; | ||||
import org.aspectj.testing.run.IRunStatus; | import org.aspectj.testing.run.IRunStatus; | ||||
import org.aspectj.testing.run.RunStatus; | import org.aspectj.testing.run.RunStatus; | ||||
import org.aspectj.testing.run.Runner; | import org.aspectj.testing.run.Runner; | ||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* | * | ||||
*/ | */ |
package org.aspectj.testing.util; | package org.aspectj.testing.util; | ||||
import java.io.File; | import java.io.File; | ||||
import java.util.*; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Arrays; | |||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.Comparator; | import java.util.Comparator; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.ListIterator; | |||||
import org.aspectj.bridge.IMessage; | import org.aspectj.bridge.IMessage; | ||||
import org.aspectj.bridge.IMessageHandler; | import org.aspectj.bridge.IMessageHandler; |
package org.aspectj.testing.util; | 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.MutableAttributeSet; | ||||
import javax.swing.text.html.*; | |||||
import javax.swing.text.html.HTML; | |||||
import javax.swing.text.html.HTML.Tag; | 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.IMessageHandler; | ||||
import org.aspectj.bridge.MessageHandler; | |||||
import org.aspectj.bridge.MessageUtil; | |||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
//import org.aspectj.util.FileUtil; | //import org.aspectj.util.FileUtil; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.TestCase; | |||||
import org.aspectj.bridge.IMessage; | import org.aspectj.bridge.IMessage; | ||||
import org.aspectj.bridge.ISourceLocation; | import org.aspectj.bridge.ISourceLocation; | ||||
import org.aspectj.bridge.Message; | import org.aspectj.bridge.Message; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.bridge.SourceLocation; | import org.aspectj.bridge.SourceLocation; | ||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* | * | ||||
*/ | */ |
import java.io.File; | import java.io.File; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.TestSuite; | |||||
import org.aspectj.ajde.core.AjdeCoreTestCase; | import org.aspectj.ajde.core.AjdeCoreTestCase; | ||||
import org.aspectj.ajde.core.TestCompilerConfiguration; | import org.aspectj.ajde.core.TestCompilerConfiguration; | ||||
import org.aspectj.asm.IProgramElement; | import org.aspectj.asm.IProgramElement; | ||||
import junit.framework.TestSuite; | |||||
/** | /** | ||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ |
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.ListIterator; | import java.util.ListIterator; | ||||
import junit.framework.TestCase; | |||||
import org.aspectj.util.FileUtil; | import org.aspectj.util.FileUtil; | ||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* | * | ||||
*/ | */ |
package org.aspectj.testing.util; | 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; | import java.util.ArrayList; | ||||
/** | /** |
package org.aspectj.testing.util.options; | 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; | import org.aspectj.util.LangUtil; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import junit.framework.Assert; | |||||
import org.aspectj.testing.util.LangUtil; | import org.aspectj.testing.util.LangUtil; | ||||
import junit.framework.Assert; | |||||
/** | /** | ||||
* Drivers to test a given set of Options. | * Drivers to test a given set of Options. | ||||
* They now throw AssertionFailedError on failure, | * They now throw AssertionFailedError on failure, |
package org.aspectj.testing.util.options; | package org.aspectj.testing.util.options; | ||||
import java.util.*; | |||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
package org.aspectj.testing.util.options; | package org.aspectj.testing.util.options; | ||||
import junit.framework.*; | |||||
import org.aspectj.testing.util.options.Option.InvalidInputException; | import org.aspectj.testing.util.options.Option.InvalidInputException; | ||||
import junit.framework.Assert; | |||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
*/ | */ | ||||
public class OptionsTest extends TestCase { | public class OptionsTest extends TestCase { |
package org.aspectj.testing.util.options; | 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.testing.util.options.Option.Value; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; |
package org.aspectj.testing.xml; | package org.aspectj.testing.xml; | ||||
import java.io.*; | |||||
//import java.util.Vector; | //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.apache.commons.digester.Digester; | ||||
import org.aspectj.bridge.AbortException; | import org.aspectj.bridge.AbortException; | ||||
import org.aspectj.bridge.ISourceLocation; | import org.aspectj.bridge.ISourceLocation; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.bridge.SourceLocation; | 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.testing.util.RunUtils; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import org.xml.sax.*; | |||||
import org.xml.sax.EntityResolver; | |||||
import org.xml.sax.InputSource; | |||||
import org.xml.sax.SAXException; | import org.xml.sax.SAXException; | ||||
/** | /** |
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
//import junit.framework.*; | |||||
import junit.framework.TestCase; | |||||
import org.aspectj.testing.harness.bridge.AjcSpecTest; | import org.aspectj.testing.harness.bridge.AjcSpecTest; | ||||
import org.aspectj.testing.harness.bridge.AjcTest; | import org.aspectj.testing.harness.bridge.AjcTest; | ||||
import org.aspectj.testing.harness.bridge.FlatSuiteReader; | import org.aspectj.testing.harness.bridge.FlatSuiteReader; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
//import junit.framework.*; | |||||
import junit.framework.TestCase; | |||||
/** | /** | ||||
* | * | ||||
*/ | */ |
package org.aspectj.testing.xml; | package org.aspectj.testing.xml; | ||||
import org.aspectj.bridge.IMessage; | |||||
import org.aspectj.util.LangUtil; | |||||
import java.io.File; | import java.io.File; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.aspectj.bridge.IMessage; | |||||
import org.aspectj.util.LangUtil; | |||||
import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
/** | /** |
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import org.aspectj.bridge.*; | |||||
import org.aspectj.bridge.IMessage; | import org.aspectj.bridge.IMessage; | ||||
import org.aspectj.bridge.IMessageHolder; | |||||
import org.aspectj.bridge.ISourceLocation; | import org.aspectj.bridge.ISourceLocation; | ||||
import org.aspectj.bridge.MessageUtil; | import org.aspectj.bridge.MessageUtil; | ||||
import org.aspectj.bridge.SourceLocation; | import org.aspectj.bridge.SourceLocation; |
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.systemtest; | package org.aspectj.systemtest; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
import org.aspectj.systemtest.ajc10x.Ajc10xTests; | import org.aspectj.systemtest.ajc10x.Ajc10xTests; | ||||
import org.aspectj.systemtest.ajc11.Ajc11Tests; | import org.aspectj.systemtest.ajc11.Ajc11Tests; | ||||
import org.aspectj.systemtest.ajc120.Ajc120Tests; | import org.aspectj.systemtest.ajc120.Ajc120Tests; | ||||
import org.aspectj.systemtest.tracing.TracingTests; | import org.aspectj.systemtest.tracing.TracingTests; | ||||
import org.aspectj.systemtest.xlint.XLintTests; | import org.aspectj.systemtest.xlint.XLintTests; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
/** | /** | ||||
* @author Andy Clement | * @author Andy Clement | ||||
* @author Adrian Colyer | * @author Adrian Colyer |
*/ | */ | ||||
package org.aspectj.systemtest; | package org.aspectj.systemtest; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
import org.aspectj.systemtest.ajc150.AllTestsAspectJ150; | import org.aspectj.systemtest.ajc150.AllTestsAspectJ150; | ||||
import org.aspectj.systemtest.ajc150.ataspectj.AtAjAnnotationGenTests; | import org.aspectj.systemtest.ajc150.ataspectj.AtAjAnnotationGenTests; | ||||
import org.aspectj.systemtest.ajc151.AllTestsAspectJ151; | import org.aspectj.systemtest.ajc151.AllTestsAspectJ151; | ||||
import org.aspectj.systemtest.model.Model5Tests; | import org.aspectj.systemtest.model.Model5Tests; | ||||
import org.aspectj.systemtest.xlint.XLint5Tests; | import org.aspectj.systemtest.xlint.XLint5Tests; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
public class AllTests15 { | public class AllTests15 { | ||||
public static Test suite() { | public static Test suite() { |
*/ | */ | ||||
package org.aspectj.systemtest; | package org.aspectj.systemtest; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
import org.aspectj.systemtest.ajc160.AllTestsAspectJ160; | import org.aspectj.systemtest.ajc160.AllTestsAspectJ160; | ||||
import org.aspectj.systemtest.ajc161.AllTestsAspectJ161; | import org.aspectj.systemtest.ajc161.AllTestsAspectJ161; | ||||
import org.aspectj.systemtest.ajc1610.AllTestsAspectJ1610; | import org.aspectj.systemtest.ajc1610.AllTestsAspectJ1610; | ||||
import org.aspectj.systemtest.ajc169.AllTestsAspectJ169; | import org.aspectj.systemtest.ajc169.AllTestsAspectJ169; | ||||
import org.aspectj.systemtest.incremental.tools.AnnotationProcessingTests; | import org.aspectj.systemtest.incremental.tools.AnnotationProcessingTests; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
public class AllTests16 { | public class AllTests16 { | ||||
public static Test suite() { | public static Test suite() { |
*/ | */ | ||||
package org.aspectj.systemtest; | package org.aspectj.systemtest; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
import org.aspectj.systemtest.ajc170.AllTestsAspectJ170; | import org.aspectj.systemtest.ajc170.AllTestsAspectJ170; | ||||
import org.aspectj.systemtest.ajc171.AllTestsAspectJ171; | import org.aspectj.systemtest.ajc171.AllTestsAspectJ171; | ||||
import org.aspectj.systemtest.ajc172.AllTestsAspectJ172; | import org.aspectj.systemtest.ajc172.AllTestsAspectJ172; | ||||
import org.aspectj.systemtest.ajc174.AllTestsAspectJ174; | import org.aspectj.systemtest.ajc174.AllTestsAspectJ174; | ||||
import org.aspectj.systemtest.ajc175.AllTestsAspectJ175; | import org.aspectj.systemtest.ajc175.AllTestsAspectJ175; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
public class AllTests17 { | public class AllTests17 { | ||||
public static Test suite() { | public static Test suite() { |
* This program and the accompanying materials are made available | * 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 v1.0 | ||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.systemtest.ajc10x; | package org.aspectj.systemtest.ajc10x; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class Ajc10xTests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc10xTests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
* This program and the accompanying materials are made available | * 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 v1.0 | ||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.systemtest.ajc11; | package org.aspectj.systemtest.ajc11; | ||||
import java.io.File; | |||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import junit.framework.Test; | |||||
public class Ajc11Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc11Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
* This program and the accompanying materials are made available | * 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 v1.0 | ||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.systemtest.ajc120; | package org.aspectj.systemtest.ajc120; | ||||
import java.io.File; | |||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class Ajc120Tests extends XMLBasedAjcTestCase { | public class Ajc120Tests extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2004 IBM | |||||
* Copyright (c) 2004 IBM | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v1.0 | * are made available under the terms of the Eclipse Public License v1.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* <b>These tests check binary weaving of code compiled with the 1.5 compiler. If you need to rebuild | * <b>These tests check binary weaving of code compiled with the 1.5 compiler. If you need to rebuild | ||||
* the class files then you will have to run tests/java5/bridgeMethods/build.xml.</b> | * the class files then you will have to run tests/java5/bridgeMethods/build.xml.</b> | ||||
* | |||||
* <p>Bridge methods are generated when a type extends or implements a parameterized class or interface and | |||||
* | |||||
* <p>Bridge methods are generated when a type extends or implements a parameterized class or interface and | |||||
* type erasure changes the signature of any inherited method. | * type erasure changes the signature of any inherited method. | ||||
* | |||||
* | |||||
* <p>They impact AspectJ in two ways: | * <p>They impact AspectJ in two ways: | ||||
* <ol> | * <ol> | ||||
* <li>They exist as a method execution join point, and their 'body' exists as a set of new join points | * <li>They exist as a method execution join point, and their 'body' exists as a set of new join points | ||||
* (although their body is normally coded simply to delegate to the method they are bridging too). | * (although their body is normally coded simply to delegate to the method they are bridging too). | ||||
* <li> They create a potential call join point where a call can be made to the bridge method. | * <li> They create a potential call join point where a call can be made to the bridge method. | ||||
* </ol> | |||||
* | |||||
* <p>The principal things we have to do are avoid weaving their body and ignore their existence | |||||
* </ol> | |||||
* | |||||
* <p>The principal things we have to do are avoid weaving their body and ignore their existence | |||||
* as a method execution join point. Their existence as a potential target for a call join point are | * as a method execution join point. Their existence as a potential target for a call join point are | ||||
* more complicated. Although they exist in the code, a 1.5 compiler will prevent a call to them with | * more complicated. Although they exist in the code, a 1.5 compiler will prevent a call to them with | ||||
* an error like this: | * an error like this: | ||||
* | |||||
* | |||||
* M.java:3: compareTo(Number) in Number cannot be applied to (java.lang.String) | * M.java:3: compareTo(Number) in Number cannot be applied to (java.lang.String) | ||||
* new Number(5).compareTo("abc"); | * new Number(5).compareTo("abc"); | ||||
* | * | ||||
* and it will let them through. | * and it will let them through. | ||||
*/ | */ | ||||
public class AccBridgeMethods extends org.aspectj.testing.XMLBasedAjcTestCase { | public class AccBridgeMethods extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { | ||||
return XMLBasedAjcTestCase.loadSuite(AccBridgeMethods.class); | return XMLBasedAjcTestCase.loadSuite(AccBridgeMethods.class); | ||||
} | } | ||||
return getClassResource("ajc150.xml"); | return getClassResource("ajc150.xml"); | ||||
} | } | ||||
/** | /** | ||||
* AspectX attempts to weave call and execution of the method for which a 'bridge method' is also created. | * AspectX attempts to weave call and execution of the method for which a 'bridge method' is also created. | ||||
* If the test works then only two weaving messages come out. If it fails then usually 4 messages come out | * If the test works then only two weaving messages come out. If it fails then usually 4 messages come out | ||||
public void test001_bridgeMethodIgnored() { | public void test001_bridgeMethodIgnored() { | ||||
runTest("Ignore bridge methods"); | runTest("Ignore bridge methods"); | ||||
} | } | ||||
} | } |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2004 IBM | |||||
* Copyright (c) 2004 IBM | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v1.0 | * are made available under the terms of the Eclipse Public License v1.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
import java.io.File; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.Method; | import org.aspectj.apache.bcel.classfile.Method; | ||||
import org.aspectj.apache.bcel.classfile.Signature; | import org.aspectj.apache.bcel.classfile.Signature; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import junit.framework.Test; | |||||
public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { | ||||
if (LangUtil.is17VMOrGreater()) { | if (LangUtil.is17VMOrGreater()) { | ||||
runTest("java 5 pointcuts and declares at pre-java 5 compliance levels - 1.7"); | runTest("java 5 pointcuts and declares at pre-java 5 compliance levels - 1.7"); | ||||
} else { | } else { | ||||
runTest("java 5 pointcuts and declares at pre-java 5 compliance levels"); | |||||
runTest("java 5 pointcuts and declares at pre-java 5 compliance levels"); | |||||
} | } | ||||
} | } | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
import org.aspectj.systemtest.ajc150.ataspectj.AtAjLTWTests; | import org.aspectj.systemtest.ajc150.ataspectj.AtAjLTWTests; | ||||
import org.aspectj.systemtest.ajc150.ataspectj.AtAjMisuseTests; | import org.aspectj.systemtest.ajc150.ataspectj.AtAjMisuseTests; | ||||
import org.aspectj.systemtest.ajc150.ataspectj.AtAjSyntaxTests; | import org.aspectj.systemtest.ajc150.ataspectj.AtAjSyntaxTests; | ||||
import org.aspectj.systemtest.ajc150.ltw.LTWServerTests; | import org.aspectj.systemtest.ajc150.ltw.LTWServerTests; | ||||
import org.aspectj.systemtest.ajc150.ltw.LTWTests; | import org.aspectj.systemtest.ajc150.ltw.LTWTests; | ||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
/** | /** | ||||
* This pulls together tests we have written for AspectJ 1.5.0 that don't need Java 1.5 to run | * This pulls together tests we have written for AspectJ 1.5.0 that don't need Java 1.5 to run | ||||
*/ | */ |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2004 IBM | |||||
* Copyright (c) 2004 IBM | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v1.0 | * are made available under the terms of the Eclipse Public License v1.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; | ||||
import org.aspectj.asm.IHierarchy; | import org.aspectj.asm.IHierarchy; | ||||
import org.aspectj.asm.IProgramElement; | import org.aspectj.asm.IProgramElement; | ||||
import org.aspectj.asm.internal.Relationship; | import org.aspectj.asm.internal.Relationship; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class AnnotationBinding extends XMLBasedAjcTestCase { | public class AnnotationBinding extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { | ||||
Relationship rel = (Relationship) l.get(0); | Relationship rel = (Relationship) l.get(0); | ||||
assertTrue("Should have 1 target but has " + rel.getTargets().size(), rel.getTargets().size() == 1); | assertTrue("Should have 1 target but has " + rel.getTargets().size(), rel.getTargets().size() == 1); | ||||
String tgt = (String) rel.getTargets().get(0); | |||||
String tgt = rel.getTargets().get(0); | |||||
int lineNumber = asm.getHandleProvider().getLineNumberForHandle(tgt); | int lineNumber = asm.getHandleProvider().getLineNumberForHandle(tgt); | ||||
assertTrue("Should point to line 10 but doesnt: " + lineNumber, lineNumber == 10); | assertTrue("Should point to line 10 but doesnt: " + lineNumber, lineNumber == 10); | ||||
} | } | ||||
Relationship rel = (Relationship) l.get(0); | Relationship rel = (Relationship) l.get(0); | ||||
assertTrue("Should have 1 target but has " + rel.getTargets().size(), rel.getTargets().size() == 1); | assertTrue("Should have 1 target but has " + rel.getTargets().size(), rel.getTargets().size() == 1); | ||||
String tgt = (String) rel.getTargets().get(0); | |||||
String tgt = rel.getTargets().get(0); | |||||
int lineNumber = asm.getHandleProvider().getLineNumberForHandle(tgt); | int lineNumber = asm.getHandleProvider().getLineNumberForHandle(tgt); | ||||
assertTrue("Should point to line 10 but doesnt: " + lineNumber, lineNumber == 10); | assertTrue("Should point to line 10 but doesnt: " + lineNumber, lineNumber == 10); | ||||
Relationship rel = (Relationship) l.get(0); | Relationship rel = (Relationship) l.get(0); | ||||
assertTrue("Should have 1 target but has " + rel.getTargets().size(), rel.getTargets().size() == 1); | assertTrue("Should have 1 target but has " + rel.getTargets().size(), rel.getTargets().size() == 1); | ||||
String tgt = (String) rel.getTargets().get(0); | |||||
String tgt = rel.getTargets().get(0); | |||||
int lineNumber = asm.getHandleProvider().getLineNumberForHandle(tgt); | int lineNumber = asm.getHandleProvider().getLineNumberForHandle(tgt); | ||||
assertTrue("Should point to line 10 but doesnt: " + lineNumber, lineNumber == 10); | assertTrue("Should point to line 10 but doesnt: " + lineNumber, lineNumber == 10); | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* Tests the use of Annotations in pointcuts | * Tests the use of Annotations in pointcuts |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Tests for @this, @target, @args | * Tests for @this, @target, @args | ||||
*/ | */ |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.Method; | import org.aspectj.apache.bcel.classfile.Method; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class Annotations extends XMLBasedAjcTestCase { | public class Annotations extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Annotations, the rules/tests: | * Annotations, the rules/tests: |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
This test must be run under a Java5 VM - so it is *not* currently | This test must be run under a Java5 VM - so it is *not* currently | ||||
in the test suite !!! | in the test suite !!! |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2004 IBM Corporation and others. | * Copyright (c) 2004 IBM Corporation and others. | ||||
* All rights reserved. This program and the accompanying materials | |||||
* All rights reserved. This program and the accompanying materials | |||||
* are made available under the terms of the Eclipse Public License v1.0 | * are made available under the terms of the Eclipse Public License v1.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | * http://www.eclipse.org/legal/epl-v10.html | ||||
* | |||||
* | |||||
* Contributors: | * Contributors: | ||||
* Andy Clement - initial implementation | * Andy Clement - initial implementation | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/* | /* | ||||
class Car {} | class Car {} | ||||
} | } | ||||
private boolean verbose = false; | private boolean verbose = false; | ||||
/** | /** | ||||
* call(* getCar()) should match both | * call(* getCar()) should match both | ||||
*/ | */ | ||||
runTest("covariance 1"); | runTest("covariance 1"); | ||||
} | } | ||||
/** | /** | ||||
* call(* Super.getCar()) should match both | * call(* Super.getCar()) should match both | ||||
* | |||||
* | |||||
* This test required a change to the compiler. When we are looking at signatures and comparing them we walk up | * This test required a change to the compiler. When we are looking at signatures and comparing them we walk up | ||||
* the hierarchy looking for supertypes that declare the same method. The problem is that in the comparison for | * the hierarchy looking for supertypes that declare the same method. The problem is that in the comparison for | ||||
* whether to methods are compatible we were including the return type - this meant 'Car getCar()' on Super was | * whether to methods are compatible we were including the return type - this meant 'Car getCar()' on Super was | ||||
* '()LFastCar;' (which includes the return type). If the full signature comparison fails then it looks at the | * '()LFastCar;' (which includes the return type). If the full signature comparison fails then it looks at the | ||||
* parameter signature - I did it that way to try and preserve some performance. I haven't changed the | * parameter signature - I did it that way to try and preserve some performance. I haven't changed the | ||||
* definition of 'signature' for a member as trimming the return type off it seems rather serious ! | * definition of 'signature' for a member as trimming the return type off it seems rather serious ! | ||||
* | |||||
* | |||||
* What might break: | * What might break: | ||||
* - 'matches' can now return true for things that have different return types - I guess whether this is a problem | * - 'matches' can now return true for things that have different return types - I guess whether this is a problem | ||||
* depends on what the caller of matches is expecting, their code will have been written before covariance was | * depends on what the caller of matches is expecting, their code will have been written before covariance was | ||||
public void testCOV002() { | public void testCOV002() { | ||||
runTest("covariance 2"); | runTest("covariance 2"); | ||||
} | } | ||||
/** | /** | ||||
* call(Car getCar()) should match both | * call(Car getCar()) should match both | ||||
* | |||||
* | |||||
* Had to implement proper covariance support here... | * Had to implement proper covariance support here... | ||||
*/ | */ | ||||
public void testCOV003() { | public void testCOV003() { | ||||
runTest("covariance 3"); | runTest("covariance 3"); | ||||
} | } | ||||
/** | /** | ||||
* *** Different base program, where Sub does not extend Super. | * *** Different base program, where Sub does not extend Super. | ||||
* call(Car Super.getCar()) should only match first call to getCar() | * call(Car Super.getCar()) should only match first call to getCar() | ||||
*/ | */ | ||||
public void testCOV004() { | public void testCOV004() { | ||||
runTest("covariance 4"); | runTest("covariance 4"); | ||||
} | |||||
} | |||||
/** | /** | ||||
* *** Original base program | * *** Original base program | ||||
*/ | */ | ||||
public void testCOV005() { | public void testCOV005() { | ||||
runTest("covariance 5"); | runTest("covariance 5"); | ||||
} | |||||
} | |||||
/** | /** | ||||
* call(Car Sub.getCar()) should not match anything | * call(Car Sub.getCar()) should not match anything | ||||
*/ | */ | ||||
public void testCOV006() { | public void testCOV006() { | ||||
runTest("covariance 6"); | runTest("covariance 6"); | ||||
} | |||||
} | |||||
/** | /** | ||||
* call(Car+ Sub.getCar()) should match 2nd call with xlint for the 1st call | * call(Car+ Sub.getCar()) should match 2nd call with xlint for the 1st call | ||||
*/ | */ | ||||
public void testCOV007() { | public void testCOV007() { | ||||
runTest("covariance 7"); | runTest("covariance 7"); | ||||
} | |||||
} | |||||
/** | /** | ||||
* *** aspect now contains two pointcuts and two pieces of advice | * *** aspect now contains two pointcuts and two pieces of advice | ||||
*/ | */ | ||||
public void testCOV008() { | public void testCOV008() { | ||||
runTest("covariance 8"); | runTest("covariance 8"); | ||||
} | |||||
} | |||||
/** | /** | ||||
* call(FastCar Super.getCar()) matches nothing | * call(FastCar Super.getCar()) matches nothing | ||||
*/ | */ | ||||
public void testCOV009() { | public void testCOV009() { | ||||
runTest("covariance 9"); | runTest("covariance 9"); | ||||
} | |||||
} | |||||
/** | /** | ||||
* call(Car+ getCar()) matches both | * call(Car+ getCar()) matches both | ||||
*/ | */ | ||||
public void testCOV010() { | public void testCOV010() { | ||||
runTest("covariance 10"); | runTest("covariance 10"); | ||||
} | |||||
} | |||||
public void testAJDKExamples() { | public void testAJDKExamples() { | ||||
runTest("ajdk: covariance"); | runTest("ajdk: covariance"); |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; | ||||
import org.aspectj.asm.IHierarchy; | import org.aspectj.asm.IHierarchy; | ||||
import org.aspectj.asm.IProgramElement; | import org.aspectj.asm.IProgramElement; | ||||
import org.aspectj.asm.IRelationship; | import org.aspectj.asm.IRelationship; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class DeclareAnnotationTests extends XMLBasedAjcTestCase { | public class DeclareAnnotationTests extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Enums, the rules/tests: | * Enums, the rules/tests: |
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.Attribute; | import org.aspectj.apache.bcel.classfile.Attribute; | ||||
import org.aspectj.apache.bcel.classfile.Field; | import org.aspectj.apache.bcel.classfile.Field; | ||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.weaver.bcel.BcelTypeMunger; | import org.aspectj.weaver.bcel.BcelTypeMunger; | ||||
import org.aspectj.weaver.bcel.BcelWorld; | import org.aspectj.weaver.bcel.BcelWorld; | ||||
import junit.framework.Test; | |||||
public class GenericITDsDesign extends XMLBasedAjcTestCase { | public class GenericITDsDesign extends XMLBasedAjcTestCase { | ||||
private World recentWorld; | private World recentWorld; |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class HasMember extends XMLBasedAjcTestCase { | public class HasMember extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Checks if we are obeying migration rules. | * Checks if we are obeying migration rules. |
import java.io.File; | import java.io.File; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.tools.ajc.CompilationResult; | import org.aspectj.tools.ajc.CompilationResult; | ||||
import junit.framework.Test; | |||||
public class PerTypeWithinTests extends XMLBasedAjcTestCase { | public class PerTypeWithinTests extends XMLBasedAjcTestCase { |
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Checking that runtime visible annotations are visible at runtime (they get into the class file) | * Checking that runtime visible annotations are visible at runtime (they get into the class file) | ||||
*/ | */ |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class StaticImports extends XMLBasedAjcTestCase { | public class StaticImports extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class SuppressedWarnings extends XMLBasedAjcTestCase { | public class SuppressedWarnings extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150; | package org.aspectj.systemtest.ajc150; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Varargs, the rules/tests: | * Varargs, the rules/tests: |
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* A suite for @AspectJ aspects located in java5/ataspectj | * A suite for @AspectJ aspects located in java5/ataspectj | ||||
* | * |
import java.io.File; | import java.io.File; | ||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.util.FileUtil; | import org.aspectj.util.FileUtil; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> | * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> | ||||
*/ | */ |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150.ataspectj; | package org.aspectj.systemtest.ajc150.ataspectj; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> | * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> | ||||
*/ | */ |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc150.ataspectj; | package org.aspectj.systemtest.ajc150.ataspectj; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* A suite for @AspectJ aspects located in java5/ataspectj | * A suite for @AspectJ aspects located in java5/ataspectj | ||||
* | * |
package org.aspectj.systemtest.ajc150.ataspectj.coverage; | package org.aspectj.systemtest.ajc150.ataspectj.coverage; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | import junit.framework.Test; |
package org.aspectj.systemtest.ajc150.ltw; | package org.aspectj.systemtest.ajc150.ltw; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class LTWServerTests extends XMLBasedAjcTestCase { | public class LTWServerTests extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
import java.util.Enumeration; | import java.util.Enumeration; | ||||
import java.util.Properties; | import java.util.Properties; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.weaver.tools.WeavingAdaptor; | import org.aspectj.weaver.tools.WeavingAdaptor; | ||||
import junit.framework.Test; | |||||
public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc151; | package org.aspectj.systemtest.ajc151; | ||||
import java.io.File; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc151; | package org.aspectj.systemtest.ajc151; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* This testcode shows what is possible with code style and the current limitations | * This testcode shows what is possible with code style and the current limitations | ||||
* of @AJ style. Each program is written in both styles and those variations | * of @AJ style. Each program is written in both styles and those variations |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc151; | package org.aspectj.systemtest.ajc151; | ||||
import java.io.File; | |||||
import java.util.List; | import java.util.List; | ||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc151; | package org.aspectj.systemtest.ajc151; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class SerialVersionUIDTests extends XMLBasedAjcTestCase { | public class SerialVersionUIDTests extends XMLBasedAjcTestCase { | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc152; | package org.aspectj.systemtest.ajc152; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; | ||||
import org.aspectj.asm.IHierarchy; | import org.aspectj.asm.IHierarchy; | ||||
import org.aspectj.asm.IProgramElement; | import org.aspectj.asm.IProgramElement; | ||||
import org.aspectj.asm.internal.CharOperation; | import org.aspectj.asm.internal.CharOperation; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
// public void testCovarianceAndDecp_pr128443_1() { runTest("covariance and decp - 1"); } | // public void testCovarianceAndDecp_pr128443_1() { runTest("covariance and decp - 1"); } |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc152; | package org.aspectj.systemtest.ajc152; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* Work items, phase #1: lock()/unlock() x expose new joinpoints x parse new pcds x fix tjp string x preventing double unlock() | * Work items, phase #1: lock()/unlock() x expose new joinpoints x parse new pcds x fix tjp string x preventing double unlock() | ||||
* messages/markers in structure model x error messages appropriate for attempting to use around advice on synchronization join | * messages/markers in structure model x error messages appropriate for attempting to use around advice on synchronization join |
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.Method; | import org.aspectj.apache.bcel.classfile.Method; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.weaver.bcel.LazyClassGen; | import org.aspectj.weaver.bcel.LazyClassGen; | ||||
import org.aspectj.weaver.bcel.LazyMethodGen; | import org.aspectj.weaver.bcel.LazyMethodGen; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* Method transformation, example: | * Method transformation, example: | ||||
* | * |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc153; | package org.aspectj.systemtest.ajc153; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; | ||||
import org.aspectj.asm.IHierarchy; | import org.aspectj.asm.IHierarchy; | ||||
import org.aspectj.asm.IProgramElement; | import org.aspectj.asm.IProgramElement; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import org.aspectj.weaver.bcel.Utility; | import org.aspectj.weaver.bcel.Utility; | ||||
import junit.framework.Test; | |||||
public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public void testFormalCommentsAreSetForConstructorIPEs_pr164340() { | public void testFormalCommentsAreSetForConstructorIPEs_pr164340() { |
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.systemtest.ajc153; | package org.aspectj.systemtest.ajc153; | ||||
import java.io.File; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.net.URL; | import java.net.URL; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; | ||||
import org.aspectj.asm.IHierarchy; | import org.aspectj.asm.IHierarchy; | ||||
import org.aspectj.asm.IProgramElement; | import org.aspectj.asm.IProgramElement; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { | public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { | ||||
// IElementHandleProvider handleProvider; | // IElementHandleProvider handleProvider; |
package org.aspectj.systemtest.ajc153; | package org.aspectj.systemtest.ajc153; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class LTWServer153Tests extends XMLBasedAjcTestCase { | public class LTWServer153Tests extends XMLBasedAjcTestCase { | ||||
public static Test suite() { | public static Test suite() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc153; | package org.aspectj.systemtest.ajc153; | ||||
import java.io.File; | |||||
import java.net.URL; | import java.net.URL; | ||||
import junit.framework.Test; | |||||
//import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter; | //import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter; | ||||
import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter; | import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* testplan: (x = complete) | * testplan: (x = complete) | ||||
* | * |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc154; | package org.aspectj.systemtest.ajc154; | ||||
import java.io.File; | |||||
import java.lang.reflect.Field; | import java.lang.reflect.Field; | ||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.ConstantPool; | import org.aspectj.apache.bcel.classfile.ConstantPool; | ||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.LineNumber; | import org.aspectj.apache.bcel.classfile.LineNumber; | ||||
import org.aspectj.weaver.tools.MatchingContext; | import org.aspectj.weaver.tools.MatchingContext; | ||||
import org.aspectj.weaver.tools.PointcutDesignatorHandler; | import org.aspectj.weaver.tools.PointcutDesignatorHandler; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* These are tests for AspectJ1.5.4 | * These are tests for AspectJ1.5.4 | ||||
*/ | */ |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc160; | package org.aspectj.systemtest.ajc160; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* These are tests for AspectJ1.6.0 | * These are tests for AspectJ1.6.0 | ||||
*/ | */ |
package org.aspectj.systemtest.ajc160; | package org.aspectj.systemtest.ajc160; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Parameter value matching | * Parameter value matching | ||||
* | * |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc160; | package org.aspectj.systemtest.ajc160; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { | public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
// Supporting -Xset:weaveJavaPackages=true and -Xset:weaveJavaxPackages=true | // Supporting -Xset:weaveJavaPackages=true and -Xset:weaveJavaxPackages=true |
package org.aspectj.systemtest.ajc160; | package org.aspectj.systemtest.ajc160; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Parameter annotation matching | * Parameter annotation matching | ||||
* | * |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc161; | package org.aspectj.systemtest.ajc161; | ||||
import java.io.File; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.Set; | import java.util.Set; | ||||
import junit.framework.Test; | |||||
import org.aspectj.asm.AsmManager; | import org.aspectj.asm.AsmManager; | ||||
import org.aspectj.asm.IRelationshipMap; | import org.aspectj.asm.IRelationshipMap; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
// AspectJ1.6.1 | // AspectJ1.6.1 |
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.systemtest.ajc161; | package org.aspectj.systemtest.ajc161; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | /** | ||||
* Optimising Annotation Field Binding - better code gen for the cases where the user just wants a field from the | * Optimising Annotation Field Binding - better code gen for the cases where the user just wants a field from the | ||||
* annotation on a method but not the whole annotation. | * annotation on a method but not the whole annotation. |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc1610; | package org.aspectj.systemtest.ajc1610; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class Ajc1610Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc1610Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc1610; | package org.aspectj.systemtest.ajc1610; | ||||
import java.io.File; | |||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.Method; | import org.aspectj.apache.bcel.classfile.Method; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { | public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public void testMakeSJPOptimizationLDCNo() { | public void testMakeSJPOptimizationLDCNo() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc1611; | package org.aspectj.systemtest.ajc1611; | ||||
import java.io.File; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.Method; | import org.aspectj.apache.bcel.classfile.Method; | ||||
import org.aspectj.systemtest.ajc150.GenericsTests; | import org.aspectj.systemtest.ajc150.GenericsTests; |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc1611; | package org.aspectj.systemtest.ajc1611; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { | public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public void testAddingRemoving() { | public void testAddingRemoving() { |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc1612; | package org.aspectj.systemtest.ajc1612; | ||||
import java.io.File; | |||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.Method; | import org.aspectj.apache.bcel.classfile.Method; | ||||
import org.aspectj.asm.internal.ProgramElement; | import org.aspectj.asm.internal.ProgramElement; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
/** | /** | ||||
* @author Andy Clement | * @author Andy Clement | ||||
*/ | */ |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc162; | package org.aspectj.systemtest.ajc162; | ||||
import java.io.File; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import junit.framework.Test; | import junit.framework.Test; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
// AspectJ1.6.2 | // AspectJ1.6.2 |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc163; | package org.aspectj.systemtest.ajc163; | ||||
import java.io.File; | |||||
import java.util.List; | import java.util.List; | ||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.classfile.JavaClass; | import org.aspectj.apache.bcel.classfile.JavaClass; | ||||
import org.aspectj.apache.bcel.classfile.LocalVariable; | import org.aspectj.apache.bcel.classfile.LocalVariable; | ||||
import org.aspectj.apache.bcel.classfile.LocalVariableTable; | import org.aspectj.apache.bcel.classfile.LocalVariableTable; | ||||
import org.aspectj.testing.Utils; | import org.aspectj.testing.Utils; | ||||
import org.aspectj.testing.XMLBasedAjcTestCase; | import org.aspectj.testing.XMLBasedAjcTestCase; | ||||
import junit.framework.Test; | |||||
public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public void testGenericMethodBridging_pr251326() { | public void testGenericMethodBridging_pr251326() { | ||||
runTest("itd anonymous inner class in wrong package"); | runTest("itd anonymous inner class in wrong package"); |
*******************************************************************************/ | *******************************************************************************/ | ||||
package org.aspectj.systemtest.ajc164; | package org.aspectj.systemtest.ajc164; | ||||
import java.io.File; | |||||
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; |