From 73b4391a465113b8a7855c91655e6a605841d4c6 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Fri, 11 Sep 2015 16:19:52 +0200 Subject: [PATCH] [test] fix urls for windows --- .../elasticsearch/plugins/PluginManagerCliTests.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/plugins/PluginManagerCliTests.java b/core/src/test/java/org/elasticsearch/plugins/PluginManagerCliTests.java index ee94e2d69af..f21609a5d55 100644 --- a/core/src/test/java/org/elasticsearch/plugins/PluginManagerCliTests.java +++ b/core/src/test/java/org/elasticsearch/plugins/PluginManagerCliTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.common.cli.CliToolTestCase; import org.junit.Test; import java.io.IOException; +import java.net.MalformedURLException; import java.nio.file.Path; import static org.elasticsearch.common.cli.CliTool.ExitStatus.OK_AND_EXIT; @@ -54,11 +55,12 @@ public class PluginManagerCliTests extends CliToolTestCase { assertTerminalOutputContainsHelpFile(terminal, "/org/elasticsearch/plugins/plugin-list.help"); } - public void testUrlSpacesInPath() { + public void testUrlSpacesInPath() throws MalformedURLException { CliToolTestCase.CaptureOutputTerminal terminal = new CliToolTestCase.CaptureOutputTerminal(); - Path tmpDir = createTempDir().resolve("foo"); - String finalDir = tmpDir.toAbsolutePath().toString() + "%20deps"; - CliTool.ExitStatus execute = new PluginManagerCliParser(terminal).execute(args("install file://" + finalDir)); + Path tmpDir = createTempDir().resolve("foo deps"); + String finalDir = tmpDir.toAbsolutePath().toUri().toURL().toString(); + logger.warn(finalDir); + CliTool.ExitStatus execute = new PluginManagerCliParser(terminal).execute(args("install " + finalDir)); assertThat(execute.status(), is(IO_ERROR.status())); } }