You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dave Nicholas (Jira)" <ji...@apache.org> on 2022/01/17 21:24:00 UTC

[jira] [Updated] (SUREFIRE-1949) Unable to determine lifecycle method name in JUnit Jupiter beforeAll failure

     [ https://issues.apache.org/jira/browse/SUREFIRE-1949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Nicholas updated SUREFIRE-1949:
------------------------------------
    Description: 
When a @BeforeAll method fails in a JUnit Jupiter lifecycle method, the surefire-report XML file has an empty value for the testname XML attribute. Although the classname attribute is fully populated, we do not know if this lifecycle error was a result of beforeEach or beforeAll.

 

Here is sample code to reproduce the issue

 
{code:java}
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;

@TestInstance(PER_CLASS)
public class MyFirstTest {

  @BeforeAll
  public void setUp() {
      throw new RuntimeException("Exception in JUnit configuration method");
  }

  @Test
  public void myFirstTest() {
  }

}


{code}
 

Any help would be greatly appreciated.

 

Thanks

  was:
When a @BeforeAll method fails in a JUnit Jupiter lifecycle method, the surefire-report XML file has an empty value for the testname XML attribute. Although the classname attribute is fully populated, we do not know if this lifecycle error was a result of beforeEach or beforeAll.

 

Any help would be greatly appreciated.

 

Thanks


> Unable to determine lifecycle method name in JUnit Jupiter beforeAll failure
> ----------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1949
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1949
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 5.x support
>    Affects Versions: 3.0.0-M5
>            Reporter: Dave Nicholas
>            Priority: Minor
>
> When a @BeforeAll method fails in a JUnit Jupiter lifecycle method, the surefire-report XML file has an empty value for the testname XML attribute. Although the classname attribute is fully populated, we do not know if this lifecycle error was a result of beforeEach or beforeAll.
>  
> Here is sample code to reproduce the issue
>  
> {code:java}
> import org.junit.jupiter.api.BeforeAll;
> import org.junit.jupiter.api.Test;
> import org.junit.jupiter.api.TestInstance;
> import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
> @TestInstance(PER_CLASS)
> public class MyFirstTest {
>   @BeforeAll
>   public void setUp() {
>       throw new RuntimeException("Exception in JUnit configuration method");
>   }
>   @Test
>   public void myFirstTest() {
>   }
> }
> {code}
>  
> Any help would be greatly appreciated.
>  
> Thanks



--
This message was sent by Atlassian Jira
(v8.20.1#820001)