maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Philipp (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SUREFIRE-1546) JUnit 5 runner does not honor JUnit 5 display names
Date Sun, 14 Apr 2019 07:48:00 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816884#comment-16816884
] 

Marc Philipp edited comment on SUREFIRE-1546 at 4/14/19 7:47 AM:
-----------------------------------------------------------------

{code:java}
@DisplayName("Some tests"
class SomeTests {
  @ParameterizedTest(name = "x = {0}")
  @DisplayName("a parameterized test")
  @ValueSource(intValue = {15, 54})
  void bar(int x) {}
}
{code}
Given the code above, the test tree would look like the following:
{code:java}
JUnit Jupiter
└── Some tests (com.acme.SomeTests)
    └── a parameterized test (bar(int))
        ├── x = 15 (bar(int)[0])
        └── x = 54 (bar(int)[1])
{code}
I put the "legacy reporting name" that JUnit provides in parentheses.

In the long run, I think Surefire should move beyond the strict class-method tuple requirement.
As [~sor] mentioned above, that will require a new reporting format which we plan to work
on for JUnit 5.6. For now, Surefire could combine the display name of the method ("a parameterized
test") with the one for the invocation ("x = ...").


was (Author: marcphilipp):
{code:java}
@DisplayName("Some tests"
class SomeTests {
  @ParameterizedTest(name = "x = {0}")
  @DisplayName("a parameterized test")
  @ValueSource(intValue = {15, 54})
  void bar(int x) {}
}
{code}

Given the code above, the test tree would look like the following:

{code}
JUnit Jupiter
└── Some tests (com.acme.SomeTests)
    └── a parameterized test (bar(int))
        ├── x = 15 (bar(int)[0])
        └── x = 54 (bar(int)[1])
{code}

In put the "legacy reporting name" that JUnit provides in parentheses.

In the long run, I think Surefire should move beyond the strict class-method tuple requirement.
As [~sor] mentioned above, that will require a new reporting format which we plan to work
on for JUnit 5.6. For now, Surefire could combine the display name of the method ("a parameterized
test") with the one for the invocation ("x = ...").

> JUnit 5 runner does not honor JUnit 5 display names
> ---------------------------------------------------
>
>                 Key: SUREFIRE-1546
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1546
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 5.x support
>    Affects Versions: 2.22.0
>            Reporter: Romain Manni-Bucau
>            Assignee: Tibor Digana
>            Priority: Major
>              Labels: junit5
>             Fix For: 3.0.0-M4
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> JUnit 5 runner should respect the test @DisplayName instead of displaying the classname
if any is defined. Seems last release doesn't support that feature of JUnit 5 making the console
output and reports not the expected ones.
>  
> Origin: https://github.com/junit-team/junit5/issues/990



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message