aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorwisberg <wisberg>2005-06-09 15:57:10 +0000
committerwisberg <wisberg>2005-06-09 15:57:10 +0000
commit6b4238eb0f0871eae60d71fe596c96c2ae5dce76 (patch)
tree7757f5e169ad0e12fa4401864dee398e4035bdbb /testing
parente0e3389181b6ca1a88ed12e988abd4d4eb533ddd (diff)
downloadaspectj-6b4238eb0f0871eae60d71fe596c96c2ae5dce76.tar.gz
aspectj-6b4238eb0f0871eae60d71fe596c96c2ae5dce76.zip
unused imports (only)
Diffstat (limited to 'testing')
-rw-r--r--testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java34
-rw-r--r--testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java7
2 files changed, 37 insertions, 4 deletions
diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java
index 7db54e005..22cb30338 100644
--- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java
+++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java
@@ -16,6 +16,7 @@ import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
+import java.util.Stack;
import junit.extensions.TestSetup;
import junit.framework.Test;
@@ -39,6 +40,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase {
private static Map testMap = new HashMap();
private static boolean suiteLoaded = false;
private AjcTest currentTest = null;
+ private Stack clearTestAfterRun = new Stack();
public XMLBasedAjcTestCase() {
}
@@ -96,11 +98,20 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase {
*/
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);
+ }
}
/**
@@ -119,6 +130,25 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase {
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
diff --git a/testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java b/testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java
index 28912a026..8e13e5778 100644
--- a/testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java
+++ b/testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java
@@ -471,14 +471,17 @@ public class AjcSpecXmlReader {
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;
}
}
}