You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2016/03/05 00:25:37 UTC
[08/10] flink git commit: [FLINK-3491] [tests] Prevent URIException
in HDFSCopyTest and disable HDFSCopyUtilitiesTest on Windows
[FLINK-3491] [tests] Prevent URIException in HDFSCopyTest and disable HDFSCopyUtilitiesTest on Windows
This closes #1703
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/c9863576
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/c9863576
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/c9863576
Branch: refs/heads/master
Commit: c986357695558687058d8aff89b16085345d12bb
Parents: e3835a8
Author: zentol <s....@web.de>
Authored: Wed Feb 24 11:14:23 2016 +0100
Committer: Stephan Ewen <se...@apache.org>
Committed: Fri Mar 4 20:58:33 2016 +0100
----------------------------------------------------------------------
.../flink/streaming/util/HDFSCopyUtilitiesTest.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/c9863576/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java b/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java
index 07e1e65..9022e18 100644
--- a/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java
+++ b/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java
@@ -17,6 +17,10 @@
*/
package org.apache.flink.streaming.util;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.util.OperatingSystem;
+import org.junit.Assume;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -26,7 +30,6 @@ import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.net.URI;
import static org.junit.Assert.assertTrue;
@@ -35,6 +38,11 @@ public class HDFSCopyUtilitiesTest {
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
+ @Before
+ public void checkOperatingSystem() {
+ Assume.assumeTrue("This test can't run successfully on Windows.", !OperatingSystem.isWindows());
+ }
+
/**
* This test verifies that a hadoop configuration is correctly read in the external
@@ -54,7 +62,7 @@ public class HDFSCopyUtilitiesTest {
HDFSCopyFromLocal.copyFromLocal(
originalFile,
- new URI(copyFile.getAbsolutePath()));
+ new Path(copyFile.getAbsolutePath()).toUri());
try (DataInputStream in = new DataInputStream(new FileInputStream(copyFile))) {
assertTrue(in.readUTF().equals("Hello there, 42!"));
@@ -79,7 +87,7 @@ public class HDFSCopyUtilitiesTest {
}
HDFSCopyToLocal.copyToLocal(
- new URI(originalFile.getAbsolutePath()),
+ new Path(originalFile.getAbsolutePath()).toUri(),
copyFile);
try (DataInputStream in = new DataInputStream(new FileInputStream(copyFile))) {