adminThread.start();
Assert.assertFalse(worker.isPaused());
try {
final AdminClient adminClient = new AdminClientImpl(config);
try {
adminClient.togglePausedWorkers(true);
try {
Thread.sleep(1000L);
} catch (InterruptedException ie) {
}
Assert.assertTrue(worker.isPaused());
Assert.assertFalse(worker.isShutdown());
adminClient.shutdownWorkers(true);
try {
Thread.sleep(1000L);
} catch (InterruptedException ie) {
}
Assert.assertTrue(worker.isShutdown());
} finally {
adminClient.end();
}
} finally {
TestUtils.stopWorker(admin, adminThread);
TestUtils.stopWorker(worker, workerThread);
}