flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/6] flink git commit: [FLINK-3491] [tests] Prevent URIException in HDFSCopyTest and disable HDFSCopyUtilitiesTest on Windows
Date Fri, 04 Mar 2016 23:21:49 GMT
[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/5a63cbfd
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/5a63cbfd
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/5a63cbfd

Branch: refs/heads/release-1.0
Commit: 5a63cbfdfc8cc1b5464b8e16306fa6feac16a9a0
Parents: 0e61ffc
Author: zentol <s.motsu@web.de>
Authored: Wed Feb 24 11:14:23 2016 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Fri Mar 4 20:53:44 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/5a63cbfd/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))) {


Mime
View raw message