Search in sources :

Example 16 with Slobrok

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));
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Receptor(com.yahoo.messagebus.test.Receptor) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Identity(com.yahoo.messagebus.network.Identity) TestServer(com.yahoo.messagebus.network.rpc.test.TestServer)

Example 17 with Slobrok

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());
}
Also used : RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) ListenFailedException(com.yahoo.jrt.ListenFailedException) Test(org.junit.Test)

Example 18 with Slobrok

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());
}
Also used : RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) MessageBusParams(com.yahoo.messagebus.MessageBusParams) Test(org.junit.Test)

Example 19 with Slobrok

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());
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Test(org.junit.Test)

Example 20 with Slobrok

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();
}
Also used : Register(com.yahoo.jrt.slobrok.api.Register) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) SlobrokList(com.yahoo.jrt.slobrok.api.SlobrokList) Mirror(com.yahoo.jrt.slobrok.api.Mirror)

Aggregations

Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)43 TestServer (com.yahoo.messagebus.network.rpc.test.TestServer)23 Test (org.junit.Test)20 Receptor (com.yahoo.messagebus.test.Receptor)17 RPCNetworkParams (com.yahoo.messagebus.network.rpc.RPCNetworkParams)15 Identity (com.yahoo.messagebus.network.Identity)12 SimpleProtocol (com.yahoo.messagebus.test.SimpleProtocol)11 SimpleMessage (com.yahoo.messagebus.test.SimpleMessage)6 RoutingTableSpec (com.yahoo.messagebus.routing.RoutingTableSpec)4 Before (org.junit.Before)4 ListenFailedException (com.yahoo.jrt.ListenFailedException)3 Spec (com.yahoo.jrt.Spec)3 DocumentTypeManager (com.yahoo.document.DocumentTypeManager)2 DocumentProtocol (com.yahoo.documentapi.messagebus.protocol.DocumentProtocol)2 MessageBusParams (com.yahoo.messagebus.MessageBusParams)2 SourceSessionParams (com.yahoo.messagebus.SourceSessionParams)2 SimpleReply (com.yahoo.messagebus.test.SimpleReply)2 MessageBusDocumentAccess (com.yahoo.documentapi.messagebus.MessageBusDocumentAccess)1 MessageBusParams (com.yahoo.documentapi.messagebus.MessageBusParams)1 NonWorkingRequestHandler (com.yahoo.jdisc.test.NonWorkingRequestHandler)1