use of com.yahoo.messagebus.jdisc.test.RemoteServer in project vespa by vespa-engine.
the class SharedSourceSessionTestCase method requireThatSessionCanSendMessage.
@Test
public void requireThatSessionCanSendMessage() throws InterruptedException {
RemoteServer server = RemoteServer.newInstanceWithInternSlobrok();
SharedSourceSession session = newSourceSession(server.slobrokId(), new SourceSessionParams());
ReplyQueue queue = new ReplyQueue();
Message msg = new SimpleMessage("foo").setRoute(Route.parse(server.connectionSpec()));
msg.pushHandler(queue);
assertTrue(session.sendMessage(msg).isAccepted());
assertNotNull(msg = server.awaitMessage(60, TimeUnit.SECONDS));
server.ackMessage(msg);
assertNotNull(queue.awaitReply(60, TimeUnit.SECONDS));
session.release();
server.close();
}
use of com.yahoo.messagebus.jdisc.test.RemoteServer in project vespa by vespa-engine.
the class SharedIntermediateSessionTestCase method requireThatSessionCanSendMessage.
@Test
public void requireThatSessionCanSendMessage() throws InterruptedException {
RemoteServer server = RemoteServer.newInstanceWithInternSlobrok();
SharedIntermediateSession session = newIntermediateSession(server.slobrokId(), new IntermediateSessionParams());
ReplyQueue queue = new ReplyQueue();
Message msg = new SimpleMessage("foo").setRoute(Route.parse(server.connectionSpec()));
msg.setTimeReceivedNow();
msg.setTimeRemaining(60000);
msg.getTrace().setLevel(9);
msg.pushHandler(queue);
assertTrue(session.sendMessage(msg).isAccepted());
assertNotNull(msg = server.awaitMessage(60, TimeUnit.SECONDS));
server.ackMessage(msg);
assertNotNull(queue.awaitReply(60, TimeUnit.SECONDS));
session.release();
server.close();
}
Aggregations