You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ja...@apache.org on 2019/08/05 12:14:52 UTC
[hbase] branch branch-1 updated: HBASE-22786 Fixed Checkstyle
issues in tests in hbase-client
This is an automated email from the ASF dual-hosted git repository.
janh pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new 9f92a9c HBASE-22786 Fixed Checkstyle issues in tests in hbase-client
9f92a9c is described below
commit 9f92a9c949371e2c4d67356d910890d90b45311c
Author: Jan Hentschel <ja...@ultratendency.com>
AuthorDate: Mon Aug 5 11:52:53 2019 +0200
HBASE-22786 Fixed Checkstyle issues in tests in hbase-client
Signed-off-by: stack <st...@apache.org>
---
.../apache/hadoop/hbase/TestHColumnDescriptor.java | 4 +++-
.../apache/hadoop/hbase/TestHTableDescriptor.java | 27 +++++++++++----------
.../apache/hadoop/hbase/client/TestAttributes.java | 21 +++++++++-------
.../hbase/client/TestClientExponentialBackoff.java | 8 +++----
.../org/apache/hadoop/hbase/client/TestGet.java | 11 +++++----
.../hadoop/hbase/client/TestMetricsConnection.java | 17 ++++++-------
.../apache/hadoop/hbase/client/TestOperation.java | 28 ++++++++++------------
.../org/apache/hadoop/hbase/client/TestScan.java | 14 +++++------
.../hbase/exceptions/TestClientExceptionsUtil.java | 10 ++++----
.../hadoop/hbase/filter/TestLongComparator.java | 6 ++---
.../hadoop/hbase/ipc/TestCellBlockBuilder.java | 12 +++++-----
.../hbase/ipc/TestHBaseRpcControllerImpl.java | 24 ++++---------------
.../apache/hadoop/hbase/util/BuilderStyleTest.java | 8 ++++---
13 files changed, 90 insertions(+), 100 deletions(-)
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java
index 310f928..82f8a87 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java
@@ -32,7 +32,9 @@ import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-/** Tests the HColumnDescriptor with appropriate arguments */
+/**
+ * Tests the HColumnDescriptor with appropriate arguments
+ */
@Category(SmallTests.class)
public class TestHColumnDescriptor {
@Test
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
index 23d2946..4102c71 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
@@ -104,8 +104,9 @@ public class TestHTableDescriptor {
}
/**
- * Test cps in the table description
- * @throws Exception
+ * Test cps in the table description.
+ *
+ * @throws Exception if adding a coprocessor fails
*/
@Test
public void testGetSetRemoveCP() throws Exception {
@@ -121,8 +122,9 @@ public class TestHTableDescriptor {
}
/**
- * Test cps in the table description
- * @throws Exception
+ * Test cps in the table description.
+ *
+ * @throws Exception if adding a coprocessor fails
*/
@Test
public void testSetListRemoveCP() throws Exception {
@@ -159,10 +161,9 @@ public class TestHTableDescriptor {
/**
* Test that we add and remove strings from settings properly.
- * @throws Exception
*/
@Test
- public void testRemoveString() throws Exception {
+ public void testRemoveString() {
HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("table"));
String key = "Some";
String value = "value";
@@ -172,13 +173,13 @@ public class TestHTableDescriptor {
assertEquals(null, desc.getValue(key));
}
- String legalTableNames[] = { "foo", "with-dash_under.dot", "_under_start_ok",
- "with-dash.with_underscore", "02-01-2012.my_table_01-02", "xyz._mytable_", "9_9_0.table_02"
- , "dot1.dot2.table", "new.-mytable", "with-dash.with.dot", "legal..t2", "legal..legal.t2",
- "trailingdots..", "trailing.dots...", "ns:mytable", "ns:_mytable_", "ns:my_table_01-02"};
- String illegalTableNames[] = { ".dot_start_illegal", "-dash_start_illegal", "spaces not ok",
- "-dash-.start_illegal", "new.table with space", "01 .table", "ns:-illegaldash",
- "new:.illegaldot", "new:illegalcolon1:", "new:illegalcolon1:2"};
+ String[] legalTableNames = { "foo", "with-dash_under.dot", "_under_start_ok",
+ "with-dash.with_underscore", "02-01-2012.my_table_01-02", "xyz._mytable_", "9_9_0.table_02",
+ "dot1.dot2.table", "new.-mytable", "with-dash.with.dot", "legal..t2", "legal..legal.t2",
+ "trailingdots..", "trailing.dots...", "ns:mytable", "ns:_mytable_", "ns:my_table_01-02"};
+ String[] illegalTableNames = { ".dot_start_illegal", "-dash_start_illegal", "spaces not ok",
+ "-dash-.start_illegal", "new.table with space", "01 .table", "ns:-illegaldash",
+ "new:.illegaldot", "new:illegalcolon1:", "new:illegalcolon1:2"};
@Test
public void testLegalHTableNames() {
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java
index e7250dd..e2bb21f 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java
@@ -1,5 +1,4 @@
/**
- *
* 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
@@ -16,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.hadoop.hbase.client;
import java.util.Arrays;
@@ -44,19 +42,22 @@ public class TestAttributes {
put.setAttribute("attribute1", Bytes.toBytes("value1"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), put.getAttribute("attribute1")));
Assert.assertEquals(1, put.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), put.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"),
+ put.getAttributesMap().get("attribute1")));
// overriding attribute value
put.setAttribute("attribute1", Bytes.toBytes("value12"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), put.getAttribute("attribute1")));
Assert.assertEquals(1, put.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), put.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"),
+ put.getAttributesMap().get("attribute1")));
// adding another attribute
put.setAttribute("attribute2", Bytes.toBytes("value2"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), put.getAttribute("attribute2")));
Assert.assertEquals(2, put.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), put.getAttributesMap().get("attribute2")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"),
+ put.getAttributesMap().get("attribute2")));
// removing attribute
put.setAttribute("attribute2", null);
@@ -77,7 +78,6 @@ public class TestAttributes {
Assert.assertNull(put.getAttributesMap().get("attribute1"));
}
-
@Test
public void testDeleteAttributes() {
Delete del = new Delete(new byte [] {'r'});
@@ -92,19 +92,22 @@ public class TestAttributes {
del.setAttribute("attribute1", Bytes.toBytes("value1"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), del.getAttribute("attribute1")));
Assert.assertEquals(1, del.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), del.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"),
+ del.getAttributesMap().get("attribute1")));
// overriding attribute value
del.setAttribute("attribute1", Bytes.toBytes("value12"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), del.getAttribute("attribute1")));
Assert.assertEquals(1, del.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), del.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"),
+ del.getAttributesMap().get("attribute1")));
// adding another attribute
del.setAttribute("attribute2", Bytes.toBytes("value2"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), del.getAttribute("attribute2")));
Assert.assertEquals(2, del.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), del.getAttributesMap().get("attribute2")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"),
+ del.getAttributesMap().get("attribute2")));
// removing attribute
del.setAttribute("attribute2", null);
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientExponentialBackoff.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientExponentialBackoff.java
index 173bd85..62b2efa 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientExponentialBackoff.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientExponentialBackoff.java
@@ -34,7 +34,6 @@ import static org.junit.Assert.assertTrue;
@Category(SmallTests.class)
public class TestClientExponentialBackoff {
-
ServerName server = Mockito.mock(ServerName.class);
byte[] regionname = Bytes.toBytes("region");
@@ -141,7 +140,7 @@ public class TestClientExponentialBackoff {
backoffTime = backoff.getBackoffTime(server, regionname, stats);
assertTrue("Compaction pressure has no effect", backoffTime == 0);
- long previous = backoffTime;
+ long previous = backoffTime;
update(stats, 0, 0, 50);
backoffTime = backoff.getBackoffTime(server, regionname, stats);
assertTrue("Compaction pressure should be bigger",
@@ -155,8 +154,7 @@ public class TestClientExponentialBackoff {
private void update(ServerStatistics stats, int load) {
ClientProtos.RegionLoadStats stat = ClientProtos.RegionLoadStats.newBuilder()
- .setMemstoreLoad
- (load).build();
+ .setMemstoreLoad(load).build();
stats.update(regionname, stat);
}
@@ -169,4 +167,4 @@ public class TestClientExponentialBackoff {
.build();
stats.update(regionname, stat);
}
-}
\ No newline at end of file
+}
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
index fdb07d0..3a499fb 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
@@ -1,5 +1,4 @@
/**
- *
* 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
@@ -16,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.hadoop.hbase.client;
import static org.junit.Assert.assertEquals;
@@ -115,19 +113,22 @@ public class TestGet {
get.setAttribute("attribute1", Bytes.toBytes("value1"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get.getAttribute("attribute1")));
Assert.assertEquals(1, get.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"),
+ get.getAttributesMap().get("attribute1")));
// overriding attribute value
get.setAttribute("attribute1", Bytes.toBytes("value12"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), get.getAttribute("attribute1")));
Assert.assertEquals(1, get.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), get.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"),
+ get.getAttributesMap().get("attribute1")));
// adding another attribute
get.setAttribute("attribute2", Bytes.toBytes("value2"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get.getAttribute("attribute2")));
Assert.assertEquals(2, get.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get.getAttributesMap().get("attribute2")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"),
+ get.getAttributesMap().get("attribute2")));
// removing attribute
get.setAttribute("attribute2", null);
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMetricsConnection.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMetricsConnection.java
index b9a9a73..f1be81b 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMetricsConnection.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMetricsConnection.java
@@ -17,8 +17,15 @@
*/
package org.apache.hadoop.hbase.client;
+import static org.junit.Assert.assertEquals;
+
import com.google.protobuf.ByteString;
import com.yammer.metrics.util.RatioGauge;
+import java.io.IOException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.hadoop.hbase.client.ConnectionManager.HConnectionImplementation;
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService;
@@ -38,12 +45,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
-import java.io.IOException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import static org.junit.Assert.assertEquals;
@Category({MetricsTests.class, SmallTests.class})
public class TestMetricsConnection {
@@ -129,8 +130,8 @@ public class TestMetricsConnection {
MetricsConnection.newCallStats());
}
for (MetricsConnection.CallTracker t : new MetricsConnection.CallTracker[] {
- METRICS.getTracker, METRICS.scanTracker, METRICS.multiTracker, METRICS.appendTracker,
- METRICS.deleteTracker, METRICS.incrementTracker, METRICS.putTracker
+ METRICS.getTracker, METRICS.scanTracker, METRICS.multiTracker, METRICS.appendTracker,
+ METRICS.deleteTracker, METRICS.incrementTracker, METRICS.putTracker
}) {
Assert.assertEquals("Failed to invoke callTimer on " + t, loop, t.callTimer.count());
Assert.assertEquals("Failed to invoke reqHist on " + t, loop, t.reqHist.count());
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
index 89b2f5d..77d47cd 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
@@ -1,5 +1,4 @@
/**
- *
* 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
@@ -274,11 +273,11 @@ public class TestOperation {
/**
* Test the client Operations' JSON encoding to ensure that produced JSON is
* parseable and that the details are present and not corrupted.
- * @throws IOException
+ *
+ * @throws IOException if the JSON conversion fails
*/
@Test
- public void testOperationJSON()
- throws IOException {
+ public void testOperationJSON() throws IOException {
// produce a Scan Operation
Scan scan = new Scan(ROW);
scan.addColumn(FAMILY, QUALIFIER);
@@ -416,18 +415,17 @@ public class TestOperation {
// TODO: We should ensure all subclasses of Operation is checked.
Class[] classes = new Class[] {
- Operation.class,
- OperationWithAttributes.class,
- Mutation.class,
- Query.class,
- Delete.class,
- Increment.class,
- Append.class,
- Put.class,
- Get.class,
- Scan.class};
+ Operation.class,
+ OperationWithAttributes.class,
+ Mutation.class,
+ Query.class,
+ Delete.class,
+ Increment.class,
+ Append.class,
+ Put.class,
+ Get.class,
+ Scan.class};
BuilderStyleTest.assertClassesAreBuilderStyle(classes);
}
-
}
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java
index 77d624d..1dcdd61 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java
@@ -1,5 +1,4 @@
/**
- *
* 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
@@ -16,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.hadoop.hbase.client;
import static org.junit.Assert.assertEquals;
@@ -75,7 +73,7 @@ public class TestScan {
assertEquals(get.getId(), scan.getId());
assertEquals(get.getIsolationLevel(), scan.getIsolationLevel());
assertEquals(get.getLoadColumnFamiliesOnDemandValue(),
- scan.getLoadColumnFamiliesOnDemandValue());
+ scan.getLoadColumnFamiliesOnDemandValue());
assertEquals(get.getMaxResultsPerColumnFamily(), scan.getMaxResultsPerColumnFamily());
assertEquals(get.getMaxVersions(), scan.getMaxVersions());
assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily());
@@ -102,19 +100,22 @@ public class TestScan {
scan.setAttribute("attribute1", Bytes.toBytes("value1"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), scan.getAttribute("attribute1")));
Assert.assertEquals(1, scan.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), scan.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"),
+ scan.getAttributesMap().get("attribute1")));
// overriding attribute value
scan.setAttribute("attribute1", Bytes.toBytes("value12"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), scan.getAttribute("attribute1")));
Assert.assertEquals(1, scan.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), scan.getAttributesMap().get("attribute1")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"),
+ scan.getAttributesMap().get("attribute1")));
// adding another attribute
scan.setAttribute("attribute2", Bytes.toBytes("value2"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), scan.getAttribute("attribute2")));
Assert.assertEquals(2, scan.getAttributesMap().size());
- Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), scan.getAttributesMap().get("attribute2")));
+ Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"),
+ scan.getAttributesMap().get("attribute2")));
// removing attribute
scan.setAttribute("attribute2", null);
@@ -191,4 +192,3 @@ public class TestScan {
}
}
}
-
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/exceptions/TestClientExceptionsUtil.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/exceptions/TestClientExceptionsUtil.java
index 968e55c..9629331 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/exceptions/TestClientExceptionsUtil.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/exceptions/TestClientExceptionsUtil.java
@@ -1,5 +1,4 @@
/**
- *
* 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
@@ -18,20 +17,19 @@
*/
package org.apache.hadoop.hbase.exceptions;
+import static org.junit.Assert.assertEquals;
+
import com.google.protobuf.ServiceException;
import org.junit.Test;
import java.io.IOException;
-import static org.junit.Assert.*;
-
@SuppressWarnings("ThrowableInstanceNeverThrown")
public class TestClientExceptionsUtil {
-
@Test
- public void testFindException() throws Exception {
+ public void testFindException() {
IOException ioe = new IOException("Tesst");
ServiceException se = new ServiceException(ioe);
assertEquals(ioe, ClientExceptionsUtil.findException(se));
}
-}
\ No newline at end of file
+}
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestLongComparator.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestLongComparator.java
index 3c31c03..c39f74d 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestLongComparator.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestLongComparator.java
@@ -17,16 +17,16 @@
*/
package org.apache.hadoop.hbase.filter;
+import static org.junit.Assert.assertEquals;
+
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-import static org.junit.Assert.assertEquals;
-
@Category(SmallTests.class)
public class TestLongComparator {
- private long values[] = { Long.MIN_VALUE, -10000000000L, -1000000L, 0L, 1000000L, 10000000000L,
+ private long[] values = { Long.MIN_VALUE, -10000000000L, -1000000L, 0L, 1000000L, 10000000000L,
Long.MAX_VALUE };
@Test
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java
index 6506347..5a9e07e 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java
@@ -49,7 +49,6 @@ import org.junit.experimental.categories.Category;
@Category({ ClientTests.class, SmallTests.class })
public class TestCellBlockBuilder {
-
private static final Log LOG = LogFactory.getLog(TestCellBlockBuilder.class);
private CellBlockBuilder builder;
@@ -131,15 +130,15 @@ public class TestCellBlockBuilder {
/**
* Prints usage and then exits w/ passed <code>errCode</code>
- * @param errCode
+ * @param errorCode the error code to use to exit the application
*/
- private static void usage(final int errCode) {
+ private static void usage(final int errorCode) {
System.out.println("Usage: IPCUtil [options]");
System.out.println("Micro-benchmarking how changed sizes and counts work with buffer resizing");
System.out.println(" --count Count of Cells");
System.out.println(" --size Size of Cell values");
System.out.println("Example: IPCUtil --count=1024 --size=1024");
- System.exit(errCode);
+ System.exit(errorCode);
}
private static void timerTests(final CellBlockBuilder builder, final int count, final int size,
@@ -171,8 +170,9 @@ public class TestCellBlockBuilder {
/**
* For running a few tests of methods herein.
- * @param args
- * @throws IOException
+ *
+ * @param args the arguments to use for the timer test
+ * @throws IOException if creating the build fails
*/
public static void main(String[] args) throws IOException {
int count = 1024;
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java
index 3b0a6b2..a24701f 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseRpcControllerImpl.java
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.hadoop.hbase.ipc;
import static org.junit.Assert.assertEquals;
@@ -36,7 +35,6 @@ import org.junit.experimental.categories.Category;
@Category({ ClientTests.class, SmallTests.class })
public class TestHBaseRpcControllerImpl {
-
@Test
public void testListOfCellScannerables() throws IOException {
List<CellScannable> cells = new ArrayList<CellScannable>();
@@ -57,7 +55,7 @@ public class TestHBaseRpcControllerImpl {
}
/**
- * @param index
+ * @param index the index of the cell to use as its value
* @return A faked out 'Cell' that does nothing but return index as its value
*/
static CellScannable createCell(final int index) {
@@ -74,73 +72,61 @@ public class TestHBaseRpcControllerImpl {
@Override
public byte[] getRowArray() {
- // unused
return null;
}
@Override
public int getRowOffset() {
- // unused
return 0;
}
@Override
public short getRowLength() {
- // unused
return 0;
}
@Override
public byte[] getFamilyArray() {
- // unused
return null;
}
@Override
public int getFamilyOffset() {
- // unused
return 0;
}
@Override
public byte getFamilyLength() {
- // unused
return 0;
}
@Override
public byte[] getQualifierArray() {
- // unused
return null;
}
@Override
public int getQualifierOffset() {
- // unused
return 0;
}
@Override
public int getQualifierLength() {
- // unused
return 0;
}
@Override
public long getTimestamp() {
- // unused
return 0;
}
@Override
public byte getTypeByte() {
- // unused
return 0;
}
@Override
public long getSequenceId() {
- // unused
return 0;
}
@@ -161,19 +147,16 @@ public class TestHBaseRpcControllerImpl {
@Override
public int getTagsOffset() {
- // unused
return 0;
}
@Override
public int getTagsLength() {
- // unused
return 0;
}
@Override
public byte[] getTagsArray() {
- // unused
return null;
}
@@ -209,7 +192,10 @@ public class TestHBaseRpcControllerImpl {
@Override
public boolean advance() {
// We have one Cell only so return true first time then false ever after.
- if (!hasCell) return hasCell;
+ if (!hasCell) {
+ return hasCell;
+ }
+
hasCell = false;
return true;
}
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/util/BuilderStyleTest.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/util/BuilderStyleTest.java
index d2d0a53..6358b0f 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/util/BuilderStyleTest.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/util/BuilderStyleTest.java
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.hadoop.hbase.util;
import static org.junit.Assert.assertTrue;
@@ -34,7 +33,8 @@ import java.util.Set;
* .setBar(bar)
* .setBaz(baz)
*/
-public class BuilderStyleTest {
+public final class BuilderStyleTest {
+ private BuilderStyleTest() {}
/*
* If a base class Foo declares a method setFoo() returning Foo, then the subclass should
@@ -92,7 +92,9 @@ public class BuilderStyleTest {
boolean found = false;
for (Method m : e.getValue()) {
found = clazz.isAssignableFrom(m.getReturnType());
- if (found) break;
+ if (found) {
+ break;
+ }
}
String errorMsg = "All setXXX()|addXX() methods in " + clazz.getSimpleName()
+ " should return a " + clazz.getSimpleName() + " object in builder style. "