Skip to content

Fails to load JUnit launch configuration in @ParameterizedTest that has any parameter whose type has generic types #1053

Closed

Description

I'm using

JUnit 5.6.2
Java Test Runner 0.24.1

In the description of the extension page, it says it supports JUnit 5 (v5.1.0+)

When I click Run Test or Debug Test button above a @ParameterizedTest method that has any parameter whose type has generic parameter(s) - like List<Integer> or Map<Integer, Integer> - Java Test Runner says Error: Failed to load JUnit launch configuration. Strangely, it doesn't fail to launch tests if I click Run Test or Debug Test button above the class of @ParameterizedTest methods.

It successes in below code.

@ParameterizedTest
@MethodSource
Run Test | Debug Test // click any botton
void test(Object listObject) {
	List<Integer> list = (List<Integer>) listObject;
    ...
}
	
static Stream<Arguments> test() {
	return ...
}

But fails in below code.

@ParameterizedTest
@MethodSource
Run Test | Debug Test // click any botton
void test(List<Integer> list) {
	...
}
	
static Stream<Arguments> test() {
	return ...
}

It doesn't even fail in below code.

Run Test | Debug Test // click any botton
public class Test{
	@ParameterizedTest
	@MethodSource
	void test(List<Integer> list) {
        ...
	}
	
	static Stream<Arguments> test() {
		return ...
	}
}

It doesn't even fail when you execute the test by gradle.

./gradlew.bat test --tests *Test.test

Activity

  1. jdneo commented on Sep 1, 2020

    @jdneo
    Member

    Seems that the parameter type of the test name should be java.util.List instead of java.util.List<java.lang.Integer>

    Will make a fix later

  2. added this to the 0.25.0 milestone on Sep 1, 2020
  3. jdneo commented on Sep 3, 2020

    @jdneo
    Member

    Hotfix for this issue will release in early next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions