From a5c88d39bd94a1812b6de3054ab9ee7d17bd8133 Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Fri, 2 Feb 2018 12:14:43 +0300 Subject: [PATCH] Fixing use of deprecated method --- java/client/test/org/openqa/selenium/UploadTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/java/client/test/org/openqa/selenium/UploadTest.java b/java/client/test/org/openqa/selenium/UploadTest.java index a5a2e0f151759..e073b91365e03 100644 --- a/java/client/test/org/openqa/selenium/UploadTest.java +++ b/java/client/test/org/openqa/selenium/UploadTest.java @@ -28,7 +28,6 @@ import static org.openqa.selenium.testing.Driver.CHROME; import static org.openqa.selenium.testing.Driver.HTMLUNIT; import static org.openqa.selenium.testing.Driver.IE; -import static org.openqa.selenium.testing.Driver.MARIONETTE; import static org.openqa.selenium.testing.Driver.SAFARI; import static org.openqa.selenium.testing.TestUtilities.catchThrowable; @@ -63,7 +62,7 @@ public void setUp() throws Exception { @SwitchToTopAfterTest @Test - public void testFileUploading() throws Exception { + public void testFileUploading() { assumeFalse( "This test as written assumes a file on local disk is accessible to the browser. " + "That is not true for browsers on mobile platforms.", @@ -85,7 +84,7 @@ public void testFileUploading() throws Exception { @Test @Ignore(IE) @Ignore(SAFARI) - public void testCleanFileInput() throws Exception { + public void testCleanFileInput() { driver.get(pages.uploadPage); WebElement element = driver.findElement(By.id("upload")); element.sendKeys(testFile.getAbsolutePath()); @@ -106,7 +105,7 @@ public void testClickFileInput() { } @Test - public void testUploadingWithHiddenFileInput() throws Exception { + public void testUploadingWithHiddenFileInput() { driver.get(appServer.whereIs("upload_invisible.html")); driver.findElement(By.id("upload")).sendKeys(testFile.getAbsolutePath()); driver.findElement(By.id("go")).click(); @@ -125,7 +124,7 @@ public void testUploadingWithHiddenFileInput() throws Exception { private File createTmpFile(String content) throws IOException { File f = File.createTempFile("webdriver", "tmp"); f.deleteOnExit(); - Files.write(content, f, StandardCharsets.UTF_8); + Files.asCharSink(f, StandardCharsets.UTF_8).write(content); return f; }