flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject [2/5] flink git commit: [FLINK-8941][tests] use TestLogger and TemporaryFolder in SpanningRecordSerializationTest
Date Wed, 28 Mar 2018 06:12:25 GMT
[FLINK-8941][tests] use TestLogger and TemporaryFolder in SpanningRecordSerializationTest


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

Branch: refs/heads/release-1.5
Commit: 7a060d4191729b2c6cd1d0c8ba6044d22618b349
Parents: f1df310
Author: Nico Kruber <nico@data-artisans.com>
Authored: Fri Mar 16 11:43:43 2018 +0100
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Wed Mar 28 08:12:05 2018 +0200

----------------------------------------------------------------------
 .../serialization/SpanningRecordSerializationTest.java  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/7a060d41/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializationTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializationTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializationTest.java
index 16b77e6..2e1063f 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializationTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializationTest.java
@@ -27,9 +27,12 @@ import org.apache.flink.testutils.serialization.types.IntType;
 import org.apache.flink.testutils.serialization.types.SerializationTestType;
 import org.apache.flink.testutils.serialization.types.SerializationTestTypeFactory;
 import org.apache.flink.testutils.serialization.types.Util;
+import org.apache.flink.util.TestLogger;
 
 import org.junit.Assert;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 
 import java.io.IOException;
 import java.util.ArrayDeque;
@@ -43,9 +46,12 @@ import static org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils.
 /**
  * Tests for the {@link SpillingAdaptiveSpanningRecordDeserializer}.
  */
-public class SpanningRecordSerializationTest {
+public class SpanningRecordSerializationTest extends TestLogger {
 	private static final Random RANDOM = new Random(42);
 
+	@Rule
+	public TemporaryFolder tempFolder = new TemporaryFolder();
+
 	@Test
 	public void testIntRecordsSpanningMultipleSegments() throws Exception {
 		final int segmentSize = 1;
@@ -100,11 +106,11 @@ public class SpanningRecordSerializationTest {
 
 	// -----------------------------------------------------------------------------------------------------------------
 
-	private static void testSerializationRoundTrip(Iterable<SerializationTestType> records,
int segmentSize) throws Exception {
+	private void testSerializationRoundTrip(Iterable<SerializationTestType> records, int
segmentSize) throws Exception {
 		RecordSerializer<SerializationTestType> serializer = new SpanningRecordSerializer<>();
 		RecordDeserializer<SerializationTestType> deserializer =
 			new SpillingAdaptiveSpanningRecordDeserializer<>(
-				new String[]{System.getProperty("java.io.tmpdir")});
+				new String[]{ tempFolder.getRoot().getAbsolutePath() });
 
 		testSerializationRoundTrip(records, segmentSize, serializer, deserializer);
 	}


Mime
View raw message