flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [2/5] flink git commit: [FLINK-6548] Fix AvroOutputFormatTest#testCompression on Windows
Date Fri, 12 May 2017 21:43:22 GMT
[FLINK-6548] Fix AvroOutputFormatTest#testCompression on Windows


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/2ebebdfc
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/2ebebdfc
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/2ebebdfc

Branch: refs/heads/master
Commit: 2ebebdfc7561a36d76d9c3f6c44617483db45a44
Parents: 0be04b4
Author: zentol <chesnay@apache.org>
Authored: Thu May 11 16:39:12 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Fri May 12 20:20:53 2017 +0200

----------------------------------------------------------------------
 .../org/apache/flink/api/java/io/AvroOutputFormatTest.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/2ebebdfc/flink-connectors/flink-avro/src/test/java/org/apache/flink/api/java/io/AvroOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-avro/src/test/java/org/apache/flink/api/java/io/AvroOutputFormatTest.java
b/flink-connectors/flink-avro/src/test/java/org/apache/flink/api/java/io/AvroOutputFormatTest.java
index 4d6c6b7..f843d3b 100644
--- a/flink-connectors/flink-avro/src/test/java/org/apache/flink/api/java/io/AvroOutputFormatTest.java
+++ b/flink-connectors/flink-avro/src/test/java/org/apache/flink/api/java/io/AvroOutputFormatTest.java
@@ -28,8 +28,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
 
 import org.apache.avro.Schema;
 import org.apache.flink.api.io.avro.example.User;
@@ -135,12 +133,13 @@ public class AvroOutputFormatTest {
 		assertTrue(fileSize(outputPath) > fileSize(compressedOutputPath));
 
 		// cleanup
-		Files.delete(Paths.get(outputPath.getPath()));
-		Files.delete(Paths.get(compressedOutputPath.getPath()));
+		FileSystem fs = FileSystem.getLocalFileSystem();
+		fs.delete(outputPath, false);
+		fs.delete(compressedOutputPath, false);
 	}
 
 	private long fileSize(Path path) throws IOException {
-		return Files.size(Paths.get(path.getPath()));
+		return path.getFileSystem().getFileStatus(path).getLen();
 	}
 
 	private void output(final AvroOutputFormat<User> outputFormat) throws IOException
{


Mime
View raw message