diff --git a/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF b/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF
index 2e43ffc66..36a3e2aed 100644
--- a/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests for language server bundle (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e.test;singleton:=true
-Bundle-Version: 0.15.20.qualifier
+Bundle-Version: 0.15.21.qualifier
Fragment-Host: org.eclipse.lsp4e
Bundle-Vendor: Eclipse LSP4E
Bundle-RequiredExecutionEnvironment: JavaSE-17
diff --git a/org.eclipse.lsp4e.test/pom.xml b/org.eclipse.lsp4e.test/pom.xml
index 19ff14d66..8d725e91e 100644
--- a/org.eclipse.lsp4e.test/pom.xml
+++ b/org.eclipse.lsp4e.test/pom.xml
@@ -8,7 +8,7 @@
org.eclipse.lsp4e.test
eclipse-test-plugin
- 0.15.20-SNAPSHOT
+ 0.15.21-SNAPSHOT
diff --git a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/hover/HoverTest.java b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/hover/HoverTest.java
index be76a57ca..a76badf64 100644
--- a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/hover/HoverTest.java
+++ b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/hover/HoverTest.java
@@ -12,7 +12,10 @@
package org.eclipse.lsp4e.test.hover;
import static org.eclipse.lsp4e.test.utils.TestUtils.waitForAndAssertCondition;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
@@ -44,11 +47,11 @@
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
@SuppressWarnings("restriction")
@@ -154,7 +157,6 @@ public void testMultipleHovers() throws Exception {
assertNotEquals("Hover content found only once", -1, index);
}
- @Ignore("The test does not work from Eclipse 2024-12 onwards because the command org.eclipse.ui.file.close is not enabled")
@Test
public void testIntroUrlLink() throws Exception {
final var hoverResponse = new Hover(
@@ -164,7 +166,11 @@ public void testIntroUrlLink() throws Exception {
MockLanguageServer.INSTANCE.setHover(hoverResponse);
IFile file = TestUtils.createUniqueTestFile(project, "HoverRange Other Text");
- ITextViewer viewer = TestUtils.openTextViewer(file);
+ IEditorPart editorPart = TestUtils.openEditor(file);
+
+ waitForAndAssertCondition(5_000, () -> LSPEclipseUtils.getTextViewer(editorPart) != null);
+ ITextViewer viewer = LSPEclipseUtils.getTextViewer(editorPart);
+ assertEquals(UI.getActivePart(), editorPart);
String hoverContent = hover.getHoverInfo(viewer, new Region(0, 10));
@@ -196,13 +202,15 @@ public void testIntroUrlLink() throws Exception {
@Override
public void completed(ProgressEvent event) {
browser.removeProgressListener(this);
+ assertEquals(UI.getActivePart(), editorPart);
browser.execute("document.getElementsByTagName('a')[0].click()");
completed.set(true);
}
});
assertNotNull("Editor should be opened", viewer.getTextWidget());
-
+
+ UI.getActivePage().activate(editorPart);
browser.setText(hoverContent);
waitForAndAssertCondition("action didn't close editor", 10_000, browser.getDisplay(),