conn.requestSources(msg);
waitForServerConnection(conn, log);
//introspect connection to server
Channel channel = conn._channel;
SocketAddress clientAddr = channel.getLocalAddress();
final SocketAddress finalClientAddr = clientAddr;
TestUtil.assertWithBackoff(new ConditionCheck()
{
@Override
public boolean check()
{
return _dummyServer.getChildChannel(finalClientAddr) != null;
}
}, "client connected", 100, log);
Channel serverChannel = _dummyServer.getChildChannel(clientAddr);
ChannelPipeline serverPipeline = serverChannel.getPipeline();
SimpleObjectCaptureHandler objCapture = (SimpleObjectCaptureHandler)serverPipeline.get("3");
//verify server gets the /source request
runHappyPathSources(log,
callback,
remoteExceptionHandler,
clientAddr,
objCapture);
callback.clearLastMsg();
objCapture.clear();
conn.requestRegister("1", msg);
//verify server gets the /register request
HttpRequest msgReq = captureRequest(objCapture);
Assert.assertTrue(msgReq.getUri().startsWith("/register"));
serverChannel.close();
waitForCallback(callback,
TestResponseProcessors.TestConnectionStateMessage.State.REGISTER_RESPONSE_ERROR,
log);
Assert.assertNull(remoteExceptionHandler.getLastException());