AvaticaConnection implements Connection { long getNumStatementRetries(Properties props) { return Long.valueOf(Objects.requireNonNull(props) .getProperty(NUM_EXECUTE_RETRIES_KEY, NUM_EXECUTE_RETRIES_DEFAULT)); } protected  AvaticaConnection(UnregisteredDriver driver,
      AvaticaFactory factory,
      String url,
      Properties info); ConnectionConfig config(); void openConnection(); AvaticaStatement createStatement(); PreparedStatement prepareStatement(String sql); CallableStatement prepareCall(String sql); String nativeSQL(String sql); void setAutoCommit(boolean autoCommit); boolean getAutoCommit(); void commit(); void rollback(); void close(); boolean isClosed(); DatabaseMetaData getMetaData(); void setReadOnly(boolean readOnly); boolean isReadOnly(); void setCatalog(String catalog); String getCatalog(); void setTransactionIsolation(int level); int getTransactionIsolation(); SQLWarning getWarnings(); void clearWarnings(); Statement createStatement(
      int resultSetType, int resultSetConcurrency); PreparedStatement prepareStatement(
      String sql,
      int resultSetType,
      int resultSetConcurrency); CallableStatement prepareCall(
      String sql,
      int resultSetType,
      int resultSetConcurrency); Map<String, Class<?>> getTypeMap(); void setTypeMap(Map<String, Class<?>> map); void setHoldability(int holdability); int getHoldability(); Savepoint setSavepoint(); Savepoint setSavepoint(String name); void rollback(Savepoint savepoint); void releaseSavepoint(Savepoint savepoint); AvaticaStatement createStatement(
      int resultSetType,
      int resultSetConcurrency,
      int resultSetHoldability); PreparedStatement prepareStatement(
      String sql,
      int resultSetType,
      int resultSetConcurrency,
      int resultSetHoldability); CallableStatement prepareCall(
      String sql,
      int resultSetType,
      int resultSetConcurrency,
      int resultSetHoldability); PreparedStatement prepareStatement(
      String sql, int autoGeneratedKeys); PreparedStatement prepareStatement(
      String sql, int[] columnIndexes); PreparedStatement prepareStatement(
      String sql, String[] columnNames); Clob createClob(); Blob createBlob(); NClob createNClob(); SQLXML createSQLXML(); boolean isValid(int timeout); void setClientInfo(String name, String value); void setClientInfo(Properties properties); String getClientInfo(String name); Properties getClientInfo(); Array createArrayOf(String typeName, Object[] elements); Struct createStruct(String typeName, Object[] attributes); void setSchema(String schema); String getSchema(); void abort(Executor executor); void setNetworkTimeout(
      Executor executor, int milliseconds); int getNetworkTimeout(); T unwrap(Class<T> iface); boolean isWrapperFor(Class<?> iface); TimeZone getTimeZone(); T invokeWithRetries(CallableWithoutException<T> callable); static final String ROWCOUNT_COLUMN_NAME; static final String NUM_EXECUTE_RETRIES_KEY; static final String NUM_EXECUTE_RETRIES_DEFAULT; static final String PLAN_COLUMN_NAME; final String id; final Meta.ConnectionHandle handle; final Helper helper; final Map<InternalProperty, Object> properties; final Map<Integer, AvaticaStatement> statementMap; }
@Test public void testNumExecuteRetries() { AvaticaConnection statement = Mockito.mock(AvaticaConnection.class); Mockito.when(statement.getNumStatementRetries(Mockito.any(Properties.class))) .thenCallRealMethod(); try { statement.getNumStatementRetries(null); Assert.fail("Calling getNumStatementRetries with a null object should throw an exception"); } catch (NullPointerException e) { } Properties props = new Properties(); Assert.assertEquals(Long.valueOf(AvaticaConnection.NUM_EXECUTE_RETRIES_DEFAULT).longValue(), statement.getNumStatementRetries(props)); props.setProperty(AvaticaConnection.NUM_EXECUTE_RETRIES_KEY, "10"); Assert.assertEquals(10, statement.getNumStatementRetries(props)); }