From bd82dabd9c37242d77bdfa7973a9eb63eef9f51a Mon Sep 17 00:00:00 2001 From: Sebastian Baunsgaard Date: Mon, 21 Aug 2023 14:33:11 +0200 Subject: [PATCH] [MINOR] Fix ThreadPoolTest Lint This commit fixes the instance of linting error in our tests. --- .../sysds/test/component/misc/ThreadPool.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java b/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java index 41659e57261..b19e2cf6633 100644 --- a/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java +++ b/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java @@ -295,8 +295,8 @@ public void justWorksShutdownNowNotMain() throws InterruptedException, Execution } @Test - public void mock1() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, - InterruptedException, ExecutionException, TimeoutException { + public void mock1() throws NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InterruptedException, ExecutionException, TimeoutException { ExecutorService p = mock(ExecutorService.class); ExecutorService c = new CommonThreadPool(p); @@ -347,8 +347,8 @@ public void mock1() throws NoSuchFieldException, SecurityException, IllegalArgum } @Test - public void mock2() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, - InterruptedException, ExecutionException, TimeoutException { + public void mock2() throws NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InterruptedException, ExecutionException, TimeoutException { CommonThreadPool p = mock(CommonThreadPool.class); when(p.isShutdown()).thenCallRealMethod(); @@ -390,8 +390,11 @@ public void invokeAndShutdownV2() throws InterruptedException { ExecutorService c = new CommonThreadPool(p); Collection> cc = (Collection>) null; List> f = new ArrayList>(); - f.add(mock(Future.class)); + f.add(mock(FI.class)); when(p.invokeAll(cc)).thenReturn(f); CommonThreadPool.invokeAndShutdown(c, null); } + + private interface FI extends Future { + } }