Skip to content

Support for JUnit 5 parameterized tests #107

Closed

Description

@dsyer

This actually runs:

@RunWith(Parameterized.class)
public class ParamTests {

    @Parameters
	public static List<Object[]> parameters() {
        return Arrays.asList(new Object[] {"foo"}, new Object[] {"bar"});
    }

   public ParamTests(String value) {}

   @Test
   public void test() {
       Assert.assertTrue(true);
   }
}

But the status is "?" and the report says that no tests were run, with no failures.

Logs:

"location":"java:test://com.example.demo.ParamTests"}}>
@@<{"name":"testSuiteStarted", "attributes":{"name":"com.example.demo.ParamTests", "location":"java:test://com.example.demo.ParamTests"}}>
@@<{"name":"testStarted", "attributes":{"name":"test[0]", "location":"java:test://com.example.demo.ParamTests.test[0]"}}>
@@<{"name":"testFinished", "attributes":{"name":"test[0]", "duration":"1"}}>
@@<{"name":"testStarted", "attributes":{"name":"test[1]", "location":"java:test://com.example.demo.ParamTests.test[1]"}}>
@@<{"name":"testFinished", "attributes":{"name":"test[1]", "duration":"0"}}>
@@<{"name":"testSuiteFinished", "attributes":{"name":"com.example.demo.ParamTests"}}>
Total tests run: 2, Failures: 0, Skips: 0

Activity

  1. ansyral commented on Feb 9, 2018

    @ansyral
    Collaborator

    Dave Syer (@dsyer) The feature for parameterized tests is postponed as we need to redesign how to show the status of a composite test which is actually a test collection.

  2. SSimcox commented on Jul 9, 2018

    @SSimcox

    Is there any headway on this? This is actually the last thing keeping Netbeans installed on my computer right now.

  3. ansyral commented on Jul 10, 2018

    @ansyral
    Collaborator

    Steven Simcox (@SSimcox) thanks for the feedback, we'll take it in consideration!

  4. shawmanz32na commented on Sep 21, 2018

    @shawmanz32na

    The JUnit 5 parameterized tests should also be supported, e.g.

    class ParamTests {
        static Stream<String> parameters() {
            return Stream.of("foo, "bar");
        }
    
        @ParameterizedTest
        @MethodSource("parameters")
        void test() {
            Assert.assertTrue(true);
        }
    }
    
  5. added this to the 0.12.0 milestone on Nov 23, 2018
  6. changed the title [-]Support for parameterized tests[/-] [+]Support for JUnit 5 parameterized tests[/+] on Nov 25, 2018
  7. Anatoly03 commented on Apr 19, 2023

    @Anatoly03

    Screenshot 2023-04-19 at 17 59 35

    I experience the issue although it was considered completed? Downloaded the latest java extensions for VSC today

  8. jdneo commented on Apr 20, 2023

    @jdneo
    Member

    image

    Anatoly Weinstein (@Anatoly03) Please file an issue with repro steps if it's not working.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions