diff options
author | Philipe Mulet | 2006-03-27 14:33:15 +0000 |
---|---|---|
committer | Philipe Mulet | 2006-03-27 14:33:15 +0000 |
commit | 8c631374d51cd9cce66092e187c2523badcba90a (patch) | |
tree | 4619c7d9e31fd0e79918549a409b35c1ad5aa2a8 /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java | |
parent | a5577117cb4a612450eddce3c0b20eb90f21cb89 (diff) | |
download | eclipse.jdt.core-8c631374d51cd9cce66092e187c2523badcba90a.tar.gz eclipse.jdt.core-8c631374d51cd9cce66092e187c2523badcba90a.tar.xz eclipse.jdt.core-8c631374d51cd9cce66092e187c2523badcba90a.zip |
123476
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java')
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java index 1fed94f697..7622907b15 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java @@ -13,6 +13,7 @@ package org.eclipse.jdt.core.tests.compiler.regression; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.IOException; import java.io.PrintWriter; import java.text.MessageFormat; @@ -2815,6 +2816,79 @@ public void test051(){ true); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=123476 +public void test052(){ + try { + File barFile = new File(OUTPUT_DIR + File.separator + "Bar.java"); + FileOutputStream barOutput = new FileOutputStream(barFile); + try { + String barContents = + "public class Bar \n" + + "{ \n" + + " Bar(int class) \n" + + " { \n" + + " } \n" + + "}\n"; + barOutput.write(barContents.getBytes()); + } finally { + barOutput.close(); + } + } catch(IOException e) { + // do nothing, will fail below + } + + this.runNegativeTest( + new String[] { + "X.java", + "public class X\n" + + "{\n" + + " static Object x()\n" + + " {\n" + + " return new Bar(5);\n" + + " }\n" + + "}\n", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -cp \"" + OUTPUT_DIR + File.pathSeparator + "\"" + + " -d \"" + OUTPUT_DIR + "\"", + "", + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + + " (at line 5)\n" + + " return new Bar(5);\n" + + " ^^^^^^^^^^\n" + + "The constructor Bar(int) is undefined\n" + + "----------\n" + + "----------\n" + + "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/Bar.java\n" + + " (at line 2)\n" + + " { \n" + + " ^\n" + + "Syntax error, insert \"}\" to complete ClassBody\n" + + "----------\n" + + "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/Bar.java\n" + + " (at line 3)\n" + + " Bar(int class) \n" + + " ^^^^^\n" + + "Syntax error on token \"class\", invalid VariableDeclaratorId\n" + + "----------\n" + + "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/Bar.java\n" + + " (at line 3)\n" + + " Bar(int class) \n" + + " { \n" + + " } \n" + + " ^^^^^^^^^^^^^^^^\n" + + "Syntax error on tokens, delete these tokens\n" + + "----------\n" + + "5. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/Bar.java\n" + + " (at line 6)\n" + + " }\n" + + " ^\n" + + "Syntax error on token \"}\", delete this token\n" + + "----------\n" + + "5 problems (5 errors)", + false); +} public static Class testClass() { return BatchCompilerTest.class; } |