Search in sources :

Example 16 with SimpleProtocol

use of com.yahoo.messagebus.test.SimpleProtocol in project vespa by vespa-engine.

the class ClientThreadingTestCase method newMbusClient.

private static MbusClient newMbusClient(final LocalWire wire) {
    final SharedMessageBus mbus = new SharedMessageBus(new MessageBus(new LocalNetwork(wire), new MessageBusParams().addProtocol(new SimpleProtocol())));
    final SharedSourceSession session = mbus.newSourceSession(new SourceSessionParams());
    final MbusClient client = new MbusClient(session);
    session.release();
    mbus.release();
    return client;
}
Also used : MessageBus(com.yahoo.messagebus.MessageBus) SharedMessageBus(com.yahoo.messagebus.shared.SharedMessageBus) SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) LocalNetwork(com.yahoo.messagebus.network.local.LocalNetwork) SharedMessageBus(com.yahoo.messagebus.shared.SharedMessageBus) MessageBusParams(com.yahoo.messagebus.MessageBusParams) SourceSessionParams(com.yahoo.messagebus.SourceSessionParams) SharedSourceSession(com.yahoo.messagebus.shared.SharedSourceSession)

Example 17 with SimpleProtocol

use of com.yahoo.messagebus.test.SimpleProtocol 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 18 with SimpleProtocol

use of com.yahoo.messagebus.test.SimpleProtocol in project vespa by vespa-engine.

the class ServerTestDriverTestCase method requireThatFactoryMethodsWork.

@Test
public void requireThatFactoryMethodsWork() throws ListenFailedException {
    ServerTestDriver driver = ServerTestDriver.newInstance(new NonWorkingRequestHandler());
    assertNotNull(driver);
    assertTrue(driver.close());
    driver = ServerTestDriver.newInstanceWithProtocol(new SimpleProtocol(), new NonWorkingRequestHandler());
    assertNotNull(driver);
    assertTrue(driver.close());
    Slobrok slobrok = new Slobrok();
    driver = ServerTestDriver.newInstanceWithExternSlobrok(slobrok.configId(), new NonWorkingRequestHandler());
    assertNotNull(driver);
    assertTrue(driver.close());
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) NonWorkingRequestHandler(com.yahoo.jdisc.test.NonWorkingRequestHandler) Test(org.junit.Test)

Example 19 with SimpleProtocol

use of com.yahoo.messagebus.test.SimpleProtocol in project vespa by vespa-engine.

the class SharedIntermediateSessionTestCase method newIntermediateSession.

private static SharedIntermediateSession newIntermediateSession(String slobrokId, IntermediateSessionParams params) {
    RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrokId);
    MessageBusParams mbusParams = new MessageBusParams().addProtocol(new SimpleProtocol());
    SharedMessageBus mbus = SharedMessageBus.newInstance(mbusParams, netParams);
    SharedIntermediateSession session = mbus.newIntermediateSession(params);
    mbus.release();
    return session;
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams)

Example 20 with SimpleProtocol

use of com.yahoo.messagebus.test.SimpleProtocol in project vespa by vespa-engine.

the class ServerThreadingTestCase method newMbusServer.

private static MbusServer newMbusServer(final CurrentContainer container, final LocalWire wire) {
    final SharedMessageBus mbus = new SharedMessageBus(new MessageBus(new LocalNetwork(wire), new MessageBusParams().addProtocol(new SimpleProtocol())));
    final SharedDestinationSession session = mbus.newDestinationSession(new DestinationSessionParams());
    final MbusServer server = new MbusServer(container, session);
    session.release();
    mbus.release();
    return server;
}
Also used : MessageBus(com.yahoo.messagebus.MessageBus) SharedMessageBus(com.yahoo.messagebus.shared.SharedMessageBus) SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) LocalNetwork(com.yahoo.messagebus.network.local.LocalNetwork) SharedDestinationSession(com.yahoo.messagebus.shared.SharedDestinationSession) SharedMessageBus(com.yahoo.messagebus.shared.SharedMessageBus) MessageBusParams(com.yahoo.messagebus.MessageBusParams) DestinationSessionParams(com.yahoo.messagebus.DestinationSessionParams)

Aggregations

SimpleProtocol (com.yahoo.messagebus.test.SimpleProtocol)44 Receptor (com.yahoo.messagebus.test.Receptor)30 Test (org.junit.Test)26 SimpleMessage (com.yahoo.messagebus.test.SimpleMessage)15 CustomPolicyFactory (com.yahoo.messagebus.routing.test.CustomPolicyFactory)13 RPCNetworkParams (com.yahoo.messagebus.network.rpc.RPCNetworkParams)12 Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)11 TestServer (com.yahoo.messagebus.network.rpc.test.TestServer)8 Identity (com.yahoo.messagebus.network.Identity)7 Error (com.yahoo.messagebus.Error)5 RoutingPolicy (com.yahoo.messagebus.routing.RoutingPolicy)4 MessageBusParams (com.yahoo.messagebus.MessageBusParams)3 MessageBus (com.yahoo.messagebus.MessageBus)2 LocalNetwork (com.yahoo.messagebus.network.local.LocalNetwork)2 SharedMessageBus (com.yahoo.messagebus.shared.SharedMessageBus)2 Before (org.junit.Before)2 NonWorkingRequestHandler (com.yahoo.jdisc.test.NonWorkingRequestHandler)1 Spec (com.yahoo.jrt.Spec)1 DestinationSessionParams (com.yahoo.messagebus.DestinationSessionParams)1 SourceSessionParams (com.yahoo.messagebus.SourceSessionParams)1