]> source.dussan.org Git - vaadin-framework.git/commitdiff
Replace assertEquals(true|false,) with assert(True|False)
authorPer-Åke Minborg <minborg@speedment.com>
Fri, 28 Oct 2016 16:57:32 +0000 (09:57 -0700)
committerHenri Sara <hesara@vaadin.com>
Sat, 5 Nov 2016 01:13:45 +0000 (03:13 +0200)
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7224

server/src/test/java/com/vaadin/server/VaadinServletConfigurationTest.java
server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java
server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java

index 3b711c8c16339696c6cd45a596044e7acab6815e..bc13afa4fd739e768bd217399e9ad23f96818546 100644 (file)
@@ -53,8 +53,8 @@ public class VaadinServletConfigurationTest {
         DeploymentConfiguration configuration = servlet.getService()
                 .getDeploymentConfiguration();
 
-        Assert.assertEquals(true, configuration.isProductionMode());
-        Assert.assertEquals(true, configuration.isCloseIdleSessions());
+        Assert.assertTrue(configuration.isProductionMode());
+        Assert.assertTrue(configuration.isCloseIdleSessions());
         Assert.assertEquals(1234, configuration.getHeartbeatInterval());
         Assert.assertEquals(4321, configuration.getResourceCacheTime());
 
@@ -78,10 +78,10 @@ public class VaadinServletConfigurationTest {
 
         // Values from servlet init params take precedence
         Assert.assertEquals(1111, configuration.getHeartbeatInterval());
-        Assert.assertEquals(false, configuration.isProductionMode());
+        Assert.assertFalse(configuration.isProductionMode());
 
         // Other params are as defined in the annotation
-        Assert.assertEquals(true, configuration.isCloseIdleSessions());
+        Assert.assertTrue(configuration.isCloseIdleSessions());
         Assert.assertEquals(4321, configuration.getResourceCacheTime());
 
         Class<? extends UI> uiClass = new DefaultUIProvider()
index 6b7ba963cc879a60d259acf7db7abf9286831212..30c07ccb11b9ec2fa76543d3fcd501be208e1023 100644 (file)
@@ -80,15 +80,15 @@ public class DesignFormatterTest {
         assertEquals("", formatter.format(true));
         assertEquals("false", formatter.format(false));
 
-        assertEquals(true, formatter.parse("true", boolean.class));
-        assertEquals(true, formatter.parse("foobar", boolean.class));
-        assertEquals(true, formatter.parse("", boolean.class));
-        assertEquals(false, formatter.parse("false", boolean.class));
-
-        assertEquals(true, formatter.parse("true", Boolean.class));
-        assertEquals(true, formatter.parse("foobar", Boolean.class));
-        assertEquals(true, formatter.parse("", Boolean.class));
-        assertEquals(false, formatter.parse("false", Boolean.class));
+        Assert.assertTrue(formatter.parse("true", boolean.class));
+        Assert.assertTrue(formatter.parse("foobar", boolean.class));
+        Assert.assertTrue(formatter.parse("", boolean.class));
+        Assert.assertFalse(formatter.parse("false", boolean.class));
+
+        Assert.assertTrue(formatter.parse("true", Boolean.class));
+        Assert.assertTrue(formatter.parse("foobar", Boolean.class));
+        Assert.assertTrue(formatter.parse("", Boolean.class));
+        Assert.assertFalse(formatter.parse("false", Boolean.class));
     }
 
     @Test
index 0b526541c280d86025ad889a83c973381461620f..60ec97ad50ced9d5bc03bb025752aa9d55b8ac44 100644 (file)
@@ -15,6 +15,7 @@ import com.vaadin.ui.TabSheet;
 import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
 import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
 import com.vaadin.ui.TabSheet.Tab;
+import org.junit.Assert;
 
 public class TabSheetTest {
 
@@ -28,7 +29,7 @@ public class TabSheetTest {
         Iterator<Component> iter = tabSheet.getComponentIterator();
 
         assertEquals(c, iter.next());
-        assertEquals(false, iter.hasNext());
+        Assert.assertFalse(iter.hasNext());
         assertNotNull(tabSheet.getTab(c));
     }
 
@@ -200,10 +201,10 @@ public class TabSheetTest {
         tabSheet.replaceComponent(lbl1, lbl2);
         assertSame(tab1, tabSheet.getTab(lbl1));
         assertSame(tab2, tabSheet.getTab(lbl2));
-        assertEquals(false, tab1.isClosable());
-        assertEquals(true, tab2.isClosable());
-        assertEquals(false, tab1.isEnabled());
-        assertEquals(true, tab2.isEnabled());
+        Assert.assertFalse(tab1.isClosable());
+        Assert.assertTrue(tab2.isClosable());
+        Assert.assertFalse(tab1.isEnabled());
+        Assert.assertTrue(tab2.isEnabled());
         assertEquals("description", tab1.getDescription());
         assertEquals(null, tab2.getDescription());
         assertEquals(3, tabSheet.getComponentCount());
@@ -219,7 +220,7 @@ public class TabSheetTest {
         assertNull(tabSheet.getTab(lbl1));
         assertNull(tab1.getComponent());
         assertNotNull(tabSheet.getTab(lbl3));
-        assertEquals(false, tabSheet.getTab(lbl3).isEnabled());
+        Assert.assertFalse(tabSheet.getTab(lbl3).isEnabled());
         assertEquals("description", tab1.getDescription());
         assertEquals(1, tabSheet.getTabPosition(tabSheet.getTab(lbl3)));
     }