From cfcda24948baac99e8d7ff6f2a583e255b2c8490 Mon Sep 17 00:00:00 2001 From: Zsombor Gegesy Date: Sat, 26 Oct 2024 13:51:08 +0200 Subject: [PATCH] Fix clicking on a ParametrizedTest When we click on the 'grouping' element for a ParametrizedTest, the code tries to find the method without the parameter types, but the search actually tries to find a parameter-less method with the same name. --- .../src/org/eclipse/jdt/internal/junit/ui/TestViewer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestViewer.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestViewer.java index a982151d7b3..00c347c3133 100644 --- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestViewer.java +++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestViewer.java @@ -450,14 +450,14 @@ private OpenTestAction getOpenTestAction(TestSuiteElement testSuite) { if (children.length > 0 && children[0] instanceof TestCaseElement tce && tce.isDynamicTest()) { // a group of parameterized tests - return new OpenTestAction(fTestRunnerPart, (TestCaseElement) children[0], null); + return new OpenTestAction(fTestRunnerPart, tce, tce.getParameterTypes()); } if (children.length == 0) { // check if we have applied the workaround for: https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/945 TestCaseElement child= testSuite.getSingleDynamicChild(); if (child != null) { // a parameterized test that ran only one test - return new OpenTestAction(fTestRunnerPart, child, null); + return new OpenTestAction(fTestRunnerPart, child, child.getParameterTypes()); } }