[HtmlUnit] SVN: [15468] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ ExternalTest.java

rbri--- via HtmlUnit-develop <[email protected]> Mon, 16 Jul 2018 17:46:21 +0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15468
          http://sourceforge.net/p/htmlunit/code/15468
Author:   rbri
Date:     2018-07-16 17:46:08 +0000 (Mon, 16 Jul 2018)
Log Message:
-----------
cleanup and ignore network problems

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java	2018-07-16 17:45:39 UTC (rev 15467)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java	2018-07-16 17:46:08 UTC (rev 15468)
@@ -87,9 +87,6 @@
             }
 
             assertVersion("org.sonatype.oss", "oss-parent", "9");
-
-            assertChromeDriver();
-            assertGeckoDriver();
         }
     }
 
@@ -106,7 +103,12 @@
         }
     }
 
-    private static void assertChromeDriver() throws Exception {
+    /**
+     * Tests that we use the latest chrome driver.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void assertChromeDriver() throws Exception {
         try (WebClient webClient = getWebClient()) {
             final AbstractPage page = webClient.getPage("https://chromedriver.storage.googleapis.com/LATEST_RELEASE");
             final String pageContent = page.getWebResponse().getContentAsString().trim();
@@ -114,11 +116,21 @@
         }
     }
 
-    private static void assertGeckoDriver() throws Exception {
+    /**
+     * Tests that we use the latest gecko driver.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void assertGeckoDriver() throws Exception {
         try (WebClient webClient = getWebClient()) {
-            final HtmlPage page = webClient.getPage("https://github.com/mozilla/geckodriver/releases/latest");
-            final DomNodeList<DomNode> divs = page.querySelectorAll(".release-title");
-            assertEquals("Gecko Driver", divs.get(0).asText(), "v" + GECKO_DRIVER_);
+            try {
+                final HtmlPage page = webClient.getPage("https://github.com/mozilla/geckodriver/releases/latest");
+                final DomNodeList<DomNode> divs = page.querySelectorAll(".release-title");
+                assertEquals("Gecko Driver", divs.get(0).asText(), "v" + GECKO_DRIVER_);
+            }
+            catch (final FailingHttpStatusCodeException e) {
+                // ignore
+            }
         }
     }
 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot