|
|
|
@ -71,6 +71,7 @@ import java.util.HashMap;
@@ -71,6 +71,7 @@ import java.util.HashMap;
|
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
|
|
|
|
|
|
import static org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperatorTest.NOOP_OPERATOR; |
|
|
|
|
import static org.easymock.EasyMock.anyObject; |
|
|
|
@ -118,6 +119,7 @@ public class WorkerTest extends ThreadedTest {
@@ -118,6 +119,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
@Mock private Converter taskKeyConverter; |
|
|
|
|
@Mock private Converter taskValueConverter; |
|
|
|
|
@Mock private HeaderConverter taskHeaderConverter; |
|
|
|
|
@Mock private ExecutorService executorService; |
|
|
|
|
|
|
|
|
|
@Before |
|
|
|
|
public void setup() { |
|
|
|
@ -543,8 +545,7 @@ public class WorkerTest extends ThreadedTest {
@@ -543,8 +545,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
expectTaskValueConverters(ClassLoaderUsage.CURRENT_CLASSLOADER, taskValueConverter); |
|
|
|
|
expectTaskHeaderConverter(ClassLoaderUsage.CURRENT_CLASSLOADER, taskHeaderConverter); |
|
|
|
|
|
|
|
|
|
workerTask.run(); |
|
|
|
|
EasyMock.expectLastCall(); |
|
|
|
|
EasyMock.expect(executorService.submit(workerTask)).andReturn(null); |
|
|
|
|
|
|
|
|
|
EasyMock.expect(plugins.delegatingLoader()).andReturn(delegatingLoader); |
|
|
|
|
EasyMock.expect(delegatingLoader.connectorLoader(WorkerTestConnector.class.getName())) |
|
|
|
@ -568,7 +569,7 @@ public class WorkerTest extends ThreadedTest {
@@ -568,7 +569,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
|
|
|
|
|
PowerMock.replayAll(); |
|
|
|
|
|
|
|
|
|
worker = new Worker(WORKER_ID, new MockTime(), plugins, config, offsetBackingStore); |
|
|
|
|
worker = new Worker(WORKER_ID, new MockTime(), plugins, config, offsetBackingStore, executorService); |
|
|
|
|
worker.start(); |
|
|
|
|
assertStatistics(worker, 0, 0); |
|
|
|
|
assertStartupStatistics(worker, 0, 0, 0, 0); |
|
|
|
@ -685,8 +686,7 @@ public class WorkerTest extends ThreadedTest {
@@ -685,8 +686,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
expectTaskHeaderConverter(ClassLoaderUsage.CURRENT_CLASSLOADER, null); |
|
|
|
|
expectTaskHeaderConverter(ClassLoaderUsage.PLUGINS, taskHeaderConverter); |
|
|
|
|
|
|
|
|
|
workerTask.run(); |
|
|
|
|
EasyMock.expectLastCall(); |
|
|
|
|
EasyMock.expect(executorService.submit(workerTask)).andReturn(null); |
|
|
|
|
|
|
|
|
|
EasyMock.expect(plugins.delegatingLoader()).andReturn(delegatingLoader); |
|
|
|
|
EasyMock.expect(delegatingLoader.connectorLoader(WorkerTestConnector.class.getName())) |
|
|
|
@ -712,7 +712,7 @@ public class WorkerTest extends ThreadedTest {
@@ -712,7 +712,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
|
|
|
|
|
PowerMock.replayAll(); |
|
|
|
|
|
|
|
|
|
worker = new Worker(WORKER_ID, new MockTime(), plugins, config, offsetBackingStore); |
|
|
|
|
worker = new Worker(WORKER_ID, new MockTime(), plugins, config, offsetBackingStore, executorService); |
|
|
|
|
worker.start(); |
|
|
|
|
assertStatistics(worker, 0, 0); |
|
|
|
|
worker.startTask(TASK_ID, ClusterConfigState.EMPTY, anyConnectorConfigMap(), origProps, taskStatusListener, TargetState.STARTED); |
|
|
|
@ -778,8 +778,7 @@ public class WorkerTest extends ThreadedTest {
@@ -778,8 +778,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
expectTaskHeaderConverter(ClassLoaderUsage.CURRENT_CLASSLOADER, null); |
|
|
|
|
expectTaskHeaderConverter(ClassLoaderUsage.PLUGINS, taskHeaderConverter); |
|
|
|
|
|
|
|
|
|
workerTask.run(); |
|
|
|
|
EasyMock.expectLastCall(); |
|
|
|
|
EasyMock.expect(executorService.submit(workerTask)).andReturn(null); |
|
|
|
|
|
|
|
|
|
EasyMock.expect(plugins.delegatingLoader()).andReturn(delegatingLoader); |
|
|
|
|
EasyMock.expect(delegatingLoader.connectorLoader(WorkerTestConnector.class.getName())) |
|
|
|
@ -803,7 +802,7 @@ public class WorkerTest extends ThreadedTest {
@@ -803,7 +802,7 @@ public class WorkerTest extends ThreadedTest {
|
|
|
|
|
|
|
|
|
|
PowerMock.replayAll(); |
|
|
|
|
|
|
|
|
|
worker = new Worker(WORKER_ID, new MockTime(), plugins, config, offsetBackingStore); |
|
|
|
|
worker = new Worker(WORKER_ID, new MockTime(), plugins, config, offsetBackingStore, executorService); |
|
|
|
|
worker.start(); |
|
|
|
|
assertStatistics(worker, 0, 0); |
|
|
|
|
assertEquals(Collections.emptySet(), worker.taskIds()); |
|
|
|
|