
org.jnario.runner.internal.RunAfters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.jnario.standalone Show documentation
Show all versions of org.jnario.standalone Show documentation
The required libraries to execute Jnario specifications without Eclipse.
The newest version!
package org.jnario.runner.internal;
import java.util.ArrayList;
import java.util.List;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.MultipleFailureException;
import org.junit.runners.model.Statement;
/*
* copied from JUnit
*/
public class RunAfters extends Statement {
private final Statement fNext;
private final Object fTarget;
private final List fAfters;
public RunAfters(Statement next, List afters, Object target) {
fNext= next;
fAfters= afters;
fTarget= target;
}
@Override
public void evaluate() throws Throwable {
List errors = new ArrayList();
try {
fNext.evaluate();
} catch (Throwable e) {
errors.add(e);
} finally {
for (FrameworkMethod each : fAfters)
try {
each.invokeExplosively(fTarget);
} catch (Throwable e) {
errors.add(e);
}
}
MultipleFailureException.assertEmpty(errors);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy