import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
public void onSuccess(final SshFutureListener<AuthFuture> result) {
sshAuthListener = result;
}
- });
+ }, MoreExecutors.directExecutor());
doReturn(authFuture).when(authHandler).authenticate(any(ClientSession.class));
}
public void onSuccess(final SshFutureListener<ConnectFuture> result) {
sshConnectListener = result;
}
- });
+ }, MoreExecutors.directExecutor());
doReturn(connectFuture).when(sshClient).connect("usr", remoteAddress);
}
doReturn(true).when(asyncOut).isClosed();
result.operationComplete(mockedReadFuture);
}
- });
+ }, MoreExecutors.directExecutor());
final IoOutputStream asyncIn = getMockedIoOutputStream();
final ChannelSubsystem subsystemChannel = getMockedSubsystemChannel(asyncOut, asyncIn);
.removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
result.operationComplete(mockedReadFuture);
}
- });
+ }, MoreExecutors.directExecutor());
final IoOutputStream asyncIn = getMockedIoOutputStream();
final ChannelSubsystem subsystemChannel = getMockedSubsystemChannel(asyncOut, asyncIn);
doReturn(true).when(asyncIn).isClosed();
result.operationComplete(ioWriteFuture);
}
- });
+ }, MoreExecutors.directExecutor());
final ChannelSubsystem subsystemChannel = getMockedSubsystemChannel(asyncOut, asyncIn);
final ClientSession sshSession = getMockedSshSession(subsystemChannel);
doReturn(true).when(closeFuture).isClosed();
result.operationComplete(closeFuture);
}
- });
+ }, MoreExecutors.directExecutor());
doReturn(closeFuture).when(sshSession).close(false);
doReturn(subsystemChannel).when(sshSession).createSubsystemChannel(anyString());
public void onSuccess(final SshFutureListener<OpenFuture> result) {
sshChannelOpenListener = result;
}
- });
+ }, MoreExecutors.directExecutor());
doReturn(asyncOut).when(subsystemChannel).getAsyncOut();
public void onSuccess(final SshFutureListener<IoWriteFuture> result) {
result.operationComplete(ioWriteFuture);
}
- });
+ }, MoreExecutors.directExecutor());
doReturn(ioWriteFuture).when(mock).write(any(Buffer.class));
doReturn(false).when(mock).isClosed();
public void onSuccess(final SshFutureListener<IoReadFuture> result) {
result.operationComplete(ioReadFuture);
}
- });
+ }, MoreExecutors.directExecutor());
doReturn(ioReadFuture).when(mock).read(any(Buffer.class));
doReturn(false).when(mock).isClosed();