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:57:54 UTC
[hbase] branch branch-1.3 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.3
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1.3 by this push:
new f6d4a83 HBASE-22786 Fixed Checkstyle issues in tests in hbase-client
f6d4a83 is described below
commit f6d4a835a20a31949b31cbbdbe08a5ef751a08cc
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 | 23 +++++++++--------
.../hbase/client/TestClientExponentialBackoff.java | 14 +++++------
.../org/apache/hadoop/hbase/client/TestGet.java | 11 ++++----
.../hadoop/hbase/client/TestMetricsConnection.java | 25 +++++++++----------
.../apache/hadoop/hbase/client/TestOperation.java | 29 ++++++++++------------
.../org/apache/hadoop/hbase/client/TestScan.java | 14 +++++------
.../hbase/exceptions/TestClientExceptionsUtil.java | 12 ++++-----
.../hadoop/hbase/filter/TestLongComparator.java | 6 ++---
.../apache/hadoop/hbase/util/BuilderStyleTest.java | 8 +++---
11 files changed, 87 insertions(+), 86 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 8249246..6ccc245 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
@@ -30,7 +30,9 @@ import org.apache.hadoop.hbase.util.BuilderStyleTest;
import org.junit.experimental.categories.Category;
import org.junit.Test;
-/** 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 d126994..1012809 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..20962a0 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);
@@ -164,4 +167,4 @@ public class TestAttributes {
scan.setId("myId");
Assert.assertEquals("myId", scan.toMap().get("id"));
}
-}
\ No newline at end of file
+}
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 c594d6e..df912e7 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
@@ -17,6 +17,9 @@
*/
package org.apache.hadoop.hbase.client;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.ServerName;
@@ -29,12 +32,8 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
-import static org.junit.Assert.assertEquals;
-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 10a913e..2c700c8 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
@@ -18,16 +18,8 @@
package org.apache.hadoop.hbase.client;
import com.google.protobuf.ByteString;
+import java.io.IOException;
import org.apache.hadoop.hbase.client.ConnectionManager.HConnectionImplementation;
-import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService;
-import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.GetRequest;
-import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest;
-import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest;
-import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutateRequest;
-import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType;
-import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier;
-import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType;
import org.apache.hadoop.hbase.testclassification.MetricsTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.apache.hadoop.hbase.util.Bytes;
@@ -38,11 +30,18 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
-import java.io.IOException;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.GetRequest;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutateRequest;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType;
+import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier;
+import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType;
@Category({MetricsTests.class, SmallTests.class})
public class TestMetricsConnection {
-
private static MetricsConnection METRICS;
@BeforeClass
@@ -109,8 +108,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 1e81f28..4d20856 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
@@ -292,11 +291,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);
@@ -434,19 +433,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 c5b3a6b..f6d7db6 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;
@@ -74,7 +72,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());
@@ -101,19 +99,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);
@@ -164,4 +165,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..3b69161 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 com.google.protobuf.ServiceException;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
import java.io.IOException;
-import static org.junit.Assert.*;
+import com.google.protobuf.ServiceException;
+import org.junit.Test;
@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/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. "