private void testTimedOutGetCall(CallExecutor callExecutor) throws Exception { testTimedOutCall(callExecutor); verify(client, times(RETRIES)).get(anyString(), anyString()); }
@Test public void testGet() throws Exception { testTimedOutGetCall(new CallExecutor() { @Override public void run() throws Exception { remoteTable.get(new Get(Bytes.toBytes("Get"))); } }); }
@Test public void testCheckAndDelete() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Put put = new Put(ROW_1); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); Delete delete= new Delete(ROW_1); //remoteTable.checkAndDelete(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_1, delete ); remoteTable.checkAndMutate(ROW_1, COLUMN_1).qualifier(QUALIFIER_1) .ifEquals(VALUE_1).thenDelete(delete); } }); }
@Test public void testGet() throws Exception { testTimedOutGetCall(new CallExecutor() { @Override public void run() throws Exception { remoteTable.get(new Get(Bytes.toBytes("Get"))); } }); }
@Test public void testMultiRowPut() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Put[] puts = { new Put(Bytes.toBytes("Row1")), new Put(Bytes.toBytes("Row2")) }; remoteTable.put(Arrays.asList(puts)); } }); verify(client, times(RETRIES)).put(anyString(), anyString(), any()); }
@Test public void testSingleRowPut() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { remoteTable.put(new Put(Bytes.toBytes("Row"))); } }); verify(client, times(RETRIES)).put(anyString(), anyString(), any()); }
@Test public void testGetScanner() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { remoteTable.getScanner(new Scan()); } }); verify(client, times(RETRIES)).post(anyString(), anyString(), any()); }
@Test public void testCheckAndPut() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Put put = new Put(ROW_1); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); remoteTable.checkAndMutate(ROW_1, COLUMN_1).qualifier(QUALIFIER_1) .ifEquals(VALUE_1).thenPut(put); } }); verify(client, times(RETRIES)).put(anyString(), anyString(), any()); }
@Test public void testDelete() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Delete delete = new Delete(Bytes.toBytes("delete")); remoteTable.delete(delete); } }); verify(client, times(RETRIES)).delete(anyString()); }
private void testTimedOutGetCall(CallExecutor callExecutor) throws Exception { testTimedOutCall(callExecutor); verify(client, times(RETRIES)).get(anyString(), anyString()); }
@Test public void testCheckAndDelete() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Put put = new Put(ROW_1); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); Delete delete= new Delete(ROW_1); //remoteTable.checkAndDelete(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_1, delete ); remoteTable.checkAndMutate(ROW_1, COLUMN_1).qualifier(QUALIFIER_1) .ifEquals(VALUE_1).thenDelete(delete); } }); }
@Test public void testSingleRowPut() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { remoteTable.put(new Put(Bytes.toBytes("Row"))); } }); verify(client, times(RETRIES)).put(anyString(), anyString(), any()); }
@Test public void testMultiRowPut() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Put[] puts = { new Put(Bytes.toBytes("Row1")), new Put(Bytes.toBytes("Row2")) }; remoteTable.put(Arrays.asList(puts)); } }); verify(client, times(RETRIES)).put(anyString(), anyString(), any()); }
@Test public void testGetScanner() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { remoteTable.getScanner(new Scan()); } }); verify(client, times(RETRIES)).post(anyString(), anyString(), any()); }
@Test public void testCheckAndPut() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Put put = new Put(ROW_1); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); remoteTable.checkAndMutate(ROW_1, COLUMN_1).qualifier(QUALIFIER_1) .ifEquals(VALUE_1).thenPut(put); } }); verify(client, times(RETRIES)).put(anyString(), anyString(), any()); }
@Test public void testDelete() throws Exception { testTimedOutCall(new CallExecutor() { @Override public void run() throws Exception { Delete delete = new Delete(Bytes.toBytes("delete")); remoteTable.delete(delete); } }); verify(client, times(RETRIES)).delete(anyString()); }