generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Adding the patch for netbeans PR #7910 to prevent tests failures due to CRLF line endings. - Overall, the test suite is expected to be run in an environment with: `git config --local core.autocrlf false` 2. Added the use of the extension configuration prefix "jdk" in ServerTest, as had been done for java.lsp.server/ AttachConfigurations.java and ProjectConfigurationCompletion.java, via the patch/rename-debugger.diff. Signed-off-by: Siddharth Srinivasan <[email protected]>
- Loading branch information
Showing
3 changed files
with
269 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java | ||
index ede2a586e888..a351d52bd5fc 100644 | ||
--- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java | ||
+++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java | ||
@@ -242,9 +242,11 @@ protected String performFixTest(String fileName, String code, int pos, String er | ||
String realCode = toCheckDocument.getText(0, toCheckDocument.getLength()); | ||
|
||
//ignore whitespaces: | ||
- realCode = realCode.replaceAll("[ \t\n]+", " "); | ||
+ realCode = realCode.replaceAll("[ \t\r\n]+", " "); | ||
|
||
if (golden != null) { | ||
+ //ignore CRLF/LF differences in golden: | ||
+ golden = golden.replaceAll("[ \t\r\n]+", " "); | ||
assertEquals("The output code does not match the expected code.", golden, realCode); | ||
} | ||
|
||
diff --git a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorkerTest.java b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorkerTest.java | ||
index bcd1c07c8701..fb4f11400726 100644 | ||
--- a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorkerTest.java | ||
+++ b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorkerTest.java | ||
@@ -685,6 +685,7 @@ public void testPreserveValidMethods1() throws Exception { | ||
" System.err.println(\"Hello, world!\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -729,6 +730,7 @@ public void testClearInvalidMethod() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code - compiler.err.cant.resolve.location\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -792,6 +794,7 @@ public void testPreserveValidInitializers() throws Exception { | ||
" private int F5a;\n" + | ||
" private int F5b;\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -834,6 +837,7 @@ public void testBrokenClassHeader1() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -883,6 +887,7 @@ public void testNullReturnUnknown() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -932,6 +937,7 @@ public void testBrokenNewClass() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -983,6 +989,7 @@ public void testReturnBroken() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1037,6 +1044,7 @@ public void testAssertBroken() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1117,6 +1125,7 @@ public void testAnonymousComplex() throws Exception { | ||
" };\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1165,6 +1174,7 @@ public void testFieldInit() throws Exception { | ||
" super();\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1239,6 +1249,7 @@ public void testAnonymousComplex2() throws Exception { | ||
" }\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1285,6 +1296,7 @@ public void testNewClass() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code - compiler.err.cant.apply.symbol\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1336,6 +1348,7 @@ public void testUndefNewArray() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1412,6 +1425,7 @@ public void testUndefAnonymous() throws Exception { | ||
" }\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1471,6 +1485,7 @@ public void testWeirdSuperCall() throws Exception { | ||
" }\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1590,6 +1605,7 @@ public void testAnonymousComplex3() throws Exception { | ||
" }\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1690,6 +1706,7 @@ public void testAnonymousComplex4() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code - compiler.err.cant.resolve.location.args\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1763,6 +1780,7 @@ public void testAnonymousComplexCorrect() throws Exception { | ||
" }\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1806,6 +1824,7 @@ public void testWarningsAreNotErrors() throws Exception { | ||
" }\n" + | ||
" Test t;\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1878,6 +1897,7 @@ public void testSuperCall() throws Exception { | ||
" public default void test2() {\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -1923,6 +1943,7 @@ public void testStaticInit() throws Exception { | ||
" System.err.println();\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -2161,6 +2182,7 @@ public void testMethodWithErroneousInMemberRef() throws Exception { | ||
" \n" + | ||
" public Object test(Object o);\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -2242,6 +2264,7 @@ public void testPatternSwitch() throws Exception { | ||
" throw new java.lang.RuntimeException(\"Uncompilable code\");\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -2294,6 +2317,7 @@ public void testTypeTest() throws Exception { | ||
" }\n" + | ||
" }\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -2339,6 +2363,7 @@ public void testWrongRecordComponent() throws Exception { | ||
" }\n" + | ||
" private final int wait;\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -2391,6 +2416,7 @@ public void testRecord1() throws Exception { | ||
" }\n" + | ||
" private final int i;\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
||
@@ -2428,6 +2454,7 @@ public void testRecord2() throws Exception { | ||
" }\n" + | ||
" private final int i;\n" + | ||
"}"); | ||
+ file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n")); | ||
assertEquals(expected, file2Fixed); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters