use of com.yahoo.jrt.slobrok.server.Slobrok in project vespa by vespa-engine.
the class AdvancedRoutingTestCase method setUp.
@Override
public void setUp() throws ListenFailedException, UnknownHostException {
slobrok = new Slobrok();
dstServer = new TestServer(new MessageBusParams().addProtocol(new SimpleProtocol()), new RPCNetworkParams().setIdentity(new Identity("dst")).setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
dstFoo = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("foo").setMessageHandler(new Receptor()));
dstBar = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("bar").setMessageHandler(new Receptor()));
dstBaz = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("baz").setMessageHandler(new Receptor()));
srcServer = new TestServer(new MessageBusParams().setRetryPolicy(new RetryTransientErrorsPolicy().setBaseDelay(0)).addProtocol(new SimpleProtocol()), new RPCNetworkParams().setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
srcSession = srcServer.mb.createSourceSession(new SourceSessionParams().setTimeout(600.0).setReplyHandler(new Receptor()));
assertTrue(srcServer.waitSlobrok("dst/*", 3));
}
use of com.yahoo.jrt.slobrok.server.Slobrok in project vespa by vespa-engine.
the class SharedDestinationSessionTestCase method requireThatMbusIsReleasedOnDestroy.
@Test
public void requireThatMbusIsReleasedOnDestroy() {
Slobrok slobrok = null;
try {
slobrok = new Slobrok();
} catch (ListenFailedException e) {
fail();
}
RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrok.configId());
SharedMessageBus mbus = SharedMessageBus.newInstance(new MessageBusParams(), netParams);
SharedDestinationSession session = mbus.newDestinationSession(new DestinationSessionParams());
mbus.release();
session.release();
assertFalse("MessageBus not destroyed by release().", mbus.messageBus().destroy());
}
use of com.yahoo.jrt.slobrok.server.Slobrok in project vespa by vespa-engine.
the class SharedMessageBusTestCase method requireThatMbusIsClosedOnDestroy.
@Test
public void requireThatMbusIsClosedOnDestroy() throws ListenFailedException {
Slobrok slobrok = new Slobrok();
SharedMessageBus mbus = SharedMessageBus.newInstance(new MessageBusParams(), new RPCNetworkParams().setSlobrokConfigId(slobrok.configId()));
mbus.release();
assertFalse(mbus.messageBus().destroy());
}
use of com.yahoo.jrt.slobrok.server.Slobrok in project vespa by vespa-engine.
the class ClientTestDriverTestCase method requireThatFactoryMethodsWork.
@Test
public void requireThatFactoryMethodsWork() throws ListenFailedException {
ClientTestDriver driver = ClientTestDriver.newInstance();
assertNotNull(driver);
assertTrue(driver.close());
driver = ClientTestDriver.newInstanceWithProtocol(new SimpleProtocol());
assertNotNull(driver);
assertTrue(driver.close());
Slobrok slobrok = new Slobrok();
driver = ClientTestDriver.newInstanceWithExternSlobrok(slobrok.configId());
assertNotNull(driver);
assertTrue(driver.close());
}
use of com.yahoo.jrt.slobrok.server.Slobrok in project vespa by vespa-engine.
the class SlobrokTest method setUp.
public void setUp() throws ListenFailedException {
slobrok = new Slobrok();
slobroks = new String[1];
slobroks[0] = new Spec("localhost", slobrok.port()).toString();
SlobrokList slobroklist = new SlobrokList();
slobroklist.setup(slobroks);
acceptor = server.listen(new Spec(0));
mirror = new Mirror(client, slobroklist);
register = new Register(server, slobroklist, "localhost", acceptor.port());
mySpec = new Spec("localhost", acceptor.port()).toString();
}
Aggregations