Repository: beam Updated Branches: refs/heads/master 36c55ebc5 -> ae0de1bb5
[BEAM-2578] Fix DebuggingWordCountTest on Windows platform Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/53ce5829 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/53ce5829 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/53ce5829 Branch: refs/heads/master Commit: 53ce58296b8a4a8359caf1593289f0881e85172d Parents: 36c55eb Author: eralmas7 <[email protected]> Authored: Mon Jul 10 23:14:24 2017 +0530 Committer: Jean-Baptiste Onofré <[email protected]> Committed: Sun Jul 16 21:28:15 2017 +0200 ---------------------------------------------------------------------- .../org/apache/beam/examples/DebuggingWordCountTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/53ce5829/examples/java/src/test/java/org/apache/beam/examples/DebuggingWordCountTest.java ---------------------------------------------------------------------- diff --git a/examples/java/src/test/java/org/apache/beam/examples/DebuggingWordCountTest.java b/examples/java/src/test/java/org/apache/beam/examples/DebuggingWordCountTest.java index 054277a..be48a99 100644 --- a/examples/java/src/test/java/org/apache/beam/examples/DebuggingWordCountTest.java +++ b/examples/java/src/test/java/org/apache/beam/examples/DebuggingWordCountTest.java @@ -35,6 +35,13 @@ import org.junit.runners.JUnit4; public class DebuggingWordCountTest { @Rule public TemporaryFolder tmpFolder = new TemporaryFolder(); + private String getFilePath(String filePath) { + if (filePath.contains(":")) { + return filePath.replace("\\", "/").split(":")[1]; + } + return filePath; + } + @Test public void testDebuggingWordCount() throws Exception { File inputFile = tmpFolder.newFile(); @@ -45,8 +52,8 @@ public class DebuggingWordCountTest { StandardCharsets.UTF_8); WordCountOptions options = TestPipeline.testingPipelineOptions().as(WordCountOptions.class); - options.setInputFile(inputFile.getAbsolutePath()); - options.setOutput(outputFile.getAbsolutePath()); + options.setInputFile(getFilePath(inputFile.getAbsolutePath())); + options.setOutput(getFilePath(outputFile.getAbsolutePath())); DebuggingWordCount.main(TestPipeline.convertToArgs(options)); } }
