Repository: calcite Updated Branches: refs/heads/master 9c5ebe340 -> c25f7c937
[CALCITE-2034] FileReaderTest fails with path containing spaces (Marc Prud'hommeaux) Close apache/calcite#559 Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/c25f7c93 Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/c25f7c93 Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/c25f7c93 Branch: refs/heads/master Commit: c25f7c93787f210927c455e9907c753695a273a2 Parents: 9c5ebe3 Author: Marc Prud'hommeaux <[email protected]> Authored: Mon Nov 6 10:50:49 2017 -0500 Committer: Michael Mior <[email protected]> Committed: Mon Nov 6 12:07:39 2017 -0500 ---------------------------------------------------------------------- .../org/apache/calcite/adapter/file/FileReaderTest.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/c25f7c93/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java ---------------------------------------------------------------------- diff --git a/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java b/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java index b5e92aa..ec1034f 100644 --- a/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java +++ b/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java @@ -64,13 +64,10 @@ public class FileReaderTest { } } - private static String resourcePath(String path) { + private static String resourcePath(String path) throws Exception { final URL url = FileReaderTest.class.getResource("/" + path); - String s = url.toString(); - if (s.startsWith("file:")) { - s = s.substring("file:".length()); - } - return s; + final File file = new File(url.toURI()); + return file.getAbsolutePath(); } /** Tests {@link FileReader} URL instantiation - no path. */
