maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Digana (Jira)" <j...@apache.org>
Subject [jira] [Updated] (SUREFIRE-1794) @TestFactory method succeeds when throwing an exception with Maven Failsafe plugin
Date Thu, 21 May 2020 01:46:00 GMT

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

Tibor Digana updated SUREFIRE-1794:
-----------------------------------
    Fix Version/s:     (was: 3.0.0-M6)

> @TestFactory method succeeds when throwing an exception with Maven Failsafe plugin
> ----------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1794
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1794
>             Project: Maven Surefire
>          Issue Type: Task
>            Reporter: Zhenxu Ke
>            Priority: Major
>
> Hi, this is an issue transferred from [https://github.com/junit-team/junit5/issues/2303]
>  
> h2. Steps to reproduce
> Here is a reproducible test:
>  
> {code:java}
> @TestFactory
>     List<DynamicNode> tests() {
>         int a = 1 / 0;  // intentionally throws
>         return Arrays.asList(
>             DynamicContainer.dynamicContainer(
>                 "dynamic container 1",
>                 Stream.of(
>                     DynamicTest.dynamicTest("dynamic test 1", () -> fail("")),
>                     DynamicTest.dynamicTest("dynamic test 2", () -> fail(""))
>                 )
>             ),
>             DynamicContainer.dynamicContainer(
>                 "dynamic container 2",
>                 Stream.of(
>                     DynamicTest.dynamicTest("dynamic test 3", () -> fail("")),
>                     DynamicTest.dynamicTest("dynamic test 4", () -> fail(""))
>                 )
>             )
>         );
>     }{code}
>  
> the test above succeeded if `{{int a = 1 / 0`}} is present, and failed as expected if
I remove it, showing 4 tests executed and all of them failed.
> h2. Context
>  * Used versions (Jupiter/Vintage/Platform):
>  
> {code:java}
> <dependency>
>   <groupId>org.junit.jupiter</groupId>
>   <artifactId>junit-jupiter</artifactId>
>   <version>5.6.0</version>
> </dependency>
> {code}
>  * Build Tool/IDE:
> maven-failsafe-plugin, with all necessary dependencies configured
>  
> {code:java}
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-failsafe-plugin</artifactId>
>                 <version>3.0.0-M4</version>
>                 <dependencies>
>                     <!-- not important, thus omitted -->
>                 </dependencies>
>             </plugin>
> {code}
> h2. Deliverables
> I'm expecting the tests to be failed if the {{TestFactory}} method throws



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message