microsoft / microsoft/vscode-java-test
Wrong test name displayed for JUnit 4 parameterized test
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 340
- Forks
- 173
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 18
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
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.
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.
Assessment
- Tech stack
- java, typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100