-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report intermediate containers finished lazily
Since JUnit 4 does report events for intermediate containers, the Vintage engine has to synthesize them. Until now this was done lazily for start events, i.e. when the first child was started, but eagerly for finish events, i.e. when the last static child of a container was finished. However, the latter approach is problematic for containers that contain both static and dynamic children, for example a Spock specification with a regular and an unrolled feature method. Instead, intermediate containers are now reported as finished as soon as a test is started for which the container is not an ancestor. Fixes #1819.
- Loading branch information
1 parent
7312743
commit 1e7fc96
Showing
5 changed files
with
184 additions
and
23 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/EventType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright 2015-2019 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.vintage.engine.execution; | ||
|
||
/** | ||
* @since 5.4.1 | ||
*/ | ||
enum EventType { | ||
REPORTED, SYNTHETIC | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...e/src/test/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2015-2019 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.vintage.engine.samples.junit4; | ||
|
||
import static java.util.Arrays.asList; | ||
|
||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameter; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
/** | ||
* @since 5.4.1 | ||
*/ | ||
@RunWith(Parameterized.class) | ||
public class IgnoredParameterizedTestCase { | ||
|
||
@Parameters(name = "{0}") | ||
public static Iterable<String> parameters() { | ||
return asList("foo", "bar"); | ||
} | ||
|
||
@Parameter | ||
public String value; | ||
|
||
@Test | ||
@Ignore | ||
public void test() { | ||
// never called | ||
} | ||
|
||
} |