aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten <mkersten>2003-07-29 11:00:21 +0000
committermkersten <mkersten>2003-07-29 11:00:21 +0000
commitee03a3e557204184380193807326d1131c1f2777 (patch)
tree712e4b755d59b6079e438072b0342c0fe8c6523f
parentbdf332c2ed9e2fe6ca4592b0f05c4305c0a751b8 (diff)
downloadaspectj-ee03a3e557204184380193807326d1131c1f2777.tar.gz
aspectj-ee03a3e557204184380193807326d1131c1f2777.zip
Added test case for bug#39959.
Fails because classpath is incorrectly set to include aspectjtools.jar (by the harness).
-rw-r--r--tests/bugs/bootstrapClasspath/UsesDOMParser.java66
-rw-r--r--tests/bugs/bootstrapClasspath/xerces.jarbin0 -> 1812019 bytes
-rw-r--r--tests/mikTests.xml10
3 files changed, 76 insertions, 0 deletions
diff --git a/tests/bugs/bootstrapClasspath/UsesDOMParser.java b/tests/bugs/bootstrapClasspath/UsesDOMParser.java
new file mode 100644
index 000000000..354b57b55
--- /dev/null
+++ b/tests/bugs/bootstrapClasspath/UsesDOMParser.java
@@ -0,0 +1,66 @@
+import org.xml.sax.SAXException;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import org.xml.sax.InputSource;
+import org.apache.xerces.parsers.DOMParser;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.io.PrintWriter;
+import org.w3c.dom.Document;
+
+//public class UsesDOMParser {
+//
+// public static void main(String[] args) throws Exception {
+// PipedInputStream in = new PipedInputStream();
+// DOMParser parser = new DOMParser();
+// parser.parse(new InputSource(in));
+// System.out.println("All done!");
+// }
+//}
+
+public class UsesDOMParser {
+
+ public static void main(String[] args) throws Exception {
+ PipedInputStream in = new PipedInputStream();
+ final PipedOutputStream out = new PipedOutputStream(in);
+
+ Thread t = new Thread() {
+ public void run() {
+ try {
+ String str =
+ "<?xml version=\"1.0\"?>\n"
+ + "<test>\n"
+ + " <goes>\n"
+ + " <here>yeah</here>\n"
+ + " </goes>\n"
+ + "</test>\n";
+
+ PrintWriter o = new PrintWriter(out);
+ o.println(str);
+ o.flush();
+ o.close();
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ String error =
+ e.getClass().getName() + ": " + e.getMessage();
+ throw new RuntimeException(error);
+ }
+ }
+ };
+
+ t.start();
+
+ DOMParser parser = new DOMParser();
+ parser.parse(new InputSource(in));
+ Document doc = parser.getDocument();
+ org.w3c.dom.Element root = doc.getDocumentElement();
+
+ t.join();
+
+ System.out.println("All done!");
+ }
+} // end class \ No newline at end of file
diff --git a/tests/bugs/bootstrapClasspath/xerces.jar b/tests/bugs/bootstrapClasspath/xerces.jar
new file mode 100644
index 000000000..7410f0c33
--- /dev/null
+++ b/tests/bugs/bootstrapClasspath/xerces.jar
Binary files differ
diff --git a/tests/mikTests.xml b/tests/mikTests.xml
new file mode 100644
index 000000000..111011c01
--- /dev/null
+++ b/tests/mikTests.xml
@@ -0,0 +1,10 @@
+
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
+
+<suite>
+ <ajc-test dir="bugs/bootstrapClasspath" pr="39959"
+ title="AJC Compiler generates invalid class files under certain circumstances.">
+ <compile files="UsesDOMParser.java" classpath="xerces.jar" />
+ <run class="UsesDOMParser"/>
+ </ajc-test>
+</suite> \ No newline at end of file