Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 53022 Details for
Bug 162903
SuppressWarnings and NON-NLS'd strings as errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated regression tests
patch_162903_tests.txt (text/plain), 4.12 KB, created by
Olivier Thomann
on 2006-10-31 14:50:20 EST
(
hide
)
Description:
Updated regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-10-31 14:50:20 EST
Size:
4.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java,v >retrieving revision 1.6 >diff -u -r1.6 ExternalizeStringLiterals15Test.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java 11 May 2006 10:23:40 -0000 1.6 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java 31 Oct 2006 19:54:12 -0000 >@@ -20,7 +20,7 @@ > > static { > // TESTS_NAMES = new String[] { "test000" }; >-// TESTS_NUMBERS = new int[] { 3 }; >+// TESTS_NUMBERS = new int[] { 6 }; > // TESTS_RANGE = new int[] { 11, -1 }; > } > public ExternalizeStringLiterals15Test(String name) { >@@ -81,6 +81,21 @@ > " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + > " ^^^^^^^^^^^^^\n" + > "Unnecessary $NON-NLS$ tag\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " String s5 = \"test3\";\n" + >+ " ^^^^^^^\n" + >+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 9)\n" + >+ " String s6 = \"test4\";\n" + >+ " ^^^^^^^\n" + >+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 10)\n" + >+ " System.out.println(\"test5\");\n" + >+ " ^^^^^^^\n" + >+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + > "----------\n", > null, > true, >@@ -110,6 +125,21 @@ > " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + > " ^^^^^^^^^^^^^\n" + > "Unnecessary $NON-NLS$ tag\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " String s5 = null;//$NON-NLS-1$\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Unnecessary $NON-NLS$ tag\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 9)\n" + >+ " String s6 = \"test4\";\n" + >+ " ^^^^^^^\n" + >+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 10)\n" + >+ " System.out.println(\"test5\");\n" + >+ " ^^^^^^^\n" + >+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + > "----------\n", > null, > true, >@@ -144,6 +174,53 @@ > true, > customOptions); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903 >+public void test005() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "class X {\n" + >+ " @SuppressWarnings(\"nls\")\n" + >+ " void foo() {\n" + >+ " String s6 = \"SUCCESS\";\n" + >+ " System.out.println(s6);\n" + >+ " }\n" + >+ "}", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " String s6 = \"SUCCESS\";\n" + >+ " ^^^^^^^^^\n" + >+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + >+ "----------\n", >+ null, >+ true, >+ customOptions); >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903 >+public void test006() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @SuppressWarnings(\"nls\")\n" + >+ " public static void main(String[] args) {\n" + >+ " String s6 = \"SUCCESS\";\n" + >+ " System.out.println(s6);\n" + >+ " }\n" + >+ "}", >+ }, >+ "SUCCESS", >+ null, >+ true, >+ null, >+ customOptions, >+ null); >+} > public static Class testClass() { > return ExternalizeStringLiterals15Test.class; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162903
:
53020
| 53022