-
-
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.
Make ThrowableCollector configurable
This commit generalizes `ThrowableCollector` to take a predicate that is used to decide whether a `Throwable` is aborted or failed execution. The Jupiter engines uses a specialized implementation that treats OTA's `TestAbortedExceptions` as aborting and everything else as failing: `OpenTest4JAwareThrowableCollector`. In addition, this commit introduces `ThrowableCollector.Factory` and lets `HierarchicalTestEngines` create them in order to allow the engine to decide how to configure its `ThrowableCollectors`. For backwards compatibility, the default implementation returns a factory that always creates instances of `OpenTest4JAwareThrowableCollector`. Issue: #1313
- Loading branch information
1 parent
34d5888
commit bb455bd
Showing
12 changed files
with
155 additions
and
47 deletions.
There are no files selected for viewing
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
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
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
32 changes: 32 additions & 0 deletions
32
...ava/org/junit/platform/engine/support/hierarchical/OpenTest4JAwareThrowableCollector.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,32 @@ | ||
/* | ||
* Copyright 2015-2018 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.platform.engine.support.hierarchical; | ||
|
||
import static org.apiguardian.api.API.Status.MAINTAINED; | ||
|
||
import org.apiguardian.api.API; | ||
import org.opentest4j.TestAbortedException; | ||
|
||
/** | ||
* Specialization of {@link ThrowableCollector} that treats instances of | ||
* {@link TestAbortedException} as <em>aborting</em>. | ||
* | ||
* @see ThrowableCollector | ||
* @since 5.3 | ||
*/ | ||
@API(status = MAINTAINED, since = "5.3") | ||
public class OpenTest4JAwareThrowableCollector extends ThrowableCollector { | ||
|
||
public OpenTest4JAwareThrowableCollector() { | ||
super(TestAbortedException.class::isInstance); | ||
} | ||
|
||
} |
Oops, something went wrong.