Mercurial > hg4j
diff test/org/tmatesoft/hg/test/ErrorCollectorExt.java @ 269:7af843ecc378
Respect glob pattern with alternatives {a,b}
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 23 Aug 2011 23:47:38 +0200 |
parents | 0b2dcca7de9f |
children | 6865eb742883 |
line wrap: on
line diff
--- a/test/org/tmatesoft/hg/test/ErrorCollectorExt.java Tue Aug 23 22:30:56 2011 +0200 +++ b/test/org/tmatesoft/hg/test/ErrorCollectorExt.java Tue Aug 23 23:47:38 2011 +0200 @@ -21,6 +21,7 @@ import java.util.concurrent.Callable; import org.hamcrest.Matcher; +import org.junit.internal.runners.model.MultipleFailureException; import org.junit.rules.ErrorCollector; /** @@ -31,7 +32,14 @@ */ final class ErrorCollectorExt extends ErrorCollector { public void verify() throws Throwable { - super.verify(); + try { + super.verify(); + } catch (MultipleFailureException ex) { + for (Throwable t : ex.getFailures()) { + t.printStackTrace(); + } + throw ex; + } } public <T> void checkThat(final String reason, final T value, final Matcher<T> matcher) { @@ -42,4 +50,13 @@ } }); } + + public void assertTrue(final String reason, final boolean value) { + checkSucceeds(new Callable<Object>() { + public Object call() throws Exception { + org.junit.Assert.assertTrue(reason, value); + return null; + } + }); + } } \ No newline at end of file