]> source.dussan.org Git - aspectj.git/commitdiff
Added test case for bug#39959.
authormkersten <mkersten>
Tue, 29 Jul 2003 11:00:21 +0000 (11:00 +0000)
committermkersten <mkersten>
Tue, 29 Jul 2003 11:00:21 +0000 (11:00 +0000)
Fails because classpath is incorrectly set to include aspectjtools.jar (by the harness).

tests/bugs/bootstrapClasspath/UsesDOMParser.java [new file with mode: 0644]
tests/bugs/bootstrapClasspath/xerces.jar [new file with mode: 0644]
tests/mikTests.xml [new file with mode: 0644]

diff --git a/tests/bugs/bootstrapClasspath/UsesDOMParser.java b/tests/bugs/bootstrapClasspath/UsesDOMParser.java
new file mode 100644 (file)
index 0000000..354b57b
--- /dev/null
@@ -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 (file)
index 0000000..7410f0c
Binary files /dev/null and b/tests/bugs/bootstrapClasspath/xerces.jar differ
diff --git a/tests/mikTests.xml b/tests/mikTests.xml
new file mode 100644 (file)
index 0000000..111011c
--- /dev/null
@@ -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