aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test/java/com/vaadin/tests/util/TestUtil.java
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-03 12:56:25 +0200
committerHenri Sara <henri.sara@gmail.com>2017-10-03 13:56:25 +0300
commitccad305464af83826de4a4bd25a383360fb356d0 (patch)
treed399448d2910c4cf373e64c690b053740dff43ba /server/src/test/java/com/vaadin/tests/util/TestUtil.java
parent28b52d687dade66154a4fcd545415bf0d01b0a53 (diff)
downloadvaadin-framework-ccad305464af83826de4a4bd25a383360fb356d0.tar.gz
vaadin-framework-ccad305464af83826de4a4bd25a383360fb356d0.zip
Use static import of Assert in tests (#10126)
Also removes dependency on junit.framework.TestCase .
Diffstat (limited to 'server/src/test/java/com/vaadin/tests/util/TestUtil.java')
-rw-r--r--server/src/test/java/com/vaadin/tests/util/TestUtil.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/server/src/test/java/com/vaadin/tests/util/TestUtil.java b/server/src/test/java/com/vaadin/tests/util/TestUtil.java
index eb5bd5e525..e98d6c07ab 100644
--- a/server/src/test/java/com/vaadin/tests/util/TestUtil.java
+++ b/server/src/test/java/com/vaadin/tests/util/TestUtil.java
@@ -1,13 +1,14 @@
package com.vaadin.tests.util;
-import java.util.Iterator;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
-import org.junit.Assert;
+import java.util.Iterator;
public class TestUtil {
public static void assertArrays(Object[] actualObjects,
Object[] expectedObjects) {
- Assert.assertEquals(
+ assertEquals(
"Actual contains a different number of values than was expected",
expectedObjects.length, actualObjects.length);
@@ -15,8 +16,7 @@ public class TestUtil {
Object actual = actualObjects[i];
Object expected = expectedObjects[i];
- Assert.assertEquals("Item[" + i + "] does not match", expected,
- actual);
+ assertEquals("Item[" + i + "] does not match", expected, actual);
}
}
@@ -29,18 +29,15 @@ public class TestUtil {
while (i1.hasNext()) {
Object o1 = i1.next();
if (!i2.hasNext()) {
- Assert.fail(
- "The second iterable contains fewer items than the first. The object "
- + o1 + " has no match in the second iterable.");
+ fail("The second iterable contains fewer items than the first. The object "
+ + o1 + " has no match in the second iterable.");
}
Object o2 = i2.next();
- Assert.assertEquals(o1, o2);
+ assertEquals(o1, o2);
}
if (i2.hasNext()) {
- Assert.fail(
- "The second iterable contains more items than the first. The object "
- + i2.next()
- + " has no match in the first iterable.");
+ fail("The second iterable contains more items than the first. The object "
+ + i2.next() + " has no match in the first iterable.");
}
}