use of org.apache.accumulo.server.manager.LiveTServerSet.TServerInfo in project accumulo by apache.
the class LiveTServerSetTest method testSessionIds.
@Test
public void testSessionIds() {
Map<String, TServerInfo> servers = new HashMap<>();
TServerConnection mockConn = EasyMock.createMock(TServerConnection.class);
TServerInfo server1 = new TServerInfo(new TServerInstance(HostAndPort.fromParts("localhost", 1234), "5555"), mockConn);
servers.put("server1", server1);
LiveTServerSet tservers = new LiveTServerSet(EasyMock.createMock(ServerContext.class), EasyMock.createMock(Listener.class));
assertEquals(server1.instance, tservers.find(servers, "localhost:1234"));
assertNull(tservers.find(servers, "localhost:4321"));
assertEquals(server1.instance, tservers.find(servers, "localhost:1234[5555]"));
assertNull(tservers.find(servers, "localhost:1234[55755]"));
}
Aggregations