@Override public void close() { closeConnection(); } }
@Override public void close() { closeConnection(); } }
/** * Close client connection. */ protected static synchronized void closeClientConnection() { if (isConnectionActive) { log.debug("Request for stopping lens cli received"); getClientWrapper().getClient().closeConnection(); isConnectionActive = false; } }
/** * Close client connection. */ protected static synchronized void closeClientConnection() { if (isConnectionActive) { log.debug("Request for stopping lens cli received"); getClientWrapper().getClient().closeConnection(); isConnectionActive = false; } }
/** * Close. */ public void close() { LensClientSingletonWrapper.instance().getClient().closeConnection(); }
public void close() { LensClientSingletonWrapper.instance().getClient().closeConnection(); }
public void close() { LensClientSingletonWrapper.instance().getClient().closeConnection(); }
@AfterTest public void cleanup() { if (client != null) { client.closeConnection(); } } @Test
private void closeClientConnection(LensQueryCommands queryCommands) { queryCommands.getClient().closeConnection(); }
/** * Test client creation. */ @Test public void testClientCreation() { LensClient client = null; try { client = new LensClient(); } catch (Throwable t) { Assert.fail("Client should have been able to create a connection to server"); } finally { if (client != null) { client.closeConnection(); } } }
@AfterTest public void cleanUp() { if (command != null) { command.getClient().closeConnection(); } if (cubeCommands != null) { cubeCommands.getClient().closeConnection(); } }
@AfterTest public void cleanUp() { if (command != null) { command.getClient().closeConnection(); } if (dimensionCommand != null) { dimensionCommand.getClient().closeConnection(); } }
@AfterTest public void cleanUp() { if (command != null) { command.getClient().closeConnection(); } if (cubeCommands != null) { cubeCommands.getClient().closeConnection(); } }
@AfterTest public void cleanUp() { if (command != null) { command.getClient().closeConnection(); } }
@AfterTest public void cleanup() { if (command != null) { command.getClient().closeConnection(); } }
Assert.assertEquals(proxyQuery.hashCode(), query.hashCode()); client.closeConnection();
@Test public void testTimeout() throws LensAPIException { LensClientConfig config = createLensClientConfigWithServerUrl(); LensClient lensClient = new LensClient(config); assertTrue(lensClient.setDatabase(TEST_DB)); try { // Setting very small timeout. Expecting timeouts after this // Note: Timeout values can be changed even after LensClient has been created. config.setInt(LensClientConfig.READ_TIMEOUT_MILLIS, 200); lensClient.executeQueryWithTimeout("cube select id,name from test_dim", "test1", 100000, new LensConf()); fail("Read Timeout was expected"); } catch (Exception e) { if (!(isExceptionDueToSocketTimeout(e))) { log.error("Unexpected Exception", e); fail("SocketTimeoutException was excepted as part of Read Timeout"); } else { log.debug("Expected Exception", e); } } //Setting back default timeout. Not expecting timeouts after this config.setInt(LensClientConfig.READ_TIMEOUT_MILLIS, LensClientConfig.DEFAULT_READ_TIMEOUT_MILLIS); QueryHandleWithResultSet result = lensClient.executeQueryWithTimeout("cube select id,name from test_dim", "test2", 100000, new LensConf()); assertTrue(result.getStatus().successful()); lensClient.closeConnection(); }