You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2017/10/24 15:16:45 UTC

[1/2] flink git commit: [hotfix] Suppress unchecked warnings in HeartbeatManagerTest

Repository: flink
Updated Branches:
  refs/heads/master 904c95104 -> b03bb9bfc


[hotfix] Suppress unchecked warnings in HeartbeatManagerTest


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

Branch: refs/heads/master
Commit: b03bb9bfc587c2853dff6c31e5e45bbaa17b7346
Parents: b001088
Author: Till Rohrmann <tr...@apache.org>
Authored: Tue Oct 24 12:42:13 2017 +0200
Committer: Till Rohrmann <tr...@apache.org>
Committed: Tue Oct 24 17:16:29 2017 +0200

----------------------------------------------------------------------
 .../flink/runtime/heartbeat/HeartbeatManagerTest.java  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b03bb9bf/flink-runtime/src/test/java/org/apache/flink/runtime/heartbeat/HeartbeatManagerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/heartbeat/HeartbeatManagerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/heartbeat/HeartbeatManagerTest.java
index 1727a59..75627ed 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/heartbeat/HeartbeatManagerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/heartbeat/HeartbeatManagerTest.java
@@ -66,6 +66,7 @@ public class HeartbeatManagerTest extends TestLogger {
 		long heartbeatTimeout = 1000L;
 		ResourceID ownResourceID = new ResourceID("foobar");
 		ResourceID targetResourceID = new ResourceID("barfoo");
+		@SuppressWarnings("unchecked")
 		HeartbeatListener<Object, Object> heartbeatListener = mock(HeartbeatListener.class);
 		ScheduledExecutor scheduledExecutor = mock(ScheduledExecutor.class);
 
@@ -81,6 +82,7 @@ public class HeartbeatManagerTest extends TestLogger {
 			scheduledExecutor,
 			LOG);
 
+		@SuppressWarnings("unchecked")
 		HeartbeatTarget<Object> heartbeatTarget = mock(HeartbeatTarget.class);
 
 		heartbeatManager.monitorTarget(targetResourceID, heartbeatTarget);
@@ -104,6 +106,7 @@ public class HeartbeatManagerTest extends TestLogger {
 		long heartbeatTimeout = 1000L;
 		ResourceID ownResourceID = new ResourceID("foobar");
 		ResourceID targetResourceID = new ResourceID("barfoo");
+		@SuppressWarnings("unchecked")
 		HeartbeatListener<Object, Object> heartbeatListener = mock(HeartbeatListener.class);
 		ScheduledExecutor scheduledExecutor = mock(ScheduledExecutor.class);
 		ScheduledFuture<?> scheduledFuture = mock(ScheduledFuture.class);
@@ -122,6 +125,7 @@ public class HeartbeatManagerTest extends TestLogger {
 			scheduledExecutor,
 			LOG);
 
+		@SuppressWarnings("unchecked")
 		HeartbeatTarget<Object> heartbeatTarget = mock(HeartbeatTarget.class);
 
 		heartbeatManager.monitorTarget(targetResourceID, heartbeatTarget);
@@ -162,6 +166,7 @@ public class HeartbeatManagerTest extends TestLogger {
 			new ScheduledExecutorServiceAdapter(new ScheduledThreadPoolExecutor(1)),
 			LOG);
 
+		@SuppressWarnings("unchecked")
 		HeartbeatTarget<Object> heartbeatTarget = mock(HeartbeatTarget.class);
 
 		CompletableFuture<ResourceID> timeoutFuture = heartbeatListener.getTimeoutFuture();
@@ -196,6 +201,7 @@ public class HeartbeatManagerTest extends TestLogger {
 		Object object2 = new Object();
 		ResourceID resourceID = new ResourceID("foobar");
 		ResourceID resourceID2 = new ResourceID("barfoo");
+		@SuppressWarnings("unchecked")
 		HeartbeatListener<Object, Object> heartbeatListener = mock(HeartbeatListener.class);
 
 		when(heartbeatListener.retrievePayload()).thenReturn(CompletableFuture.completedFuture(object));
@@ -261,7 +267,9 @@ public class HeartbeatManagerTest extends TestLogger {
 			new ScheduledExecutorServiceAdapter(new ScheduledThreadPoolExecutor(1)),
 			LOG);
 
-		heartbeatManager.monitorTarget(targetID, mock(HeartbeatTarget.class));
+		@SuppressWarnings("unchecked")
+		final HeartbeatTarget<Object> heartbeatTarget = mock(HeartbeatTarget.class);
+		heartbeatManager.monitorTarget(targetID, heartbeatTarget);
 
 		heartbeatManager.unmonitorTarget(targetID);
 
@@ -282,6 +290,7 @@ public class HeartbeatManagerTest extends TestLogger {
 	public void testLastHeartbeatFromUnregisteredTarget() {
 		final long heartbeatTimeout = 100L;
 		final ResourceID resourceId = ResourceID.generate();
+		@SuppressWarnings("unchecked")
 		final HeartbeatListener<Object, Object> heartbeatListener = mock(HeartbeatListener.class);
 
 		HeartbeatManager<?, ?> heartbeatManager = new HeartbeatManagerImpl<>(
@@ -306,7 +315,9 @@ public class HeartbeatManagerTest extends TestLogger {
 	public void testLastHeartbeatFrom() {
 		final long heartbeatTimeout = 100L;
 		final ResourceID resourceId = ResourceID.generate();
+		@SuppressWarnings("unchecked")
 		final HeartbeatListener<Object, Object> heartbeatListener = mock(HeartbeatListener.class);
+		@SuppressWarnings("unchecked")
 		final HeartbeatTarget<Object> heartbeatTarget = mock(HeartbeatTarget.class);
 		final ResourceID target = ResourceID.generate();
 


[2/2] flink git commit: [hotfix] [tests] Remove AbstractTestBase from CsvOutputFormatITCase and TextOutputFormatITCase

Posted by tr...@apache.org.
[hotfix] [tests] Remove AbstractTestBase from CsvOutputFormatITCase and TextOutputFormatITCase


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

Branch: refs/heads/master
Commit: b00108880a75d6a4acd52409adbdfe11b0d5b90e
Parents: 904c951
Author: Till Rohrmann <tr...@apache.org>
Authored: Mon Oct 23 17:15:07 2017 +0200
Committer: Till Rohrmann <tr...@apache.org>
Committed: Tue Oct 24 17:16:29 2017 +0200

----------------------------------------------------------------------
 .../streaming/scala/api/CsvOutputFormatITCase.java    | 14 ++------------
 .../streaming/scala/api/TextOutputFormatITCase.java   | 14 ++------------
 2 files changed, 4 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b0010888/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/CsvOutputFormatITCase.java
----------------------------------------------------------------------
diff --git a/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/CsvOutputFormatITCase.java b/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/CsvOutputFormatITCase.java
index b5a6f47..fb7c765 100644
--- a/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/CsvOutputFormatITCase.java
+++ b/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/CsvOutputFormatITCase.java
@@ -17,12 +17,10 @@
 
 package org.apache.flink.streaming.scala.api;
 
-import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.FileSystem;
 import org.apache.flink.streaming.api.scala.OutputFormatTestPrograms;
 import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase;
 import org.apache.flink.test.testdata.WordCountData;
-import org.apache.flink.test.util.AbstractTestBase;
 
 import org.junit.After;
 import org.junit.Before;
@@ -40,17 +38,10 @@ public class CsvOutputFormatITCase extends StreamingMultipleProgramsTestBase  {
 
 	protected String resultPath;
 
-	public AbstractTestBase fileInfo = new AbstractTestBase(new Configuration()) {
-		@Override
-		public void startCluster() throws Exception {
-			super.startCluster();
-		}
-	};
-
 	@Before
 	public void createFile() throws Exception {
-		File f = fileInfo.createAndRegisterTempFile("result");
-		resultPath = f.toURI().toString();
+		File resultFile = createAndRegisterTempFile("result");
+		resultPath = resultFile.toURI().toString();
 	}
 
 	@Test
@@ -115,7 +106,6 @@ public class CsvOutputFormatITCase extends StreamingMultipleProgramsTestBase  {
 	public void closeFile() throws Exception {
 		compareResultsByLinesInMemory(WordCountData.STREAMING_COUNTS_AS_TUPLES
 				.replaceAll("[\\\\(\\\\)]", ""), resultPath);
-		fileInfo.stopCluster();
 	}
 }
 

http://git-wip-us.apache.org/repos/asf/flink/blob/b0010888/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/TextOutputFormatITCase.java
----------------------------------------------------------------------
diff --git a/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/TextOutputFormatITCase.java b/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/TextOutputFormatITCase.java
index 00452fb..84b81e2 100644
--- a/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/TextOutputFormatITCase.java
+++ b/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/TextOutputFormatITCase.java
@@ -17,12 +17,10 @@
 
 package org.apache.flink.streaming.scala.api;
 
-import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.FileSystem;
 import org.apache.flink.streaming.api.scala.OutputFormatTestPrograms;
 import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase;
 import org.apache.flink.test.testdata.WordCountData;
-import org.apache.flink.test.util.AbstractTestBase;
 
 import org.junit.After;
 import org.junit.Before;
@@ -40,17 +38,10 @@ public class TextOutputFormatITCase extends StreamingMultipleProgramsTestBase {
 
 	protected String resultPath;
 
-	public AbstractTestBase fileInfo = new AbstractTestBase(new Configuration()) {
-		@Override
-		public void startCluster() throws Exception {
-			super.startCluster();
-		}
-	};
-
 	@Before
 	public void createFile() throws Exception {
-		File f = fileInfo.createAndRegisterTempFile("result");
-		resultPath = f.toURI().toString();
+		File resultFile = createAndRegisterTempFile("result");
+		resultPath = resultFile.toURI().toString();
 	}
 
 	@Test
@@ -77,7 +68,6 @@ public class TextOutputFormatITCase extends StreamingMultipleProgramsTestBase {
 	@After
 	public void closeFile() throws Exception {
 		compareResultsByLinesInMemory(WordCountData.STREAMING_COUNTS_AS_TUPLES, resultPath);
-		fileInfo.stopCluster();
 	}
 
 }