diff --git src/test/java/org/apache/hadoop/hbase/rest/client/TestAdminRestErrors.java src/test/java/org/apache/hadoop/hbase/rest/client/TestAdminRestErrors.java new file mode 100644 index 0000000..560aa7a --- /dev/null +++ src/test/java/org/apache/hadoop/hbase/rest/client/TestAdminRestErrors.java @@ -0,0 +1,169 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with the License. You may + * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the + * License. + */ +package org.apache.hadoop.hbase.rest.client; + +import java.io.IOException; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import static org.mockito.Mockito.*; +import static org.junit.Assert.*; + +/** + * test a reaction of rest client on server error. client should try some times with timeout. + */ +@Category(MediumTests.class) +public class TestAdminRestErrors { + + private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static RemoteAdmin remoteAdmin; + + private long maxTime = 1500; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + Client fakeClient = mock(Client.class); + Response response = new Response(509); + when(fakeClient.get(anyString(), anyString())).thenReturn(response); + when(fakeClient.delete(anyString())).thenReturn(response); + byte[] aByte = new byte[0]; + when(fakeClient.put(anyString(), anyString(), any(aByte.getClass()))).thenReturn(response); + when(fakeClient.post(anyString(), anyString(), any(aByte.getClass()))).thenReturn(response); + Configuration configuration = TEST_UTIL.getConfiguration(); + + configuration.setInt("hbase.rest.client.max.retries", 3); + configuration.setInt("hbase.rest.client.sleep", 600); + + remoteAdmin = new RemoteAdmin(fakeClient, TEST_UTIL.getConfiguration(), "MyTable"); + } + + /** + * test function RestVersion + */ + @Test + public void testTimeoutExceptionRestVersion() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.getRestVersion(); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals("java.io.IOException: get request to /MyTable/version/rest timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + + /** + * test function getClusterStatus + */ + @Test + public void testTimeoutExceptiongetClusterStatus() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.getClusterStatus(); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals("java.io.IOException: get request to /MyTable/status/cluster timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + + /** + * test function getClusterVersion + */ + @Test + public void testTimeoutExceptiongetClusterVersion() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.getClusterVersion(); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals( + "java.io.IOException: get request to /MyTable/version/cluster request timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + + /** + * test function isTableAvailable + */ + @Test + public void testTimeoutExceptiongetTableAvailable() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.isTableAvailable(Bytes.toBytes("TestTable")); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals("java.io.IOException: get request to /MyTable/TestTable/exists timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + + /** + * test function createTable + */ + @Test + public void testTimeoutExceptiongetCreateTable() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.createTable(new HTableDescriptor(Bytes.toBytes("TestTable"))); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals("java.io.IOException: create request to /MyTable/TestTable/schema timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + + /** + * test function deleteTable + */ + @Test + public void testTimeoutExceptiongetDeleteTable() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.deleteTable("TestTable"); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals("java.io.IOException: delete request to /MyTable/TestTable/schema timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + + /** + * test function getTableList + */ + @Test + public void testTimeoutExceptiongetTetTableList() { + long start = System.currentTimeMillis(); + try { + remoteAdmin.getTableList(); + fail("should be timeout exception!"); + } catch (IOException e) { + assertEquals("java.io.IOException: get request to /MyTable/ request timed out", + e.toString()); + } + assertTrue((System.currentTimeMillis() - start) > maxTime); + } + +} diff --git src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index a3ab9ec..80afbcb 100644 --- src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -22,8 +22,11 @@ package org.apache.hadoop.hbase.rest.client; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; import java.util.List; +import org.apache.commons.httpclient.Header; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.*; @@ -68,8 +71,7 @@ public class TestRemoteTable { private static final long TS_1 = TS_2 - ONE_HOUR; private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); - private static final HBaseRESTTestingUtility REST_TEST_UTIL = - new HBaseRESTTestingUtility(); + private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static RemoteHTable remoteTable; @BeforeClass @@ -77,8 +79,8 @@ public class TestRemoteTable { TEST_UTIL.startMiniCluster(); REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration()); HBaseAdmin admin = TEST_UTIL.getHBaseAdmin(); - LOG.info("Admin Connection=" + admin.getConnection() + ", " + - admin.getConnection().getZooKeeperWatcher()); + LOG.info("Admin Connection=" + admin.getConnection() + ", " + + admin.getConnection().getZooKeeperWatcher()); if (!admin.tableExists(TABLE)) { HTableDescriptor htd = new HTableDescriptor(TABLE); htd.addFamily(new HColumnDescriptor(COLUMN_1)); @@ -86,8 +88,8 @@ public class TestRemoteTable { htd.addFamily(new HColumnDescriptor(COLUMN_3)); admin.createTable(htd); HTable table = new HTable(TEST_UTIL.getConfiguration(), TABLE); - LOG.info("Table connection=" + table.getConnection() + ", " + - admin.getConnection().getZooKeeperWatcher()); + LOG.info("Table connection=" + table.getConnection() + ", " + + admin.getConnection().getZooKeeperWatcher()); Put put = new Put(ROW_1); put.add(COLUMN_1, QUALIFIER_1, TS_2, VALUE_1); table.put(put); @@ -97,11 +99,10 @@ public class TestRemoteTable { put.add(COLUMN_2, QUALIFIER_2, TS_2, VALUE_2); table.put(put); table.flushCommits(); + table.close(); } - remoteTable = new RemoteHTable( - new Client(new Cluster().add("localhost", - REST_TEST_UTIL.getServletPort())), - TEST_UTIL.getConfiguration(), TABLE); + remoteTable = new RemoteHTable(new Client(new Cluster().add("localhost", + REST_TEST_UTIL.getServletPort())), TEST_UTIL.getConfiguration(), TABLE); } @AfterClass @@ -113,8 +114,7 @@ public class TestRemoteTable { @Test public void testGetTableDescriptor() throws IOException { - HTableDescriptor local = new HTable(TEST_UTIL.getConfiguration(), - TABLE).getTableDescriptor(); + HTableDescriptor local = new HTable(TEST_UTIL.getConfiguration(), TABLE).getTableDescriptor(); assertEquals(remoteTable.getTableDescriptor(), local); } @@ -147,7 +147,7 @@ public class TestRemoteTable { assertNull(value2); get = new Get(ROW_2); - result = remoteTable.get(get); + result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1); value2 = result.getValue(COLUMN_2, QUALIFIER_2); assertNotNull(value1); @@ -157,7 +157,7 @@ public class TestRemoteTable { get = new Get(ROW_2); get.addFamily(COLUMN_1); - result = remoteTable.get(get); + result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1); value2 = result.getValue(COLUMN_2, QUALIFIER_2); assertNotNull(value1); @@ -167,7 +167,7 @@ public class TestRemoteTable { get = new Get(ROW_2); get.addColumn(COLUMN_1, QUALIFIER_1); get.addColumn(COLUMN_2, QUALIFIER_2); - result = remoteTable.get(get); + result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1); value2 = result.getValue(COLUMN_2, QUALIFIER_2); assertNotNull(value1); @@ -181,7 +181,7 @@ public class TestRemoteTable { get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); get.setTimeStamp(TS_1); - result = remoteTable.get(get); + result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1); value2 = result.getValue(COLUMN_2, QUALIFIER_2); assertNotNull(value1); @@ -194,7 +194,7 @@ public class TestRemoteTable { get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); get.setTimeRange(0, TS_1 + 1); - result = remoteTable.get(get); + result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1); value2 = result.getValue(COLUMN_2, QUALIFIER_2); assertNotNull(value1); @@ -208,7 +208,7 @@ public class TestRemoteTable { get.setMaxVersions(2); result = remoteTable.get(get); int count = 0; - for (KeyValue kv: result.list()) { + for (KeyValue kv : result.list()) { if (Bytes.equals(COLUMN_1, kv.getFamily()) && TS_1 == kv.getTimestamp()) { assertTrue(Bytes.equals(VALUE_1, kv.getValue())); // @TS_1 count++; @@ -232,7 +232,7 @@ public class TestRemoteTable { assertEquals(1, results[0].size()); assertEquals(2, results[1].size()); - //Test Versions + // Test Versions gets = new ArrayList(); Get g = new Get(ROW_1); g.setMaxVersions(3); @@ -244,7 +244,7 @@ public class TestRemoteTable { assertEquals(1, results[0].size()); assertEquals(3, results[1].size()); - //404 + // 404 gets = new ArrayList(); gets.add(new Get(Bytes.toBytes("RESALLYREALLYNOTTHERE"))); results = remoteTable.get(gets); @@ -260,6 +260,9 @@ public class TestRemoteTable { assertEquals(0, results.length); } + /** + * Test multi put + */ @Test public void testPut() throws IOException { Put put = new Put(ROW_3); @@ -301,8 +304,14 @@ public class TestRemoteTable { value = result.getValue(COLUMN_2, QUALIFIER_2); assertNotNull(value); assertTrue(Bytes.equals(VALUE_2, value)); + + assertTrue(Bytes.equals(Bytes.toBytes("TestRemoteTable"), remoteTable.getTableName())); } + /** + * Test function delete + */ + @Test public void testDelete() throws IOException { Put put = new Put(ROW_3); put.add(COLUMN_1, QUALIFIER_1, VALUE_1); @@ -323,7 +332,7 @@ public class TestRemoteTable { Delete delete = new Delete(ROW_3); delete.deleteColumn(COLUMN_2, QUALIFIER_2); remoteTable.delete(delete); - + get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); @@ -347,6 +356,10 @@ public class TestRemoteTable { assertNull(value2); } + /** + * Test a inner class Scanner + */ + @Test public void testScanner() throws IOException { List puts = new ArrayList(); Put put = new Put(ROW_1); @@ -370,21 +383,126 @@ public class TestRemoteTable { assertEquals(1, results.length); assertTrue(Bytes.equals(ROW_1, results[0].getRow())); - results = scanner.next(3); + Result result = scanner.next(); + assertNotNull(result); + assertTrue(Bytes.equals(ROW_2, result.getRow())); + + results = scanner.next(2); assertNotNull(results); - assertEquals(3, results.length); - assertTrue(Bytes.equals(ROW_2, results[0].getRow())); - assertTrue(Bytes.equals(ROW_3, results[1].getRow())); - assertTrue(Bytes.equals(ROW_4, results[2].getRow())); + assertEquals(2, results.length); + assertTrue(Bytes.equals(ROW_3, results[0].getRow())); + assertTrue(Bytes.equals(ROW_4, results[1].getRow())); results = scanner.next(1); assertNull(results); + scanner.close(); + + scanner = remoteTable.getScanner(COLUMN_1); + results = scanner.next(4); + assertNotNull(results); + assertEquals(4, results.length); + assertTrue(Bytes.equals(ROW_1, results[0].getRow())); + assertTrue(Bytes.equals(ROW_2, results[1].getRow())); + assertTrue(Bytes.equals(ROW_3, results[2].getRow())); + assertTrue(Bytes.equals(ROW_4, results[3].getRow())); scanner.close(); + + scanner = remoteTable.getScanner(COLUMN_1, QUALIFIER_1); + results = scanner.next(4); + assertNotNull(results); + assertEquals(4, results.length); + assertTrue(Bytes.equals(ROW_1, results[0].getRow())); + assertTrue(Bytes.equals(ROW_2, results[1].getRow())); + assertTrue(Bytes.equals(ROW_3, results[2].getRow())); + assertTrue(Bytes.equals(ROW_4, results[3].getRow())); + scanner.close(); + assertTrue(remoteTable.isAutoFlush()); + } + + /** + * Test a method checkAndDelete + */ + @Test + public void testExist() throws IOException { + Get get = new Get(ROW_1); + Result result = remoteTable.get(get); + byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); + byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); + assertNotNull(value1); + assertTrue(Bytes.equals(VALUE_1, value1)); + assertNull(value2); + assertTrue(remoteTable.exists(get)); + Delete delete = new Delete(ROW_1); + + remoteTable.checkAndDelete(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_1, delete); + assertFalse(remoteTable.exists(get)); + + Put put = new Put(ROW_1); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + remoteTable.put(put); + + assertTrue(remoteTable.checkAndPut(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_1, put)); + assertFalse(remoteTable.checkAndPut(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_2, put)); + + } + + /** + * Test a method next from class Scanner + */ + @Test + public void testIteratorScaner() throws IOException { + List puts = new ArrayList(); + Put put = new Put(ROW_1); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + puts.add(put); + put = new Put(ROW_2); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + puts.add(put); + put = new Put(ROW_3); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + puts.add(put); + put = new Put(ROW_4); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + puts.add(put); + remoteTable.put(puts); + + ResultScanner scanner = remoteTable.getScanner(new Scan()); + Iterator iterator = scanner.iterator(); + assertTrue(iterator.hasNext()); + int counter = 0; + while (iterator.hasNext()) { + iterator.next(); + counter++; + } + assertEquals(4, counter); + } + + /** + * Test a some methods of class Responce. + */ + @Test + public void testResponse() { + Response responce = new Response(200); + assertEquals(200, responce.getCode()); + Header[] headers = new Header[2]; + headers[0] = new Header("header1", "value1"); + headers[1] = new Header("header2", "value2"); + responce = new Response(200, headers); + assertEquals("value1", responce.getHeader("header1")); + assertFalse(responce.hasBody()); + responce.setCode(404); + assertEquals(404, responce.getCode()); + headers = new Header[2]; + headers[0] = new Header("header1", "value1.1"); + headers[1] = new Header("header2", "value2"); + responce.setHeaders(headers); + assertEquals("value1.1", responce.getHeader("header1")); + responce.setBody(Bytes.toBytes("body")); + assertTrue(responce.hasBody()); + } @org.junit.Rule - public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = - new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); + public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = new org.apache.hadoop.hbase.ResourceCheckerJUnitRule(); } - diff --git src/test/java/org/apache/hadoop/hbase/rest/client/TestRestErrors.java src/test/java/org/apache/hadoop/hbase/rest/client/TestRestErrors.java new file mode 100644 index 0000000..ad28cb0 --- /dev/null +++ src/test/java/org/apache/hadoop/hbase/rest/client/TestRestErrors.java @@ -0,0 +1,179 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with the License. You may + * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the + * License. + */ +package org.apache.hadoop.hbase.rest.client; + +import java.io.IOException; +import java.util.Arrays; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.MediumTests; +import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + + + +import static org.mockito.Mockito.*; +import static org.junit.Assert.*; + +/** + * Test a reaction of rest client on server error. client should try some times with timeout. + */ +@Category(MediumTests.class) +public class TestRestErrors { + + private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static RemoteHTable remoteTable; + + private static final byte[] ROW_1 = Bytes.toBytes("testrow1"); + private static final byte[] COLUMN_1 = Bytes.toBytes("a"); + private static final byte[] QUALIFIER_1 = Bytes.toBytes("1"); + private static final byte[] VALUE_1 = Bytes.toBytes("testvalue1"); + private long maxTime = 1500; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + Client fakeClient = mock(Client.class); + Response response = new Response(509); + when(fakeClient.get(anyString(),anyString())).thenReturn(response); + when(fakeClient.delete(anyString())).thenReturn(response); + byte[] aByte= new byte[0]; + when(fakeClient.put(anyString(),anyString(),any(aByte.getClass()))).thenReturn(response); + when(fakeClient.post(anyString(),anyString(),any(aByte.getClass()))).thenReturn(response); + Configuration configuration = TEST_UTIL.getConfiguration(); + + configuration.setInt("hbase.rest.client.max.retries", 3); + configuration.setInt("hbase.rest.client.sleep", 600); + + + remoteTable = new RemoteHTable(fakeClient, TEST_UTIL.getConfiguration(), "MyTable"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + remoteTable.close(); + } + + /** + * test function delete + */ + @Test + public void testTimeoutExceptionDelete(){ + Delete delete= new Delete(Bytes.toBytes("delete")); + long start= System.currentTimeMillis(); + try{ + remoteTable.delete(delete); + fail("should be timeout exception!"); + }catch(IOException e){ + assertEquals("java.io.IOException: delete request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + } + + /** + * test function get + */ + @Test + public void testTimeoutExceptionGet(){ + long start= System.currentTimeMillis(); + try{ + remoteTable.get(new Get(Bytes.toBytes("Get"))); + fail("should be timeout exception!"); + }catch(IOException e){ + assertEquals("java.io.IOException: get request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + } + + /** + * test function put + */ + @Test + public void testTimeoutExceptionPut(){ + long start= System.currentTimeMillis(); + try{ + remoteTable.put(new Put(Bytes.toBytes("Row"))); + fail("should be timeout exception!"); + }catch(IOException e){ + assertEquals("java.io.IOException: put request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + start= System.currentTimeMillis(); + Put[] puts= {new Put(Bytes.toBytes("Row1")),new Put(Bytes.toBytes("Row2"))}; + try{ + remoteTable.put(Arrays.asList(puts)); + fail("should be timeout exception!"); + }catch(IOException e){ + assertEquals("java.io.IOException: multiput request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + } + + /** + * test Scanner + */ + @Test + public void testTimeoutExceptionScanner(){ + long start= System.currentTimeMillis(); + try{ + remoteTable.getScanner(new Scan()); + }catch(IOException e){ + assertEquals("java.io.IOException: scan request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + start= System.currentTimeMillis(); + } + + /** + * test function checkAndPut + */ + @Test + public void testTimeoutExceptionCheckAndPut(){ + long start= System.currentTimeMillis(); + Put put = new Put(ROW_1); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + + try{ + remoteTable.checkAndPut(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_1, put ); + fail("should be timeout exception!"); + }catch(IOException e){ + assertEquals("java.io.IOException: checkAndPut request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + } + + /** + * test function checkAndDelete + */ + @Test + public void testTimeoutExceptionCheckAndDelete(){ + long start= System.currentTimeMillis(); + Put put = new Put(ROW_1); + put.add(COLUMN_1, QUALIFIER_1, VALUE_1); + Delete delete= new Delete(ROW_1); + + try{ + remoteTable.checkAndDelete(ROW_1, COLUMN_1, QUALIFIER_1, VALUE_1, delete ); + fail("should be timeout exception!"); + }catch(IOException e){ + assertEquals("java.io.IOException: checkAndDelete request timed out", e.toString()); + } + assertTrue((System.currentTimeMillis()-start)>maxTime); + } +}