Search in sources :

Example 1 with ConfigOption

use of com.baidu.hugegraph.config.ConfigOption 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();
}
Also used : ConfigOption(com.baidu.hugegraph.config.ConfigOption) MockMessageHandler(com.baidu.hugegraph.computer.core.network.MockMessageHandler) HashMap(java.util.HashMap) Map(java.util.Map) MockClientHandler(com.baidu.hugegraph.computer.core.network.MockClientHandler) TransportConnectionManager(com.baidu.hugegraph.computer.core.network.connection.TransportConnectionManager) Before(org.junit.Before)

Aggregations

MockClientHandler (com.baidu.hugegraph.computer.core.network.MockClientHandler)1 MockMessageHandler (com.baidu.hugegraph.computer.core.network.MockMessageHandler)1 TransportConnectionManager (com.baidu.hugegraph.computer.core.network.connection.TransportConnectionManager)1 ConfigOption (com.baidu.hugegraph.config.ConfigOption)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Before (org.junit.Before)1