@Ignore @Test public void supportedVersion() throws Exception { final AbstractClient client = mock(BaseTestClient.class); when(client.getRemoteServiceVersion()).thenReturn(1L); client.checkVersion(1); client.close(); } }
@Ignore @Test public void unsupportedVersion() throws Exception { //mExpectedException.expect(IOException.class); mExpectedException.expectMessage(INCOMPATIBLE_VERSION.getMessage(SERVICE_NAME, 0, 1)); final AbstractClient client = mock(BaseTestClient.class); when(client.getRemoteServiceVersion()).thenReturn(1L); client.checkVersion(0); client.close(); }
mConnected = true; afterConnect(); checkVersion(getServiceVersion()); LOG.info("Alluxio client (version {}) is connected with {} @ {}", RuntimeConstants.VERSION, getServiceName(), mAddress);
private void doConnect() throws IOException, TTransportException { LOG.info("Alluxio client (version {}) is trying to connect with {} @ {}", RuntimeConstants.VERSION, getServiceName(), mAddress); // The wrapper transport TTransport clientTransport = TransportProvider.Factory.create().getClientTransport(mParentSubject, mAddress); mProtocol = ThriftUtils.createThriftProtocol(clientTransport, getServiceName()); mProtocol.getTransport().open(); LOG.info("Client registered with {} @ {}", getServiceName(), mAddress); mConnected = true; afterConnect(); checkVersion(getClient(), getServiceVersion()); }