Skip to content

Commit 8e2381d

Browse files
committed
Disable a few tests on Win until JDT Core 3.41
1 parent d682a40 commit 8e2381d

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/annotations/AnnotationHierarchiesTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import org.eclipse.jdt.core.dom.MarkerAnnotation;
3030
import org.junit.jupiter.api.AfterEach;
3131
import org.junit.jupiter.api.Test;
32+
import org.junit.jupiter.api.condition.DisabledOnOs;
33+
import org.junit.jupiter.api.condition.OS;
3234
import org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava;
3335
import org.springframework.ide.vscode.commons.java.IJavaProject;
3436
import org.springframework.ide.vscode.project.harness.ProjectsHarness;
@@ -64,6 +66,8 @@ void tearDown() {
6466
}
6567

6668
@Test
69+
//TODO: Enable when JDT Core 3.41 or higher is adopted. See: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3416
70+
@DisabledOnOs(OS.WINDOWS)
6771
void circularAnnotations() throws Exception {
6872
String projectName = "test-spring-validations";
6973
IJavaProject project = ProjectsHarness.INSTANCE.mavenProject(projectName);

headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingDependentConstantChangedTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static org.junit.jupiter.api.Assertions.*;
1414

1515
import java.io.File;
16+
import java.nio.charset.Charset;
1617
import java.nio.file.Path;
1718
import java.util.List;
1819
import java.util.Optional;
@@ -25,6 +26,8 @@
2526
import org.eclipse.lsp4j.WorkspaceSymbol;
2627
import org.junit.jupiter.api.BeforeEach;
2728
import org.junit.jupiter.api.Test;
29+
import org.junit.jupiter.api.condition.DisabledOnOs;
30+
import org.junit.jupiter.api.condition.OS;
2831
import org.junit.jupiter.api.extension.ExtendWith;
2932
import org.springframework.beans.factory.annotation.Autowired;
3033
import org.springframework.context.annotation.Import;
@@ -76,6 +79,8 @@ public void customize(CustomizableProjectContent projectContent) throws Exceptio
7679
}
7780

7881
@Test
82+
//TODO: Enable when JDT Core 3.41 or higher is adopted. See: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3416
83+
@DisabledOnOs(OS.WINDOWS)
7984
void testSimpleRequestMappingSymbolFromConstantInDifferentClass() throws Exception {
8085
String docUri = directory.resolve("src/main/java/org/test/SimpleMappingClassWithConstantInDifferentClass.java").toUri().toString();
8186
String constantsUri = directory.resolve("src/main/java/org/test/Constants.java").toUri().toString();
@@ -144,6 +149,8 @@ void testRequestMappingSymbolFromConstantChained() throws Exception {
144149
}
145150

146151
@Test
152+
//TODO: Enable when JDT Core 3.41 or higher is adopted. See: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3416
153+
@DisabledOnOs(OS.WINDOWS)
147154
void testCyclicalDependency() throws Exception {
148155
//cyclical dependency between two files (ping refers pong and vice versa)
149156

@@ -228,7 +235,7 @@ private void assertSymbol(String docUri, String name, String coveredText) throws
228235
assertTrue(maybeSymbol.isPresent());
229236

230237
TextDocument doc = new TextDocument(docUri, LanguageId.JAVA);
231-
doc.setText(FileUtils.readFileToString(UriUtil.toFile(docUri)));
238+
doc.setText(FileUtils.readFileToString(UriUtil.toFile(docUri), Charset.defaultCharset()));
232239

233240
WorkspaceSymbol symbol = maybeSymbol.get();
234241
Location loc = symbol.getLocation().getLeft();

headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingSymbolProviderTest.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import static org.junit.jupiter.api.Assertions.assertTrue;
1515

1616
import java.io.File;
17+
import java.nio.charset.Charset;
1718
import java.util.Iterator;
1819
import java.util.List;
1920
import java.util.Optional;
@@ -26,6 +27,8 @@
2627
import org.eclipse.lsp4j.WorkspaceSymbol;
2728
import org.junit.jupiter.api.BeforeEach;
2829
import org.junit.jupiter.api.Test;
30+
import org.junit.jupiter.api.condition.DisabledOnOs;
31+
import org.junit.jupiter.api.condition.OS;
2932
import org.junit.jupiter.api.extension.ExtendWith;
3033
import org.springframework.beans.factory.annotation.Autowired;
3134
import org.springframework.context.annotation.Import;
@@ -81,6 +84,8 @@ void testSimpleRequestMappingSymbol() throws Exception {
8184
}
8285

8386
@Test
87+
//TODO: Enable when JDT Core 3.41 or higher is adopted. See: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3416
88+
@DisabledOnOs(OS.WINDOWS)
8489
void testSimpleRequestMappingSymbolFromConstantInDifferentClass() throws Exception {
8590
String docUri = directory.toPath().resolve("src/main/java/org/test/SimpleMappingClassWithConstantInDifferentClass.java").toUri().toString();
8691
String constantsUri = directory.toPath().resolve("src/main/java/org/test/Constants.java").toUri().toString();
@@ -95,7 +100,7 @@ void testSimpleRequestMappingSymbolFromConstantInDifferentClass() throws Excepti
95100
TestFileScanListener fileScanListener = new TestFileScanListener();
96101
indexer.getJavaIndexer().setFileScanListener(fileScanListener);
97102

98-
CompletableFuture<Void> updateFuture = indexer.updateDocument(constantsUri, FileUtils.readFileToString(UriUtil.toFile(constantsUri)), "test triggered");
103+
CompletableFuture<Void> updateFuture = indexer.updateDocument(constantsUri, FileUtils.readFileToString(UriUtil.toFile(constantsUri), Charset.defaultCharset()), "test triggered");
99104
updateFuture.get(5, TimeUnit.SECONDS);
100105

101106
fileScanListener.assertScannedUris(constantsUri, docUri);
@@ -104,6 +109,8 @@ void testSimpleRequestMappingSymbolFromConstantInDifferentClass() throws Excepti
104109
}
105110

106111
@Test
112+
//TODO: Enable when JDT Core 3.41 or higher is adopted. See: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3416
113+
@DisabledOnOs(OS.WINDOWS)
107114
void testUpdateDocumentWithConstantFromDifferentClass() throws Exception {
108115
String docUri = directory.toPath().resolve("src/main/java/org/test/SimpleMappingClassWithConstantInDifferentClass.java").toUri().toString();
109116
String constantsUri = directory.toPath().resolve("src/main/java/org/test/Constants.java").toUri().toString();
@@ -118,7 +125,7 @@ void testUpdateDocumentWithConstantFromDifferentClass() throws Exception {
118125
TestFileScanListener fileScanListener = new TestFileScanListener();
119126
indexer.getJavaIndexer().setFileScanListener(fileScanListener);
120127

121-
CompletableFuture<Void> updateFuture = indexer.updateDocument(docUri, FileUtils.readFileToString(UriUtil.toFile(docUri)), "test triggered");
128+
CompletableFuture<Void> updateFuture = indexer.updateDocument(docUri, FileUtils.readFileToString(UriUtil.toFile(docUri), Charset.defaultCharset()), "test triggered");
122129
updateFuture.get(5, TimeUnit.SECONDS);
123130

124131
assertEquals(ImmutableSet.of("Lorg/test/Constants;"), dt.getAllDependencies().get(UriUtil.toFileString(docUri)));
@@ -129,6 +136,8 @@ void testUpdateDocumentWithConstantFromDifferentClass() throws Exception {
129136
}
130137

131138
@Test
139+
//TODO: Enable when JDT Core 3.41 or higher is adopted. See: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3416
140+
@DisabledOnOs(OS.WINDOWS)
132141
void testCyclicalRequestMappingDependency() throws Exception {
133142
//Cyclical dependency:
134143
//file a => file b => file a
@@ -352,7 +361,7 @@ private void assertSymbol(String docUri, String name, String coveredText) throws
352361
assertTrue(maybeSymbol.isPresent());
353362

354363
TextDocument doc = new TextDocument(docUri, LanguageId.JAVA);
355-
doc.setText(FileUtils.readFileToString(UriUtil.toFile(docUri)));
364+
doc.setText(FileUtils.readFileToString(UriUtil.toFile(docUri), Charset.defaultCharset()));
356365

357366
WorkspaceSymbol symbol = maybeSymbol.get();
358367
Location loc = symbol.getLocation().getLeft();

0 commit comments

Comments
 (0)