Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test-fixtures/super-implementation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Go to Super Implementation — Test Fixture

This fixture is consumed by `test-plans/java-go-to-super-implementation.yaml`.

It is a minimal self-contained Maven project intentionally configured with
JDK 11 compliance (`<release>11</release>`), so JDT runs full semantic
analysis under the JDK 21 toolchain that the E2E workflow installs.

`Derived` extends `Base` and overrides `greet()`. Hovering the overriding
`greet()` method renders vscode-java's "Go to super implementation" hover
link; the test plan clicks it and verifies navigation to `Base#greet()`.

Regression coverage for redhat-developer/vscode-java#4438, where the
"Go to super implementation" hover link was not a clickable link.
19 changes: 19 additions & 0 deletions test-fixtures/super-implementation/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>super-implementation</artifactId>
<version>1.0.0-SNAPSHOT</version>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.example;

/**
* Base class declaring the method that Derived overrides. The hover-link
* "Go to super implementation" on Derived#greet() must navigate here.
*/
public class Base {

public void greet() {
System.out.println("Hello from Base");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example;

/**
* Derived overrides the base method. Hovering the override shows the
* "Go to super implementation" link that vscode-java contributes; clicking
* it should jump to the base class.
*/
public class Derived extends Base {

@Override
public void greet() {
System.out.println("Hello from Derived");
}
}
84 changes: 84 additions & 0 deletions test-plans/java-go-to-super-implementation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Test Plan: Go to Super Implementation (hover link)
#
# Regression coverage for redhat-developer/vscode-java#4438 — the
# "Go to super implementation" link in the hover popup of an overriding
# method was not clickable in 1.55.0. This plan hovers the overriding
# method, clicks the hover link, and verifies the editor navigates to the
# super (base-class) implementation.
#
# Verifies: LS ready -> hover overriding method -> "Go to super
# implementation" hover link is present and clickable -> editor opens
# Base.java at Base#greet().
#
# Prerequisites:
# - JDK 11+ installed and available on PATH (the workflow installs JDK 21)
#
# Usage: autotest run test-plans/java-go-to-super-implementation.yaml

name: "Java Navigation — Go to Super Implementation (hover link)"
description: |
Validates the "Go to super implementation" hover link contributed by
vscode-java. Derived extends Base and overrides greet(); hovering the
overriding greet() shows a clickable link that navigates to Base#greet().

setup:
extension: "redhat.java"
extensions:
- "vscjava.vscode-java-pack"
vscodeVersion: "stable"
workspace: "../test-fixtures/super-implementation"
timeout: 300
workspaceSettings:
java.configuration.updateBuildConfiguration: "automatic"
java.import.maven.enabled: true
editor.hover.sticky: true
editor.hover.delay: 100

steps:
# ── Wait for LS ready ─────────────────────────────────────────
- id: "ls-ready"
action: "waitForLanguageServer"
verify: "super-implementation project has been imported; the Java extension is activated and pom.xml is visible in the Explorer"
timeout: 300
waitBefore: 10
# waitForLanguageServer is authoritative — skip LLM screenshot re-check.
skipLlmVerify: true

# ── Open the overriding subclass ──────────────────────────────
- id: "open-derived"
action: "open file Derived.java"
verify: "Derived.java is open in the editor and shows the overriding greet() method"
verifyEditor:
contains: "public void greet"
waitBefore: 5
timeout: 15

# ── Hover the overriding method ───────────────────────────────
# The first "greet" occurrence in the visible editor is the overriding
# declaration. Hovering it renders vscode-java's hover popup which
# includes the "Go to super implementation" link. The after-step
# screenshot captures the open popup; the LLM verify confirms the link
# is actually shown (the regression for #4438 is exactly this link
# being absent / not rendered as a clickable link).
- id: "hover-greet"
action: "hoverOnText greet"
verify: "A hover popup is open over the overriding greet() method and it contains a clickable 'Go to super implementation' link"
waitBefore: 5
timeout: 30

# ── Click the hover link ──────────────────────────────────────
# This is the regression assertion for #4438: the link must be a
# clickable element that triggers navigation to the super method.
- id: "click-super-link"
action: "clickHoverAction Go to super implementation"
verify: "The 'Go to super implementation' hover link was clicked and the editor navigated from Derived.java to the base class — Base.java is now opening with the cursor moving onto Base#greet()"
timeout: 15

# ── Verify navigation landed on Base#greet() ──────────────────
- id: "verify-base-open"
action: "wait 2 seconds"
verify: "Base.java is the active editor tab and the cursor sits on the base greet() method (Hello from Base body visible) — navigation to the super implementation succeeded via the hover link"
verifyEditor:
fileName: "Base.java"
contains: "Hello from Base"
timeout: 15
Loading