]> git.uio.no Git - ifi-stolz-refaktor.git/blob - software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/RefaktorAssert.java
Removing SafeVarArgs annotations.
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor / src / no / uio / ifi / refaktor / RefaktorAssert.java
1 package no.uio.ifi.refaktor;
2
3 import static org.hamcrest.CoreMatchers.is;
4
5 import org.hamcrest.Matcher;
6 import org.junit.Assert;
7
8 public class RefaktorAssert {
9
10         public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
11                 assertThat("", actual, matcher);
12         }
13
14         public static <T> void assertThat(String reason, T actual, Matcher<? super T> matcher) {
15                 Assert.assertThat(reason, actual, matcher);
16         }
17
18         public static void assertThat(boolean assertion) {
19                 assertThat("", assertion);
20         }
21
22         public static void assertThat(String reason, boolean assertion) {
23                 assertThat(reason, assertion, is(true));
24         }
25
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);
30         }
31
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);
36         }
37
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);
42         }
43
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);
48         }
49 }