[HtmlUnit] SVN: [13827] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [13827] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit

asashour-2
Revision: 13827
          http://sourceforge.net/p/htmlunit/code/13827
Author:   asashour
Date:     2017-03-19 18:57:26 +0000 (Sun, 19 Mar 2017)
Log Message:
-----------
trivial

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/SimpleWebTestCase.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/UrlFetchWebConnectionTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/gae/GAELoadPageTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowConcurrencyTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElementTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -74,12 +74,12 @@
         // Disable cookies.
         mgr.setCookiesEnabled(false);
         assertFalse(mgr.isCookiesEnabled());
-        assertEquals(0, mgr.getCookies().size());
+        assertTrue(mgr.getCookies().isEmpty());
 
         // Add a cookie after disabling cookies.
         final Cookie cookie2 = new Cookie("a", "b", "c", "d", new Date(System.currentTimeMillis() + 5000), false);
         mgr.addCookie(cookie2);
-        assertEquals(0, mgr.getCookies().size());
+        assertTrue(mgr.getCookies().isEmpty());
         assertFalse(mgr.clearExpired(new Date(System.currentTimeMillis() + 10_000)));
 
         // Enable cookies again.

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/SimpleWebTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/SimpleWebTestCase.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/SimpleWebTestCase.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -249,7 +249,7 @@
      */
     @Before
     public void before() {
-        assertEquals(0, getJavaScriptThreads().size());
+        assertTrue(getJavaScriptThreads().isEmpty());
     }
 
     /**

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/UrlFetchWebConnectionTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/UrlFetchWebConnectionTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/UrlFetchWebConnectionTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -180,7 +180,7 @@
      */
     @Test
     public void emptyStringHasNoCookies() {
-        assertEquals(0, UrlFetchWebConnection.parseCookies("www.foo.com", "").size());
+        assertTrue(UrlFetchWebConnection.parseCookies("www.foo.com", "").isEmpty());
     }
 
     /**

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -1040,7 +1040,7 @@
     @Before
     public void before() {
         if (!isWebClientCached()) {
-            assertEquals(0, getJavaScriptThreads().size());
+            assertTrue(getJavaScriptThreads().isEmpty());
         }
     }
 
@@ -1059,7 +1059,7 @@
                 webClient_.getCookieManager().clearCookies();
             }
             webClient_ = null;
-            assertEquals(0, getJavaScriptThreads().size());
+            assertTrue(getJavaScriptThreads().isEmpty());
         }
 
         if (useRealBrowser()) {

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -71,7 +71,7 @@
         conn.setResponse(URL_FIRST, content1);
         conn.setResponse(URL_SECOND, content2, 200, "OK", "text/html", headers);
         client.setWebConnection(conn);
-        assertEquals(0, attachments.size());
+        assertTrue(attachments.isEmpty());
 
         final HtmlPage result = client.getPage(URL_FIRST);
         final HtmlAnchor anchor = result.getAnchors().get(0);

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/gae/GAELoadPageTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/gae/GAELoadPageTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/gae/GAELoadPageTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -15,6 +15,7 @@
 package com.gargoylesoftware.htmlunit.gae;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
@@ -143,11 +144,11 @@
             client.getPage(FIRST_URL);
             final long startTime = System.currentTimeMillis();
 
-            assertEquals(0, collectedAlerts.size());
+            assertTrue(collectedAlerts.isEmpty());
 
             // pump but not long enough
             int executedJobs = client.getJavaScriptEngine().pumpEventLoop(timeout / 2);
-            assertEquals(0, collectedAlerts.size());
+            assertTrue(collectedAlerts.isEmpty());
 
             // pump a bit more
             executedJobs = client.getJavaScriptEngine().pumpEventLoop(timeout + 1);

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -333,7 +333,7 @@
         final HtmlHead head = (HtmlHead) title.getParentNode();
         assertEquals(results, head.getByXPath("//title"));
         assertEquals(results, head.getByXPath("./title"));
-        assertEquals(0, head.getByXPath("/title").size());
+        assertTrue(head.getByXPath("/title").isEmpty());
         assertEquals(results, head.getByXPath("title"));
 
         final HtmlElement div = page.getFirstByXPath("//div");

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -1128,7 +1128,7 @@
 
         // attribute value is case sensitive
         elements = form.getElementsByAttribute("input", "value", "pushMe");
-        assertEquals(0, elements.size());
+        assertTrue(elements.isEmpty());
 
         // selected='selected'
         elements = form.getElementsByAttribute("option", "selected", "selected");

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -1359,7 +1359,7 @@
 
         }
         Thread.sleep(400);
-        assertEquals(0, getJavaScriptThreads().size());
+        assertTrue(getJavaScriptThreads().isEmpty());
     }
 
     /**
@@ -1382,7 +1382,7 @@
         loadPage(html);
 
         getWebClient().close();
-        assertEquals(0, getJavaScriptThreads().size());
+        assertTrue(getJavaScriptThreads().isEmpty());
     }
 
     /**

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -167,7 +167,7 @@
         final HtmlAnchor anchor = page.getHtmlElementById("clickme");
         final HtmlPage newPage = anchor.click();
         assertEquals("new page should load", "Third", newPage.getTitleText());
-        assertEquals("frame should be gone", 0, newPage.getFrames().size());
+        assertTrue("frame should be gone", newPage.getFrames().isEmpty());
 
         mgr.waitForJobs(10_000);
         assertEquals("job manager should have no jobs left", 0, mgr.getJobCount());

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowConcurrencyTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowConcurrencyTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowConcurrencyTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -396,7 +396,7 @@
         client_.getPage(URL_FIRST);
         client_.close();
         client_.waitForBackgroundJavaScript(5000);
-        assertEquals(0, collectedAlerts.size());
+        assertTrue(collectedAlerts.isEmpty());
     }
 
     /**
@@ -430,7 +430,7 @@
         client_.waitForBackgroundJavaScript(5000);
         client_.waitForBackgroundJavaScript(5000);
 
-        assertEquals(0, collectedAlerts.size());
+        assertTrue(collectedAlerts.isEmpty());
     }
 
     /**

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElementTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElementTest.java 2017-03-19 18:19:22 UTC (rev 13826)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElementTest.java 2017-03-19 18:57:26 UTC (rev 13827)
@@ -135,6 +135,6 @@
 
         // frame has to be gone
         frames = page.getFrames();
-        assertEquals(0, frames.size());
+        assertTrue(frames.isEmpty());
     }
 }


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop