Permalink
Browse files

ArrayUtil: removed dependency to JUnit

  • Loading branch information...
1 parent da6ac21 commit 2416a885d191f6593926cb545efb663f9bcd81f5 Janne Härkönen committed Aug 26, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/org/robotframework/javalib/util/ArrayUtil.java
@@ -22,8 +22,6 @@
import java.util.HashSet;
import java.util.List;
-import junit.framework.Assert;
-
import org.apache.commons.collections.CollectionUtils;
public class ArrayUtil {
@@ -37,11 +35,13 @@ public static boolean arrayContains(String needle, String[] haystack) {
}
public static void assertArraysContainSame(String[] expected, String[] actual) {
- Assert.assertEquals(new HashSet(Arrays.asList(expected)), new HashSet(Arrays.asList(actual)));
+ if (!new HashSet(Arrays.asList(expected)).equals(new HashSet(Arrays.asList(actual))))
+ throw new AssertionError();
}
public static <T> void assertArraysEquals(T[] expected, T[] actual) {
- Assert.assertTrue("Expected " + Arrays.asList(expected) + " but was " + Arrays.asList(actual), Arrays.equals(expected, actual));
+ if (!Arrays.equals(expected, actual))
+ throw new AssertionError("Expected " + Arrays.asList(expected) + " but was " + Arrays.asList(actual));
}
public static <T,U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType) {

0 comments on commit 2416a88

Please sign in to comment.