1 package no.uio.ifi.refaktor;
3 import static org.hamcrest.CoreMatchers.is;
5 import org.hamcrest.Matcher;
6 import org.junit.Assert;
8 public class RefaktorAssert {
10 public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
11 assertThat("", actual, matcher);
14 public static <T> void assertThat(String reason, T actual, Matcher<? super T> matcher) {
15 Assert.assertThat(reason, actual, matcher);
18 public static void assertThat(boolean assertion) {
19 assertThat("", assertion);
22 public static void assertThat(String reason, boolean assertion) {
23 assertThat(reason, assertion, is(true));
26 /** Use this matcher instead of the one in org.hamcrest.CoreMatchers,
27 * due to incompatibilities between libraries supplied with Juno and Kepler. */
28 public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItem(T item) {
29 return no.uio.ifi.refaktor.IsCollectionContaining.<T>hasItem(item);
32 /** Use this matcher instead of the one in org.hamcrest.CoreMatchers,
33 * due to incompatibilities between libraries supplied with Juno and Kepler. */
34 public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItem(org.hamcrest.Matcher<? extends T> itemMatcher) {
35 return no.uio.ifi.refaktor.IsCollectionContaining.<T>hasItem(itemMatcher);
38 /** Use this matcher instead of the one in org.hamcrest.CoreMatchers,
39 * due to incompatibilities between libraries supplied with Juno and Kepler. */
40 public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItems(T... items) {
41 return no.uio.ifi.refaktor.IsCollectionContaining.<T>hasItems(items);
44 /** Use this matcher instead of the one in org.hamcrest.CoreMatchers,
45 * due to incompatibilities between libraries supplied with Juno and Kepler. */
46 public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItems(org.hamcrest.Matcher<? extends T>... itemMatchers) {
47 return no.uio.ifi.refaktor.IsCollectionContaining.<T>hasItems(itemMatchers);