diff --git a/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunner.java b/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunner.java index 2b53e852..168ca649 100755 --- a/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunner.java +++ b/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunner.java @@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.Queue; +import java.util.Deque; import static com.shazam.fork.system.io.RemoteFileManager.*; @@ -32,7 +32,7 @@ public class DeviceTestRunner implements Runnable { private final Installer installer; private final Pool pool; private final Device device; - private final Queue queueOfTestsInPool; + private final Deque queueOfTestsInPool; private final ProgressReporter progressReporter; private final ScreenRecorder screenRecorder; private final TestRunFactory testRunFactory; @@ -40,7 +40,7 @@ public class DeviceTestRunner implements Runnable { public DeviceTestRunner(Installer installer, Pool pool, Device device, - Queue queueOfTestsInPool, + Deque queueOfTestsInPool, ProgressReporter progressReporter, ScreenRecorder screenRecorder, TestRunFactory testRunFactory) { diff --git a/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunnerFactory.java b/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunnerFactory.java index e140bf47..51996315 100644 --- a/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunnerFactory.java +++ b/fork-runner/src/main/java/com/shazam/fork/runner/DeviceTestRunnerFactory.java @@ -16,7 +16,7 @@ import com.shazam.fork.model.TestCaseEvent; import com.shazam.fork.system.adb.Installer; -import java.util.Queue; +import java.util.Deque; public class DeviceTestRunnerFactory { @@ -29,7 +29,7 @@ public DeviceTestRunnerFactory(Installer installer, TestRunFactory testRunFactor } public Runnable createDeviceTestRunner(Pool pool, - Queue testClassQueue, + Deque testClassQueue, Device device, ProgressReporter progressReporter ) { diff --git a/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunner.java b/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunner.java index 15a0880b..1227f158 100755 --- a/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunner.java +++ b/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunner.java @@ -19,7 +19,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Queue; +import java.util.Deque; import java.util.concurrent.ExecutorService; import static com.google.common.util.concurrent.Uninterruptibles.awaitTerminationUninterruptibly; @@ -30,12 +30,12 @@ public class PoolTestRunner implements Runnable { public static final String DROPPED_BY = "DroppedBy-"; private final Pool pool; - private final Queue testCases; + private final Deque testCases; private final DeviceTestRunnerFactory deviceTestRunnerFactory; private final ProgressReporter progressReporter; public PoolTestRunner(DeviceTestRunnerFactory deviceTestRunnerFactory, Pool pool, - Queue testCases, + Deque testCases, ProgressReporter progressReporter) { this.pool = pool; this.testCases = testCases; diff --git a/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunnerFactory.java b/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunnerFactory.java index ca3e4b1b..ed52be49 100644 --- a/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunnerFactory.java +++ b/fork-runner/src/main/java/com/shazam/fork/runner/PoolTestRunnerFactory.java @@ -14,7 +14,7 @@ import com.shazam.fork.model.TestCaseEvent; import java.util.Collection; -import java.util.LinkedList; +import java.util.concurrent.ConcurrentLinkedDeque; public class PoolTestRunnerFactory { private final DeviceTestRunnerFactory deviceTestRunnerFactory; @@ -33,7 +33,7 @@ public Runnable createPoolTestRunner(Pool pool, return new PoolTestRunner( deviceTestRunnerFactory, pool, - new LinkedList<>(testCases), + new ConcurrentLinkedDeque<>(testCases), progressReporter); } }