Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ public final class EngineRule implements TestRule
private EngineConfiguration configuration;
private String configRoot;
private Predicate<String> exceptions;
private boolean interruptible;
private boolean clean;

public EngineRule()
{
this.builder = Engine.builder();
this.properties = new Properties();
this.exceptions = m -> false;
this.interruptible = true;

configure(ENGINE_DRAIN_ON_CLOSE, true);
configure(ENGINE_SYNTHETIC_ABORT, true);
Expand Down Expand Up @@ -156,6 +158,13 @@ public EngineRule exceptions(
return this;
}

public EngineRule interruptible(
boolean interruptible)
{
this.interruptible = interruptible;
return this;
}

public EngineRule clean()
{
this.clean = true;
Expand Down Expand Up @@ -323,9 +332,12 @@ public void evaluate() throws Throwable
final List<Throwable> errors = synchronizedList(new ArrayList<>());
final ErrorHandler errorHandler = ex ->
{
ex.printStackTrace();
errors.add(ex);
baseThread.interrupt();

if (interruptible)
{
baseThread.interrupt();
}
};

FileSystem fs = null;
Expand Down
Loading