import org.aspectj.ajde.internal.CompilerAdapter;
import org.aspectj.bridge.IMessage;
-import org.aspectj.tools.ajc.AjcTestCase;
import org.aspectj.util.FileUtil;
import org.aspectj.util.LangUtil;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.aspectj.util.LangUtil;
-
/**
* @author Mik Kersten
*/
* Contributors:
* Mik Kersten initial implementation
* ******************************************************************/
-import java.io.File;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.aspectj.tools.ajdoc.AjdocTests;
-import org.aspectj.util.FileUtil;
/**
* @author Mik Kersten
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
-import java.util.Set;
/**
* The runtime representation of a type (Aspect, Class, Interface, Annotation, Enum, or Array) in an AspectJ
package org.aspectj.tools.ajc;
-import java.io.File;
-
import org.aspectj.testing.util.TestUtil;
import junit.framework.Test;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
+import java.util.Stack;
import junit.extensions.TestSetup;
import junit.framework.Test;
private static Map testMap = new HashMap();
private static boolean suiteLoaded = false;
private AjcTest currentTest = null;
+ private Stack clearTestAfterRun = new Stack();
public XMLBasedAjcTestCase() {
}
*/
protected void runTest(String title) {
currentTest = (AjcTest) testMap.get(title);
+ final boolean clearTest = clearTestAfterRun();
if (currentTest == null) {
- fail("No test '" + title + "' in suite.");
- }
+ if (clearTest) {
+ System.err.println("test already run: " + title);
+ return;
+ } else {
+ fail("No test '" + title + "' in suite.");
+ }
+ }
ajc.setShouldEmptySandbox(true);
currentTest.runTest(this);
+ if (clearTest) {
+ testMap.remove(title);
+ }
}
/**
public void addTest(AjcTest test) {
testMap.put(test.getTitle(),test);
}
+ protected final void pushClearTestAfterRun(boolean val) {
+ clearTestAfterRun.push(val ? Boolean.FALSE: Boolean.TRUE);
+ }
+ protected final boolean popClearTestAfterRun() {
+ return clearTest(true);
+ }
+ protected final boolean clearTestAfterRun() {
+ return clearTest(false);
+ }
+ private boolean clearTest(boolean pop) {
+ if (clearTestAfterRun.isEmpty()) {
+ return false;
+ }
+ boolean result = ((Boolean) clearTestAfterRun.peek()).booleanValue();
+ if (pop) {
+ clearTestAfterRun.pop();
+ }
+ return result;
+ }
/*
* The rules for parsing a suite spec file. The Digester using bean properties to match attributes
String publicId,
String systemId)
throws SAXException {
+ InputSource result = null;
if ((null != systemId) &&
systemId.endsWith(NAME)) {
String path = getPath(systemId);
if (null != path) {
- return new InputSource(path);
+ result = new InputSource(path);
+ result.setSystemId(path);
+ result.setPublicId(path);
}
}
- return null;
+ return result;
}
}
}
import org.aspectj.systemtest.ajc11.Ajc11Tests;
import org.aspectj.systemtest.ajc120.Ajc120Tests;
import org.aspectj.systemtest.ajc121.Ajc121Tests;
-import org.aspectj.systemtest.ajc150.AllTestsAspectJ150;
import org.aspectj.systemtest.aspectpath.AspectPathTests;
import org.aspectj.systemtest.base.BaseTests;
import org.aspectj.systemtest.design.DesignTests;
import org.aspectj.apache.bcel.generic.InstructionFactory;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InstructionList;
-import org.aspectj.apache.bcel.generic.ReferenceType;
import org.aspectj.apache.bcel.generic.InstructionConstants;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.Message;
import org.aspectj.weaver.TypeX;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.World;
-import org.aspectj.weaver.PerObjectInterfaceTypeMunger;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.patterns.ExactTypePattern;
import org.aspectj.weaver.patterns.ExposedState;
import org.aspectj.weaver.patterns.Pointcut;
-import org.aspectj.weaver.patterns.PerClause;
-import org.aspectj.weaver.patterns.PerObject;
-import org.aspectj.weaver.patterns.PerFromSuper;
/**
* Advice implemented for bcel.
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.WeaverMetrics;
import org.aspectj.weaver.WeaverStateInfo;
-import org.aspectj.weaver.PerObjectInterfaceTypeMunger;
import org.aspectj.weaver.Shadow.Kind;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.FastMatchInfo;
import org.aspectj.apache.bcel.generic.StoreInstruction;
import org.aspectj.apache.bcel.generic.TargetLostException;
import org.aspectj.apache.bcel.generic.Type;
-import org.aspectj.apache.bcel.generic.ReferenceType;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.weaver.WeaverMetrics;
import org.aspectj.weaver.WeaverStateInfo;
import org.aspectj.weaver.World;
-import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.patterns.AndPointcut;
import org.aspectj.weaver.patterns.BindingAnnotationTypePattern;
import org.aspectj.weaver.patterns.BindingTypePattern;
import org.aspectj.weaver.patterns.ArgsAnnotationPointcut;
import org.aspectj.weaver.patterns.ArgsPointcut;
import org.aspectj.weaver.patterns.CflowPointcut;
-import org.aspectj.weaver.patterns.FastMatchInfo;
import org.aspectj.weaver.patterns.IfPointcut;
import org.aspectj.weaver.patterns.NotAnnotationTypePattern;
import org.aspectj.weaver.patterns.NotPointcut;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.TypeX;
import org.aspectj.weaver.AjcMemberMaker;
-import org.aspectj.weaver.bcel.AtAjAttributes;
import org.aspectj.weaver.ast.Expr;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.bcel.BcelShadow;
import org.aspectj.weaver.bcel.BcelWorld;
-import sun.reflect.generics.tree.TypeVariableSignature;
-
/**
* @author hugunin
*