Skip to content

Commit 82d778f

Browse files
committed
Replace custom assertArrayEquals in org.eclipse.ui.tests
Some theme tests use a custom assertArrayEquals implementation instead of using the default one of JUnit's assertions. This change replaces it.
1 parent ddeb49e commit 82d778f

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/JFaceThemeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.tests.themes;
1515

16+
import static org.junit.Assert.assertArrayEquals;
17+
1618
import org.eclipse.jface.resource.ColorDescriptor;
1719
import org.eclipse.jface.resource.ColorRegistry;
1820
import org.eclipse.jface.resource.FontRegistry;

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemeAPITest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*******************************************************************************/
1515
package org.eclipse.ui.tests.themes;
1616

17+
import static org.junit.Assert.assertArrayEquals;
18+
1719
import java.util.List;
1820
import java.util.Set;
1921

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemeTest.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
*******************************************************************************/
1515
package org.eclipse.ui.tests.themes;
1616

17-
import java.util.Arrays;
18-
1917
import org.eclipse.e4.ui.css.swt.theme.IThemeEngine;
2018
import org.eclipse.ui.tests.harness.util.UITestCase;
2119
import org.eclipse.ui.themes.ITheme;
@@ -31,30 +29,6 @@ public abstract class ThemeTest extends UITestCase {
3129

3230
protected static final String THEME1 = "theme1";
3331

34-
public static void assertArrayEquals(Object[] datas, Object[] datas2) {
35-
if (!Arrays.equals(datas, datas2)) {
36-
String expected = formatArray(datas);
37-
String actual = formatArray(datas2);
38-
fail("expected:<" + expected + "> but was:<" + actual + ">");
39-
}
40-
}
41-
42-
protected static String formatArray(Object[] datas) {
43-
StringBuilder buffer = new StringBuilder();
44-
if (datas == null) {
45-
buffer.append("null");
46-
} else {
47-
buffer.append('[');
48-
for (int i = 0; i < datas.length; i++) {
49-
buffer.append(datas[i]);
50-
if (i != datas.length - 1) {
51-
buffer.append(',');
52-
}
53-
}
54-
}
55-
return buffer.toString();
56-
}
57-
5832
protected IThemeManager fManager;
5933

6034
public ThemeTest(String testName) {

0 commit comments

Comments
 (0)