diff options
author | Alexander Kurtakov | 2018-07-11 18:01:51 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-07-11 18:03:27 +0000 |
commit | ae3b62b2cb38cd49368931bad255afb307b2a025 (patch) | |
tree | ec3374647c7ff71c48aa9b721571085271190248 | |
parent | 2cf0020be9d136f0f0a9f699f8645336214f833c (diff) | |
download | eclipse.platform.swt-ae3b62b2cb38cd49368931bad255afb307b2a025.tar.gz eclipse.platform.swt-ae3b62b2cb38cd49368931bad255afb307b2a025.tar.xz eclipse.platform.swt-ae3b62b2cb38cd49368931bad255afb307b2a025.zip |
Use assertFalse in swt.tests instead of assertEquals(false,.)
Change-Id: I4b72dc2c4ce365407a2b26ac3f38f8689380a6cb
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
7 files changed, 43 insertions, 39 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java index 4e4739025c..bbb28bca53 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ package org.eclipse.swt.tests.junit; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.eclipse.swt.accessibility.Accessible; @@ -41,7 +42,7 @@ public void setUp() { @After public void tearDown() { - assertEquals(false, shell.isDisposed()); + assertFalse(shell.isDisposed()); shell.dispose(); assertTrue(shell.isDisposed()); } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java index 98741f091b..6e64180d6a 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -632,7 +632,7 @@ public void test_setBoundsIIII() { assertEquals(new Rectangle(10, 20, 30, 40), control.getBounds()); control.setBounds(20, 30, 40, 50); - assertEquals(false, control.getBounds().equals(new Rectangle(10, 20, 30, 40))); + assertFalse(control.getBounds().equals(new Rectangle(10, 20, 30, 40))); control.setBounds(10, 20, 30, 40); } @@ -642,7 +642,7 @@ public void test_setBoundsLorg_eclipse_swt_graphics_Rectangle() { assertEquals(new Rectangle(10, 20, 30, 40), control.getBounds()); control.setBounds(new Rectangle(20, 30, 40, 50)); - assertEquals(false, control.getBounds().equals(new Rectangle(10, 20, 30, 40))); + assertFalse(control.getBounds().equals(new Rectangle(10, 20, 30, 40))); try { control.setBounds(null); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java index 9e0f0cc5d2..ccecd2732a 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -331,9 +331,9 @@ public void test_deselectI() { list.deselect(5); assertArrayEquals(items2, list.getSelection()); list.deselect(1); - assertEquals(false, list.isSelected(1)); + assertFalse(list.isSelected(1)); list.deselect(1); - assertEquals(false, list.isSelected(1)); + assertFalse(list.isSelected(1)); setSingleList(); @@ -343,11 +343,11 @@ public void test_deselectI() { list.deselect(5); assertArrayEquals(new String[] { "item3" }, list.getSelection()); list.deselect(2); - assertEquals(false, list.isSelected(2)); + assertFalse(list.isSelected(2)); list.deselect(1); - assertEquals(false, list.isSelected(1)); + assertFalse(list.isSelected(1)); list.deselect(1); - assertEquals(false, list.isSelected(1)); + assertFalse(list.isSelected(1)); } @Test @@ -857,7 +857,7 @@ public void test_isSelectedI() { assertTrue(list.isSelected(0)); assertTrue(list.isSelected(1)); assertTrue(list.isSelected(2)); - assertEquals(false, list.isSelected(3)); + assertFalse(list.isSelected(3)); setSingleList(); @@ -865,10 +865,10 @@ public void test_isSelectedI() { list.setItems(items); list.setSelection(items); if (SwtTestUtil.fCheckSWTPolicy) { - assertEquals(false, list.isSelected(0)); + assertFalse(list.isSelected(0)); assertTrue(list.isSelected(1)); - assertEquals(false, list.isSelected(2)); - assertEquals(false, list.isSelected(3)); + assertFalse(list.isSelected(2)); + assertFalse(list.isSelected(3)); } } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java index 7b899772fa..bda5ac317e 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java @@ -11,6 +11,7 @@ package org.eclipse.swt.tests.junit; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -469,17 +470,17 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() { @Test public void test_setCheckedZ() { - assertEquals(false, tableItem.getChecked()); + assertFalse(tableItem.getChecked()); tableItem.setChecked(true); - assertEquals(false, tableItem.getChecked()); + assertFalse(tableItem.getChecked()); Table t = new Table(shell, SWT.CHECK); TableItem ti = new TableItem(t, SWT.NULL); ti.setChecked(true); assertTrue(ti.getChecked()); ti.setChecked(false); - assertEquals(false, ti.getChecked()); + assertFalse(ti.getChecked()); t.dispose(); } @@ -624,11 +625,11 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() { public void test_setGrayedZ() { Table newTable = new Table(shell, SWT.CHECK); TableItem tItem = new TableItem(newTable,0); - assertEquals(false, tItem.getGrayed()); + assertFalse(tItem.getGrayed()); tItem.setGrayed(true); assertTrue(tItem.getGrayed()); tItem.setGrayed(false); - assertEquals(false, tItem.getGrayed()); + assertFalse(tItem.getGrayed()); newTable.dispose(); } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java index 3837f5a1e0..3d5bfc8fa8 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -498,7 +498,7 @@ public void test_getDoubleClickEnabled() { assertTrue(text.getDoubleClickEnabled()); text.setDoubleClickEnabled(false); - assertEquals(false, text.getDoubleClickEnabled()); + assertFalse(text.getDoubleClickEnabled()); // this method tests a SINGLE line text editor makeCleanEnvironment(true); @@ -507,7 +507,7 @@ public void test_getDoubleClickEnabled() { assertTrue(text.getDoubleClickEnabled()); text.setDoubleClickEnabled(false); - assertEquals(false, text.getDoubleClickEnabled()); + assertFalse(text.getDoubleClickEnabled()); } @Test @@ -1084,7 +1084,7 @@ public void test_setDoubleClickEnabledZ() { assertTrue(text.getDoubleClickEnabled()); text.setDoubleClickEnabled(false); - assertEquals(false, text.getDoubleClickEnabled()); + assertFalse(text.getDoubleClickEnabled()); // tests a SINGLE line text editor makeCleanEnvironment(true); @@ -1093,7 +1093,7 @@ public void test_setDoubleClickEnabledZ() { assertTrue(text.getDoubleClickEnabled()); text.setDoubleClickEnabled(false); - assertEquals(false, text.getDoubleClickEnabled()); + assertFalse(text.getDoubleClickEnabled()); } @Test diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java index ec4c573c03..6226f9a95b 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java @@ -12,6 +12,7 @@ package org.eclipse.swt.tests.junit; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -546,13 +547,13 @@ public void test_getBoundsI() { @Test public void test_getExpanded() { - assertEquals(false, treeItem.getExpanded()); + assertFalse(treeItem.getExpanded()); // there must be at least one subitem before you can set the treeitem expanded new TreeItem(treeItem, 0); treeItem.setExpanded(true); assertTrue(treeItem.getExpanded()); treeItem.setExpanded(false); - assertEquals(false, treeItem.getExpanded()); + assertFalse(treeItem.getExpanded()); } @Test @@ -766,10 +767,10 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() { @Test public void test_setCheckedZ() { - assertEquals(false, treeItem.getChecked()); + assertFalse(treeItem.getChecked()); treeItem.setChecked(true); - assertEquals(false, treeItem.getChecked()); + assertFalse(treeItem.getChecked()); Tree t = new Tree(shell, SWT.CHECK); TreeItem ti = new TreeItem(t, SWT.NULL); @@ -777,29 +778,29 @@ public void test_setCheckedZ() { assertTrue(ti.getChecked()); ti.setChecked(false); - assertEquals(false, ti.getChecked()); + assertFalse(ti.getChecked()); t.dispose(); } @Test public void test_setExpandedZ() { - assertEquals(false, treeItem.getExpanded()); + assertFalse(treeItem.getExpanded()); // there must be at least one subitem before you can set the treeitem expanded treeItem.setExpanded(true); - assertEquals(false, treeItem.getExpanded()); + assertFalse(treeItem.getExpanded()); new TreeItem(treeItem, SWT.NULL); treeItem.setExpanded(true); assertTrue(treeItem.getExpanded()); treeItem.setExpanded(false); - assertEquals(false, treeItem.getExpanded()); + assertFalse(treeItem.getExpanded()); TreeItem ti = new TreeItem(treeItem, SWT.NULL); ti.setExpanded(true); treeItem.setExpanded(false); - assertEquals(false, ti.getExpanded()); + assertFalse(ti.getExpanded()); } @Test @@ -942,11 +943,11 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() { public void test_setGrayedZ() { Tree newTree = new Tree(shell, SWT.CHECK); TreeItem tItem = new TreeItem(newTree,0); - assertEquals(false, tItem.getGrayed()); + assertFalse(tItem.getGrayed()); tItem.setGrayed(true); assertTrue(tItem.getGrayed()); tItem.setGrayed(false); - assertEquals(false, tItem.getGrayed()); + assertFalse(tItem.getGrayed()); newTree.dispose(); } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java index 8c0d9c3fc5..fc5f543679 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ package org.eclipse.swt.tests.junit; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -57,7 +58,7 @@ public void tearDown() { assertEquals(disposedIntentionally, widget.isDisposed()); } if (!disposedIntentionally) { - assertEquals(false, shell.isDisposed()); + assertFalse(shell.isDisposed()); } shell.dispose(); if (widget != null) { @@ -96,7 +97,7 @@ public void test_getDisplay() { } @Test public void test_isDisposed() { - assertEquals(false, widget.isDisposed()); + assertFalse(widget.isDisposed()); } @Test public void test_notifyListenersILorg_eclipse_swt_widgets_Event() { |