Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-04-21 13:47:10 +0000
committerAlexander Kurtakov2017-04-21 13:52:46 +0000
commit06f481d7c5b5fdd8b612d804535c88abe291d783 (patch)
tree6e3f159ba79b0015e5442fe86528a398a8785b5b /tests
parentc29f0d9fccc36b72f8d09f3bed95e9908be2caa1 (diff)
downloadeclipse.platform.swt-06f481d7c5b5fdd8b612d804535c88abe291d783.tar.gz
eclipse.platform.swt-06f481d7c5b5fdd8b612d804535c88abe291d783.tar.xz
eclipse.platform.swt-06f481d7c5b5fdd8b612d804535c88abe291d783.zip
Bug 515583 - Simplify assertTrue usage in tests
Calls like assertTrue(var == true) or assertTrue(!var) and etc. are due for simplification. Change-Id: I37abb305cbe23513fa0e03c1a173ff5ea3bb7bb8 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java11
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java84
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java10
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java5
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java33
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java11
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java19
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java10
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java24
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java14
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java11
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java7
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java18
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java28
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java10
15 files changed, 151 insertions, 144 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java
index 3f35078337..4d6b6c697e 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -13,6 +13,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.SWT;
@@ -69,13 +70,13 @@ private void testListener(final String message, final int[] segments, boolean ex
assertTrue(message + " expected exception not thrown", exceptionThrown);
}
else {
- assertTrue(message + " unexpected exception thrown", exceptionThrown == false);
+ assertFalse(message + " unexpected exception thrown", exceptionThrown);
}
if (SwtTestUtil.isBidi()) {
assertTrue(message + " listener not called", listenerCalled);
}
else {
- assertTrue(message + " listener called when it shouldn't be", listenerCalled == false);
+ assertFalse(message + " listener called when it shouldn't be", listenerCalled);
}
}
private void testStyleRangeSegmenting(final int[] segments, int[] boldRanges) {
@@ -104,12 +105,12 @@ private void testStyleRangeSegmenting(final int[] segments, int[] boldRanges) {
finally {
text.removeBidiSegmentListener(listener);
}
- assertTrue(" unexpected exception thrown", exceptionThrown == false);
+ assertFalse(" unexpected exception thrown", exceptionThrown);
if (SwtTestUtil.isBidi()) {
assertTrue(" listener not called", listenerCalled);
}
else {
- assertTrue(" listener called when it shouldn't be", listenerCalled == false);
+ assertFalse(" listener called when it shouldn't be", listenerCalled);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
index a2ce799d54..27edeb47b8 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -144,7 +144,7 @@ protected void initializeColors() {
public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI(){
StyledText text = new StyledText(shell, SWT.READ_ONLY);
- assertTrue(":a:", text.getEditable() == false);
+ assertFalse(":a:", text.getEditable());
text.dispose();
text = new StyledText(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE);
@@ -211,7 +211,7 @@ public void test_addExtendedModifyListenerLorg_eclipse_swt_custom_ExtendedModify
text.removeExtendedModifyListener(listener);
// cause StyledText to call the listener.
text.setText(line);
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -255,13 +255,13 @@ public void test_addBidiSegmentListenerLorg_eclipse_swt_custom_BidiSegmentListen
assertTrue("Listener not called", listenerCalled);
}
else {
- assertTrue("Listener called when it shouldn't be", listenerCalled == false);
+ assertFalse("Listener called when it shouldn't be", listenerCalled);
}
listenerCalled = false;
text.removeBidiSegmentListener(listener);
// cause StyledText to call the BidiSegmentListener.
text.getLocationAtOffset(0);
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -292,7 +292,7 @@ public void test_addLineBackgroundListenerLorg_eclipse_swt_custom_LineBackground
text.setText(line);
text.setSelection(0, text.getCharCount());
text.copy();
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -323,7 +323,7 @@ public void test_addLineStyleListenerLorg_eclipse_swt_custom_LineStyleListener()
text.setText(line);
text.setSelection(0, text.getCharCount());
text.copy();
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -363,7 +363,7 @@ public void test_addModifyListenerLorg_eclipse_swt_events_ModifyListener() {
text.removeModifyListener(listener);
// cause StyledText to call the listener.
text.setText(line);
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -396,15 +396,15 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
// cause StyledText to call the listener.
text.invokeAction(ST.SELECT_LINE_END);
assertTrue("Listener not called", listenerCalled);
- assertTrue("Listener called unexpectedly", listener2Called == false);
+ assertFalse("Listener called unexpectedly", listener2Called);
listenerCalled = false;
listener2Called = false;
text.removeSelectionListener(listener);
// cause StyledText to call the listener.
text.invokeAction(ST.SELECT_LINE_END);
- assertTrue("Listener not removed", listenerCalled == false);
- assertTrue("Listener called unexpectedly", listener2Called == false);
+ assertFalse("Listener not removed", listenerCalled);
+ assertFalse("Listener called unexpectedly", listener2Called);
}
@@ -424,7 +424,7 @@ public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_event
text.removeSelectionListener(listener);
// cause StyledText to call the listener.
text.invokeAction(ST.SELECT_LINE_END);
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -437,13 +437,13 @@ public void test_addSelectionListenerWidgetDefaultSelectedAdapterLorg_eclipse_sw
text.addSelectionListener(listener);
// cause StyledText to call the listener.
text.invokeAction(ST.SELECT_LINE_END);
- assertTrue("Listener called unexpectedly", listener2Called == false);
+ assertFalse("Listener called unexpectedly", listener2Called);
listener2Called = false;
text.removeSelectionListener(listener);
// cause StyledText to call the listener.
text.invokeAction(ST.SELECT_LINE_END);
- assertTrue("Listener called unexpectedly", listener2Called == false);
+ assertFalse("Listener called unexpectedly", listener2Called);
}
@Test
@@ -556,7 +556,7 @@ public void test_addVerifyListenerLorg_eclipse_swt_events_VerifyListener() {
text.removeVerifyListener(listener);
// cause StyledText to call the listener.
text.setText(line);
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -821,28 +821,28 @@ public void test_getContent() {
@Test
public void test_getDoubleClickEnabled() {
- assertTrue(":a:", text.getDoubleClickEnabled() == true);
+ assertTrue(":a:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(true);
- assertTrue(":b:", text.getDoubleClickEnabled() == true);
+ assertTrue(":b:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(false);
- assertTrue(":c:", text.getDoubleClickEnabled() == false);
+ assertFalse(":c:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(false);
- assertTrue(":d:", text.getDoubleClickEnabled() == false);
+ assertFalse(":d:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(true);
- assertTrue(":e:", text.getDoubleClickEnabled() == true);
+ assertTrue(":e:", text.getDoubleClickEnabled());
}
@Test
public void test_getEditable() {
- assertTrue(":a:", text.getEditable() == true);
+ assertTrue(":a:", text.getEditable());
text.setEditable(true);
- assertTrue(":b:", text.getEditable() == true);
+ assertTrue(":b:", text.getEditable());
text.setEditable(false);
- assertTrue(":c:", text.getEditable() == false);
+ assertFalse(":c:", text.getEditable());
text.setEditable(false);
- assertTrue(":d:", text.getEditable() == false);
+ assertFalse(":d:", text.getEditable());
text.setEditable(true);
- assertTrue(":e:", text.getEditable() == true);
+ assertTrue(":e:", text.getEditable());
}
@Test
@@ -1280,7 +1280,7 @@ public void test_getOffsetAtLocationLorg_eclipse_swt_graphics_Point() {
catch (IllegalArgumentException e) {
exceptionThrown = true;
}
- assertTrue(":b:", exceptionThrown == true);
+ assertTrue(":b:", exceptionThrown);
exceptionThrown = false;
try {
@@ -1289,7 +1289,7 @@ public void test_getOffsetAtLocationLorg_eclipse_swt_graphics_Point() {
catch (IllegalArgumentException e) {
exceptionThrown = true;
}
- assertTrue(":c:", exceptionThrown == true);
+ assertTrue(":c:", exceptionThrown);
exceptionThrown = false;
text.setText("Line0\r\nLine1");
@@ -1304,7 +1304,7 @@ public void test_getOffsetAtLocationLorg_eclipse_swt_graphics_Point() {
catch (IllegalArgumentException e) {
exceptionThrown = true;
}
- assertTrue(":g:", exceptionThrown == true);
+ assertTrue(":g:", exceptionThrown);
exceptionThrown = false;
try {
@@ -1313,7 +1313,7 @@ public void test_getOffsetAtLocationLorg_eclipse_swt_graphics_Point() {
catch (IllegalArgumentException e) {
exceptionThrown = true;
}
- assertTrue(":h:", exceptionThrown == true);
+ assertTrue(":h:", exceptionThrown);
exceptionThrown = false;
text.setTopIndex(1);
@@ -1981,13 +1981,13 @@ public void test_getTopPixel() {
@Test
public void test_getWordWrap() {
- assertTrue(":a:", text.getWordWrap() == false);
+ assertFalse(":a:", text.getWordWrap());
text.setWordWrap(true);
assertTrue(":b:", text.getWordWrap());
text.setWordWrap(false);
- assertTrue(":c:", text.getWordWrap() == false);
+ assertFalse(":c:", text.getWordWrap());
text.setWordWrap(false);
- assertTrue(":d:", text.getWordWrap() == false);
+ assertFalse(":d:", text.getWordWrap());
text.setWordWrap(true);
assertTrue(":e:", text.getWordWrap());
}
@@ -3254,25 +3254,25 @@ public void test_setContentLorg_eclipse_swt_custom_StyledTextContent() {
@Test
public void test_setDoubleClickEnabledZ(){
text.setDoubleClickEnabled(true);
- assertTrue(":a:", text.getDoubleClickEnabled() == true);
+ assertTrue(":a:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(false);
- assertTrue(":b:", text.getDoubleClickEnabled() == false);
+ assertFalse(":b:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(false);
- assertTrue(":c:", text.getDoubleClickEnabled() == false);
+ assertFalse(":c:", text.getDoubleClickEnabled());
text.setDoubleClickEnabled(true);
- assertTrue(":d:", text.getDoubleClickEnabled() == true);
+ assertTrue(":d:", text.getDoubleClickEnabled());
}
@Test
public void test_setEditableZ(){
text.setEditable(true);
- assertTrue(":a:", text.getEditable() == true);
+ assertTrue(":a:", text.getEditable());
text.setEditable(false);
- assertTrue(":b:", text.getEditable() == false);
+ assertFalse(":b:", text.getEditable());
text.setEditable(false);
- assertTrue(":c:", text.getEditable() == false);
+ assertFalse(":c:", text.getEditable());
text.setEditable(true);
- assertTrue(":d:", text.getEditable() == true);
+ assertTrue(":d:", text.getEditable());
}
@Override
@@ -4690,9 +4690,9 @@ public void test_setWordWrapZ(){
text.setWordWrap(true);
assertTrue(":a:", text.getWordWrap());
text.setWordWrap(false);
- assertTrue(":b:", text.getWordWrap() == false);
+ assertFalse(":b:", text.getWordWrap());
text.setWordWrap(false);
- assertTrue(":c:", text.getWordWrap() == false);
+ assertFalse(":c:", text.getWordWrap());
text.setWordWrap(true);
assertTrue(":d:", text.getWordWrap());
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java
index 9dea2b1fdd..4b4eb3c6fb 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -244,12 +244,12 @@ public void test_equalsLjava_lang_Object() {
Font otherFont = new Font(display, SwtTestUtil.testFontName, 20, SWT.NORMAL);
try {
// Test Font.equals(Object)
- assertTrue("!font.equals((Object)null)", !font.equals((Object)null));
+ assertFalse("!font.equals((Object)null)", font.equals((Object)null));
// Test Font.equals(Font)
- assertTrue("!font.equals((Font)null)", !font.equals((Font)null));
+ assertFalse("!font.equals((Font)null)", font.equals((Font)null));
assertTrue("font.equals(font)", font.equals(font));
- assertTrue("!font.equals(otherFont)", !font.equals(otherFont));
+ assertFalse("!font.equals(otherFont)", font.equals(otherFont));
} finally {
font.dispose();
otherFont.dispose();
@@ -337,7 +337,7 @@ public void test_isDisposed() {
// Test Font.isDisposed() false
Font font = new Font(display, SwtTestUtil.testFontName, 10, SWT.NORMAL);
try {
- assertTrue("Font should not be disposed", !font.isDisposed());
+ assertFalse("Font should not be disposed", font.isDisposed());
} finally {
// Test Font.isDisposed() true
font.dispose();
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java
index 04050f1b5d..cfb0a4de80 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -13,6 +13,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.assertTrue;
@@ -53,7 +54,7 @@ public void test_equalsLjava_lang_Object() {
assertTrue("Points should be equal", p1.equals(p2));
p2 = new Point(3, 4);
- assertTrue("Points should not be equal", !p1.equals(p2));
+ assertFalse("Points should not be equal", p1.equals(p2));
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java
index d0eaa794ce..993b72efeb 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -13,6 +13,7 @@ package org.eclipse.swt.tests.junit;
import static org.eclipse.swt.tests.junit.SwtTestUtil.assertSWTProblem;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -135,9 +136,9 @@ public void test_containsLorg_eclipse_swt_graphics_Point() {
//
// assertTrue("Rectangle should contain Point(4, 6)", r.contains(new Point(4, 6)));
- assertTrue("Rectangle should not contain Point(9, 10)", !r.contains(new Point(9, 10)));
+ assertFalse("Rectangle should not contain Point(9, 10)", r.contains(new Point(9, 10)));
- assertTrue("Rectangle should not contain point (-1, -1)", !r.contains(new Point(-1, -1)));
+ assertFalse("Rectangle should not contain point (-1, -1)", r.contains(new Point(-1, -1)));
try {
r.contains(null);
@@ -154,16 +155,16 @@ public void test_equalsLjava_lang_Object() {
assertTrue("Rectangles should be equal", r1.equals(r2));
r2 = new Rectangle(3, 4, 5, 6);
- assertTrue("Rectangles should not be equal", !r1.equals(r2));
+ assertFalse("Rectangles should not be equal", r1.equals(r2));
r2 = new Rectangle(2, 3, 4, 5);
- assertTrue("Rectangles should not be equal", !r1.equals(r2));
+ assertFalse("Rectangles should not be equal", r1.equals(r2));
r2 = new Rectangle(5, 4, 2, 3);
- assertTrue("Rectangles should not be equal", !r1.equals(r2));
+ assertFalse("Rectangles should not be equal", r1.equals(r2));
r2 = new Rectangle(4, 5, 3, 2);
- assertTrue("Rectangles should not be equal", !r1.equals(r2));
+ assertFalse("Rectangles should not be equal", r1.equals(r2));
}
@Test
@@ -227,16 +228,16 @@ public void test_intersectsIIII() {
assertTrue("Rectangle(2, 3, 7, 8) should intersect Rectangle(1, 2, 3, 4)", r2.intersects(1, 2, 3, 4));
r2 = new Rectangle(200, 300, 400, 500);
- assertTrue("Rectangle(1, 2, 3, 4) should not intersect Rectangle(200, 300, 400, 500)", !r1.intersects(200, 300, 400, 500));
- assertTrue("Rectangle(200, 300, 400, 500) should not intersect Rectangle(1, 2, 3, 4)", !r2.intersects(1, 2, 3, 4));
+ assertFalse("Rectangle(1, 2, 3, 4) should not intersect Rectangle(200, 300, 400, 500)", r1.intersects(200, 300, 400, 500));
+ assertFalse("Rectangle(200, 300, 400, 500) should not intersect Rectangle(1, 2, 3, 4)", r2.intersects(1, 2, 3, 4));
r2 = new Rectangle(3, 3, 0, 0);
assertTrue("Rectangle(1, 2, 3, 4) should intersect Rectangle(3, 3, 0, 0)", r1.intersects(3, 3, 0, 0));
assertTrue("Rectangle(3, 3, 0, 0) should intersect Rectangle(1, 2, 3, 4)", r2.intersects(1, 2, 3, 4));
r2 = new Rectangle(3, 3, -1, -1);
- assertTrue("Rectangle(1, 2, 3, 4) should not intersect Rectangle(3, 3, -1, -1)", !r1.intersects(3, 3, -1, -1));
- assertTrue("Rectangle(3, 3, -1, -1) should not intersect Rectangle(1, 2, 3, 4)", !r2.intersects(1, 2, 3, 4));
+ assertFalse("Rectangle(1, 2, 3, 4) should not intersect Rectangle(3, 3, -1, -1)", r1.intersects(3, 3, -1, -1));
+ assertFalse("Rectangle(3, 3, -1, -1) should not intersect Rectangle(1, 2, 3, 4)", r2.intersects(1, 2, 3, 4));
try {
r1.intersects(null);
@@ -254,16 +255,16 @@ public void test_intersectsLorg_eclipse_swt_graphics_Rectangle() {
assertTrue("Rectangle(2, 3, 7, 8) should intersect Rectangle(1, 2, 3, 4)", r2.intersects(r1));
r2 = new Rectangle(200, 300, 400, 500);
- assertTrue("Rectangle(1, 2, 3, 4) should not intersect Rectangle(200, 300, 400, 500)", !r1.intersects(r2));
- assertTrue("Rectangle(200, 300, 400, 500) should not intersect Rectangle(1, 2, 3, 4)", !r2.intersects(r1));
+ assertFalse("Rectangle(1, 2, 3, 4) should not intersect Rectangle(200, 300, 400, 500)", r1.intersects(r2));
+ assertFalse("Rectangle(200, 300, 400, 500) should not intersect Rectangle(1, 2, 3, 4)", r2.intersects(r1));
r2 = new Rectangle(3, 3, 0, 0);
assertTrue("Rectangle(1, 2, 3, 4) should intersect Rectangle(3, 3, 0, 0)", r1.intersects(r2));
assertTrue("Rectangle(3, 3, 0, 0) should intersect Rectangle(1, 2, 3, 4)", r2.intersects(r1));
r2 = new Rectangle(3, 3, -1, -1);
- assertTrue("Rectangle(1, 2, 3, 4) should not intersect Rectangle(3, 3, -1, -1)", !r1.intersects(r2));
- assertTrue("Rectangle(3, 3, -1, -1) should not intersect Rectangle(1, 2, 3, 4)", !r2.intersects(r1));
+ assertFalse("Rectangle(1, 2, 3, 4) should not intersect Rectangle(3, 3, -1, -1)", r1.intersects(r2));
+ assertFalse("Rectangle(3, 3, -1, -1) should not intersect Rectangle(1, 2, 3, 4)", r2.intersects(r1));
try {
r1.intersects(null);
@@ -282,7 +283,7 @@ public void test_isEmpty() {
assertTrue("Rectangle is empty", r.isEmpty());
r = new Rectangle(1, 2, 3, 4);
- assertTrue("Rectangle is not empty", !r.isEmpty());
+ assertFalse("Rectangle is not empty", r.isEmpty());
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java
index 021a08b4ad..e08b0b4264 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -37,8 +38,8 @@ public void test_Constructor() {
assertTrue(data.horizontalIndent == 0);
assertTrue(data.horizontalSpan == 1);
assertTrue(data.verticalSpan == 1);
- assertTrue(data.grabExcessHorizontalSpace == false);
- assertTrue(data.grabExcessVerticalSpace == false);
+ assertFalse(data.grabExcessHorizontalSpace);
+ assertFalse(data.grabExcessVerticalSpace);
}
@Test
@@ -47,8 +48,8 @@ public void test_ConstructorI() {
assertNotNull(data);
assertTrue(data.verticalAlignment == GridData.FILL);
assertTrue(data.horizontalAlignment == GridData.FILL);
- assertTrue(data.grabExcessHorizontalSpace == true);
- assertTrue(data.grabExcessVerticalSpace == true);
+ assertTrue(data.grabExcessHorizontalSpace);
+ assertTrue(data.grabExcessVerticalSpace);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java
index b35197de3e..54ee142670 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -62,7 +63,7 @@ public void test_getBounds() {
rect = new Rectangle(0,0,30,30);
caret.setBounds(rect);
- assertTrue(!caret.getBounds().equals(new Rectangle (0,0,60,70)));
+ assertFalse(caret.getBounds().equals(new Rectangle (0,0,60,70)));
}
@Test
@@ -75,24 +76,24 @@ public void test_getParent() {
@Test
public void test_isVisible() {
caret.setVisible(true);
- assertTrue(!caret.isVisible()); //because the shell is not visible
+ assertFalse(caret.isVisible()); //because the shell is not visible
caret.setVisible(false);
- assertTrue(!caret.isVisible());
+ assertFalse(caret.isVisible());
caret.setVisible(true);
canvas.setVisible(true);
shell.setVisible(true);
- assertTrue(caret.getVisible() == true);
+ assertTrue(caret.getVisible());
canvas.setVisible(false);
if (SwtTestUtil.fCheckVisibility) {
- assertTrue(!caret.getVisible());
+ assertFalse(caret.getVisible());
}
shell.setVisible(false);
canvas.setVisible(false);
caret.setVisible(false);
- assertTrue(!caret.getVisible());
+ assertFalse(caret.getVisible());
}
@Test
@@ -159,9 +160,9 @@ public void test_setImageLorg_eclipse_swt_graphics_Image() {
@Test
public void test_setVisibleZ() {
caret.setVisible(true);
- assertTrue("Caret should be visible", caret.getVisible()==true);
+ assertTrue("Caret should be visible", caret.getVisible());
caret.setVisible(false);
- assertTrue("Caret should not be visible", caret.getVisible()==false);
+ assertFalse("Caret should not be visible", caret.getVisible());
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
index 9ac7c4aabf..4bb797bad2 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -178,7 +178,7 @@ public void test_addModifyListenerLorg_eclipse_swt_events_ModifyListener() {
combo.removeModifyListener(listener);
// cause to call the listener.
combo.setText("line");
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
try {
combo.removeModifyListener(null);
}
@@ -211,7 +211,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
exceptionThrown = false;
combo.addSelectionListener(listener);
combo.select(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
combo.removeSelectionListener(listener);
try {
combo.removeSelectionListener(null);
@@ -229,12 +229,12 @@ public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_event
combo.addSelectionListener(listener);
combo.select(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
combo.removeSelectionListener(listener);
listenerCalled = false;
combo.select(0);
- assertTrue(listenerCalled == false);
+ assertFalse(listenerCalled);
}
@Test
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 fa24738ef0..181b56ad87 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, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -368,11 +368,11 @@ public void test_isEnabled() {
assertTrue(control.isEnabled());
control.setEnabled(false);
- assertTrue(!control.isEnabled());
+ assertFalse(control.isEnabled());
}
@Test
public void test_isFocusControl() {
- assertTrue(!control.isFocusControl());
+ assertFalse(control.isFocusControl());
}
@Test
public void test_isReparentable() {
@@ -381,17 +381,17 @@ public void test_isReparentable() {
@Test
public void test_isVisible() {
control.setVisible(true);
- assertTrue(!control.isVisible()); //because the shell is not visible
+ assertFalse(control.isVisible()); //because the shell is not visible
control.setVisible(false);
- assertTrue(!control.isVisible());
+ assertFalse(control.isVisible());
if (!SwtTestUtil.isAIX) {
control.setVisible(true);
shell.setVisible(true);
assertTrue("Window should be visible", control.isVisible());
shell.setVisible(false);
- assertTrue("Window should not be visible", !control.isVisible());
+ assertFalse("Window should not be visible", control.isVisible());
}
}
@Test
@@ -451,7 +451,7 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
control.setBackground(color);
assertEquals("getBackground not equal color after setBackground(color)", color, control.getBackground());
control.setBackground(null);
- assertTrue("getBackground unchanged after setBackground(null)", !control.getBackground().equals(color));
+ assertFalse("getBackground unchanged after setBackground(null)", control.getBackground().equals(color));
// Skipping test run for GTK, already failing on GTK3. May be related to bug 421836
if (!"gtk".equals(SWT.getPlatform ())) {
// With alpha zero
@@ -459,7 +459,7 @@ public void test_setBackgroundLorg_eclipse_swt_graphics_Color() {
control.setBackground(color);
assertEquals("getBackground not equal color after setBackground(color) with 0 alpha", color, control.getBackground());
control.setBackground(null);
- assertTrue("getBackground unchanged after setBackground(null)", !control.getBackground().equals(color));
+ assertFalse("getBackground unchanged after setBackground(null)", control.getBackground().equals(color));
color.dispose();
}
if ("gtk".equals(SWT.getPlatform ())) {
@@ -520,7 +520,7 @@ public void test_setEnabledZ() {
assertTrue(control.getEnabled());
control.setEnabled(false);
- assertTrue(!control.getEnabled());
+ assertFalse(control.getEnabled());
}
@Test
public void test_setTextDirection() {
@@ -574,7 +574,7 @@ public void test_setForegroundLorg_eclipse_swt_graphics_Color() {
control.setForeground(color);
assertEquals(color, control.getForeground());
control.setForeground(null);
- assertTrue(!control.getForeground().equals(color));
+ assertFalse(control.getForeground().equals(color));
if ("gtk".equals(SWT.getPlatform ())) {
Color bg = new Color(control.getDisplay(), 0, 255, 0);
control.setForeground(color);
@@ -652,7 +652,7 @@ public void test_setParentLorg_eclipse_swt_widgets_Composite() {
Button b = new Button(originalParent, SWT.PUSH);
b.setParent(newParent);
originalParent.dispose();
- assertTrue(!b.isDisposed());
+ assertFalse(b.isDisposed());
newParent.dispose();
}
}
@@ -714,7 +714,7 @@ public void test_setVisibleZ() {
assertTrue(control.getVisible());
control.setVisible(false);
- assertTrue(!control.getVisible());
+ assertFalse(control.getVisible());
}
@Test
public void test_toControlII() {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
index 06adb4d637..e448e8f13d 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -131,10 +131,10 @@ public void test_setImageLorg_eclipse_swt_graphics_Image() {
@Test
public void test_setMaximizedZ() {
decorations.setMaximized(false);
- assertTrue(":1:", decorations.getMaximized() == false);
+ assertFalse(":1:", decorations.getMaximized());
decorations.setMaximized(true);
- assertTrue(":2:", decorations.getMaximized() == true);
- assertTrue(":3:", decorations.getMinimized() == false);
+ assertTrue(":2:", decorations.getMaximized());
+ assertFalse(":3:", decorations.getMinimized());
}
@Test
@@ -150,10 +150,10 @@ public void test_setMenuBarLorg_eclipse_swt_widgets_Menu() {
@Test
public void test_setMinimizedZ() {
decorations.setMinimized(false);
- assertTrue(":1:", decorations.getMinimized() == false);
+ assertFalse(":1:", decorations.getMinimized());
decorations.setMinimized(true);
- assertTrue(":2:", decorations.getMinimized() == true);
- assertTrue(":3:", decorations.getMaximized() == false);
+ assertTrue(":2:", decorations.getMinimized());
+ assertFalse(":3:", decorations.getMaximized());
}
@Test
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 b123e529f7..9e0f0cc5d2 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, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -178,7 +179,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
list.addSelectionListener(listener);
list.select(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
list.removeSelectionListener(listener);
exceptionThrown = false;
try {
@@ -205,7 +206,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
list.addSelectionListener(listener);
list.select(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
list.removeSelectionListener(listener);
exceptionThrown = false;
try {
@@ -224,7 +225,7 @@ public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_event
list.addSelectionListener(listener);
list.select(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
list.removeSelectionListener(listener);
// test single-selection list
@@ -233,7 +234,7 @@ public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_event
list.addSelectionListener(listener);
list.select(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
list.removeSelectionListener(listener);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
index ba995b6f6c..0be5d2c292 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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.assertTrue;
import static org.junit.Assert.fail;
@@ -78,7 +79,7 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()
exceptionThrown = false;
slider.addSelectionListener(listener);
slider.setSelection(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
slider.removeSelectionListener(listener);
try {
slider.removeSelectionListener(null);
@@ -96,7 +97,7 @@ public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_event
slider.addSelectionListener(listener);
slider.setSelection(0);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
slider.removeSelectionListener(listener);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java
index 95e2d9e8c4..8c8899da7c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -175,16 +175,16 @@ public void test_setImageLorg_eclipse_swt_graphics_Image() {
@Test
public void test_setMoveableZ() {
- assertTrue(":a:", tableColumn.getMoveable() == false);
+ assertFalse(":a:", tableColumn.getMoveable());
tableColumn.setMoveable(true);
- assertTrue(":b:", tableColumn.getMoveable() == true);
+ assertTrue(":b:", tableColumn.getMoveable());
tableColumn.setMoveable(true);
- assertTrue(":c:", tableColumn.getMoveable() == true);
+ assertTrue(":c:", tableColumn.getMoveable());
tableColumn.setMoveable(false);
- assertTrue(":d:", tableColumn.getMoveable() == false);
+ assertFalse(":d:", tableColumn.getMoveable());
TableColumn tableColumn2 = new TableColumn(tableColumn.getParent(), SWT.NONE);
tableColumn2.dispose();
@@ -200,16 +200,16 @@ public void test_setMoveableZ() {
@Test
public void test_setResizableZ() {
- assertTrue(":a:", tableColumn.getResizable() == true);
+ assertTrue(":a:", tableColumn.getResizable());
tableColumn.setResizable(false);
- assertTrue(":b:", tableColumn.getResizable() == false);
+ assertFalse(":b:", tableColumn.getResizable());
tableColumn.setResizable(false);
- assertTrue(":c:", tableColumn.getResizable() == false);
+ assertFalse(":c:", tableColumn.getResizable());
tableColumn.setResizable(true);
- assertTrue(":d:", tableColumn.getResizable() == true);
+ assertTrue(":d:", tableColumn.getResizable());
}
@Override
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 49c831de71..3837f5a1e0 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, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -84,7 +84,7 @@ public void test_addModifyListenerLorg_eclipse_swt_events_ModifyListener() {
text.removeModifyListener(listener);
// cause to call the listener.
text.setText("line");
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
try {
text.removeModifyListener(null);
}
@@ -137,7 +137,7 @@ public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_event
text.addSelectionListener(listener);
text.setText("12345");
text.setSelection(1,3);
- assertTrue(":a:", listenerCalled == false);
+ assertFalse(":a:", listenerCalled);
text.removeSelectionListener(listener);
}
@@ -204,7 +204,7 @@ public void test_addVerifyListenerLorg_eclipse_swt_events_VerifyListener() {
listenerCalled = false;
text.removeVerifyListener(listener);
text.setText(line);
- assertTrue("Listener not removed", listenerCalled == false);
+ assertFalse("Listener not removed", listenerCalled);
}
@Test
@@ -521,15 +521,15 @@ public void test_getEchoChar() {
@Test
public void test_getEditable() {
- assertTrue(":a:", text.getEditable() == true);
+ assertTrue(":a:", text.getEditable());
text.setEditable(true);
- assertTrue(":b:", text.getEditable() == true);
+ assertTrue(":b:", text.getEditable());
text.setEditable(false);
- assertTrue(":c:", text.getEditable() == false);
+ assertFalse(":c:", text.getEditable());
text.setEditable(false);
- assertTrue(":d:", text.getEditable() == false);
+ assertFalse(":d:", text.getEditable());
text.setEditable(true);
- assertTrue(":e:", text.getEditable() == true);
+ assertTrue(":e:", text.getEditable());
}
@Test
@@ -972,7 +972,7 @@ public void test_isVisible() {
shell.setVisible(true);
assertTrue("Window should be visible", control.isVisible());
shell.setVisible(false);
- assertTrue("Window should not be visible", !control.isVisible());
+ assertFalse("Window should not be visible", control.isVisible());
}
}
@@ -1127,13 +1127,13 @@ public void test_setEchoCharC() {
@Test
public void test_setEditableZ() {
text.setEditable(true);
- assertTrue(":a:", text.getEditable() == true);
+ assertTrue(":a:", text.getEditable());
text.setEditable(false);
- assertTrue(":b:", text.getEditable() == false);
+ assertFalse(":b:", text.getEditable());
text.setEditable(false);
- assertTrue(":c:", text.getEditable() == false);
+ assertFalse(":c:", text.getEditable());
text.setEditable(true);
- assertTrue(":d:", text.getEditable() == true);
+ assertTrue(":d:", text.getEditable());
}
@Override
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java
index 2cb3aced3d..0903cdbeac 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -174,16 +174,16 @@ public void test_setImageLorg_eclipse_swt_graphics_Image() {
@Test
public void test_setResizableZ() {
- assertTrue(":a:", treeColumn.getResizable() == true);
+ assertTrue(":a:", treeColumn.getResizable());
treeColumn.setResizable(false);
- assertTrue(":b:", treeColumn.getResizable() == false);
+ assertFalse(":b:", treeColumn.getResizable());
treeColumn.setResizable(false);
- assertTrue(":c:", treeColumn.getResizable() == false);
+ assertFalse(":c:", treeColumn.getResizable());
treeColumn.setResizable(true);
- assertTrue(":d:", treeColumn.getResizable() == true);
+ assertTrue(":d:", treeColumn.getResizable());
}
@Override

Back to the top