Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/ErrorCollectorExt.java @ 442:6865eb742883
Tests for subrepo API, refactor status tests for reuse, better subrepos API
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 27 Apr 2012 20:57:20 +0200 |
parents | 7af843ecc378 |
children | 9c9d09111aee |
comparison
equal
deleted
inserted
replaced
441:2a08466838d3 | 442:6865eb742883 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2012 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
18 | 18 |
19 import static org.junit.Assert.assertThat; | 19 import static org.junit.Assert.assertThat; |
20 | 20 |
21 import java.util.concurrent.Callable; | 21 import java.util.concurrent.Callable; |
22 | 22 |
23 import org.hamcrest.CoreMatchers; | |
23 import org.hamcrest.Matcher; | 24 import org.hamcrest.Matcher; |
24 import org.junit.internal.runners.model.MultipleFailureException; | 25 import org.junit.internal.runners.model.MultipleFailureException; |
25 import org.junit.rules.ErrorCollector; | 26 import org.junit.rules.ErrorCollector; |
26 | 27 |
27 /** | 28 /** |
49 return value; | 50 return value; |
50 } | 51 } |
51 }); | 52 }); |
52 } | 53 } |
53 | 54 |
55 public void assertTrue(final boolean value) { | |
56 assertTrue(null, value); | |
57 } | |
58 | |
54 public void assertTrue(final String reason, final boolean value) { | 59 public void assertTrue(final String reason, final boolean value) { |
55 checkSucceeds(new Callable<Object>() { | 60 checkSucceeds(new Callable<Object>() { |
56 public Object call() throws Exception { | 61 public Object call() throws Exception { |
57 org.junit.Assert.assertTrue(reason, value); | 62 org.junit.Assert.assertTrue(reason, value); |
58 return null; | 63 return null; |
59 } | 64 } |
60 }); | 65 }); |
61 } | 66 } |
67 | |
68 public <T> void assertEquals(T expected, T actual) { | |
69 checkThat(null, actual, CoreMatchers.equalTo(expected)); | |
70 } | |
62 } | 71 } |