diff --git a/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/ConcurrentTestRunner.java b/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/ConcurrentTestRunner.java index 1d0e03023df4..d71a85c3d9b7 100644 --- a/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/ConcurrentTestRunner.java +++ b/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/ConcurrentTestRunner.java @@ -14,6 +14,7 @@ */ package org.apache.geode.test.concurrency; +import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.List; @@ -81,8 +82,9 @@ public ConcurrentTestRunner(Class testClass) throws InitializationError { } try { - runner = configuration.runner().newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + runner = configuration.runner().getDeclaredConstructor().newInstance(); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException + | NoSuchMethodException e) { throw new InitializationError(e); } } diff --git a/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/loop/LoopRunner.java b/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/loop/LoopRunner.java index 6747ed6a001b..04442cfec073 100644 --- a/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/loop/LoopRunner.java +++ b/geode-concurrency-test/src/main/java/org/apache/geode/test/concurrency/loop/LoopRunner.java @@ -46,7 +46,7 @@ public List runTestMethod(Method child) { ParallelExecutor executor = new DelegatingExecutor(executorService); for (int i = 0; i < count; i++) { try { - Object test = child.getDeclaringClass().newInstance(); + Object test = child.getDeclaringClass().getDeclaredConstructor().newInstance(); child.invoke(test, executor); } catch (InvocationTargetException ex) { Throwable exceptionToReturn = ex.getCause();