use of com.baidu.hugegraph.computer.core.network.MockMessageHandler in project hugegraph-computer by hugegraph.
the class ConnectionManagerTest method setup.
@Before
public void setup() {
Config config = UnitTestBase.updateWithRequiredOptions(ComputerOptions.TRANSPORT_SERVER_HOST, "127.0.0.1", ComputerOptions.TRANSPORT_IO_MODE, "NIO");
MessageHandler serverHandler = new MockMessageHandler();
ClientHandler clientHandler = new MockClientHandler();
connectionManager = new TransportConnectionManager();
port = connectionManager.startServer(config, serverHandler);
connectionManager.initClientManager(config, clientHandler);
}
use of com.baidu.hugegraph.computer.core.network.MockMessageHandler in project hugegraph-computer by hugegraph.
the class NettyClientFactoryTest method setup.
@Before
public void setup() {
config = UnitTestBase.updateWithRequiredOptions(ComputerOptions.TRANSPORT_SERVER_HOST, "127.0.0.1", ComputerOptions.TRANSPORT_SERVER_PORT, "8086", ComputerOptions.TRANSPORT_SERVER_THREADS, "3", ComputerOptions.TRANSPORT_IO_MODE, "NIO", ComputerOptions.TRANSPORT_RECEIVE_BUFFER_SIZE, "128", ComputerOptions.TRANSPORT_SEND_BUFFER_SIZE, "128");
MockMessageHandler serverHandler = new MockMessageHandler();
clientHandler = new MockClientHandler();
this.server = new NettyTransportServer();
this.server.listen(config, serverHandler);
}
use of com.baidu.hugegraph.computer.core.network.MockMessageHandler in project hugegraph-computer by hugegraph.
the class NettyTransportServerTest method setup.
@Before
public void setup() {
config = UnitTestBase.updateWithRequiredOptions(ComputerOptions.TRANSPORT_SERVER_HOST, "127.0.0.1", ComputerOptions.TRANSPORT_SERVER_PORT, "0", ComputerOptions.TRANSPORT_SERVER_THREADS, "3", ComputerOptions.TRANSPORT_IO_MODE, "NIO", ComputerOptions.TRANSPORT_MAX_SYN_BACKLOG, "1024");
messageHandler = new MockMessageHandler();
this.server = new NettyTransportServer();
}
use of com.baidu.hugegraph.computer.core.network.MockMessageHandler in project hugegraph-computer by hugegraph.
the class AbstractNetworkTest method setup.
@Before
public void setup() {
Configurator.setAllLevels("com.baidu.hugegraph", Level.DEBUG);
OPTIONS.put(ComputerOptions.TRANSPORT_SERVER_HOST, host);
OPTIONS.put(ComputerOptions.TRANSPORT_IO_MODE, "AUTO");
OPTIONS.put(ComputerOptions.TRANSPORT_SERVER_PORT, "0");
this.initOption();
Object[] objects = new Object[OPTIONS.size() * 2];
Set<Map.Entry<ConfigOption<?>, String>> kvs = OPTIONS.entrySet();
int i = 0;
for (Map.Entry<ConfigOption<?>, String> kv : kvs) {
objects[i++] = kv.getKey();
objects[i++] = kv.getValue();
}
config = UnitTestBase.updateWithRequiredOptions(objects);
conf = TransportConf.wrapConfig(config);
serverHandler = Mockito.spy(new MockMessageHandler());
clientHandler = Mockito.spy(new MockClientHandler());
connectionManager = new TransportConnectionManager();
port = connectionManager.startServer(config, serverHandler);
connectionManager.initClientManager(config, clientHandler);
this.mockSpyProtocol();
}
Aggregations