Wrong test name displayed for JUnit 4 parameterized test
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, typescript
- Domain
- testing-qa
Research direction
Start in src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts at the linked code near line 457. Reproduce the JUnit 4 parameterized test with inputs such as "()" and "(()", then inspect how the displayed name is derived from the parameterized name. Done means names containing rounded brackets are handled correctly without breaking the other sample inputs.
Written by the indexing model from the issue text.
Description
Sample code:
@RunWith(Parameterized.class)
public class ParameterizedWithNameTest {
@Parameter
public int expected;
@Parameters(name = "{index}: expect={0}")
public static Collection<Object> data() {
// If using the name annotation param and one of the inputs has a rounded
// bracket, e.g. @Parameters(name = "test({index})"), then the test name needs
// to be properly handled.
return Arrays.asList(1, 2, "normalString", "()", "(()");
}
@Test
public void test() {
assertEquals(expected, 1);
}
}
Run the test will get:

Root cause is that here it's just check the position of (:
https://github.com/microsoft/vscode-java-test/blob/e7c10db82a0cbd0d8d11515fe51153a2e00cb584/src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts#L457
- Dominant language
- TypeScript
- Stars
- 340
- Forks
- 173
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-java-test
-
ai-triaged bug investigating junit test-discovery test-execution
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/vscode-java-test#1897 · 1 comment ·
-
ai-triaged bug gradle high-priority test-execution
microsoft/vscode-java-test#1880 · 2 comments · 1 assignee ·
-
ai-triaged gradle junit test-execution ux
microsoft/vscode-java-test#1878 · 3 comments · 1 assignee ·
-
ai-triaged enhancement junit low-priority test-execution ui
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/vscode-java-test#1836 · 4 comments ·
-
ai-triaged enhancement gradle investigating junit low-priority test-reporting
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/vscode-java-test#1824 · 1 comment ·
All issues in microsoft/vscode-java-test
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100