hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [25/30] hbase git commit: HBASE-19239 Fix findbugs and error-prone issues
Date Sat, 18 Nov 2017 01:22:53 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesModel.java
index 052df43..83f2a28 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesModel.java
@@ -46,6 +46,7 @@ public class TestNamespacesModel extends TestModelBase<NamespacesModel>
{
     AS_JSON = "{\"Namespace\":[\"testNamespace1\",\"testNamespace2\"]}";
   }
 
+  @Override
   protected NamespacesModel buildTestModel() {
     return buildTestModel(NAMESPACE_NAME_1, NAMESPACE_NAME_2);
   }
@@ -56,6 +57,7 @@ public class TestNamespacesModel extends TestModelBase<NamespacesModel>
{
     return model;
   }
 
+  @Override
   protected void checkModel(NamespacesModel model) {
     checkModel(model, NAMESPACE_NAME_1, NAMESPACE_NAME_2);
   }
@@ -69,16 +71,19 @@ public class TestNamespacesModel extends TestModelBase<NamespacesModel>
{
   }
 
   @Test
+  @Override
   public void testBuildModel() throws Exception {
     checkModel(buildTestModel());
   }
 
   @Test
+  @Override
   public void testFromXML() throws Exception {
     checkModel(fromXML(AS_XML));
   }
 
   @Test
+  @Override
   public void testFromPB() throws Exception {
     checkModel(fromPB(AS_PB));
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java
index 98ccb66..4301f9e 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java
@@ -21,8 +21,6 @@ package org.apache.hadoop.hbase.rest.model;
 
 import java.util.Iterator;
 
-import javax.xml.bind.JAXBContext;
-
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -36,8 +34,6 @@ public class TestRowModel extends TestModelBase<RowModel> {
   private static final byte[] VALUE1 = Bytes.toBytes("testvalue1");
   private static final long TIMESTAMP1 = 1245219839331L;
 
-  private JAXBContext context;
-
   public TestRowModel() throws Exception {
     super(RowModel.class);
     AS_XML =
@@ -49,6 +45,7 @@ public class TestRowModel extends TestModelBase<RowModel> {
       "\"timestamp\":1245219839331,\"$\":\"dGVzdHZhbHVlMQ==\"}]}";
   }
 
+  @Override
   protected RowModel buildTestModel() {
     RowModel model = new RowModel();
     model.setKey(ROW1);
@@ -56,6 +53,7 @@ public class TestRowModel extends TestModelBase<RowModel> {
     return model;
   }
 
+  @Override
   protected void checkModel(RowModel model) {
     assertTrue(Bytes.equals(ROW1, model.getKey()));
     Iterator<CellModel> cells = model.getCells().iterator();
@@ -63,7 +61,7 @@ public class TestRowModel extends TestModelBase<RowModel> {
     assertTrue(Bytes.equals(COLUMN1, cell.getColumn()));
     assertTrue(Bytes.equals(VALUE1, cell.getValue()));
     assertTrue(cell.hasUserTimestamp());
-    assertEquals(cell.getTimestamp(), TIMESTAMP1);
+    assertEquals(TIMESTAMP1, cell.getTimestamp());
     assertFalse(cells.hasNext());
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestScannerModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestScannerModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestScannerModel.java
index f05d79f..80f8764 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestScannerModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestScannerModel.java
@@ -57,6 +57,7 @@ public class TestScannerModel extends TestModelBase<ScannerModel>
{
         + "JDj/////B0joB1IHcHJpdmF0ZVIGcHVibGljWAA=";
   }
 
+  @Override
   protected ScannerModel buildTestModel() {
     ScannerModel model = new ScannerModel();
     model.setStartRow(START_ROW);
@@ -73,6 +74,7 @@ public class TestScannerModel extends TestModelBase<ScannerModel>
{
     return model;
   }
 
+  @Override
   protected void checkModel(ScannerModel model) {
     assertTrue(Bytes.equals(model.getStartRow(), START_ROW));
     assertTrue(Bytes.equals(model.getEndRow(), END_ROW));
@@ -86,11 +88,11 @@ public class TestScannerModel extends TestModelBase<ScannerModel>
{
     }
     assertTrue(foundCol1);
     assertTrue(foundCol2);
-    assertEquals(model.getStartTime(), START_TIME);
-    assertEquals(model.getEndTime(), END_TIME);
-    assertEquals(model.getBatch(), BATCH);
-    assertEquals(model.getCaching(), CACHING);
-    assertEquals(model.getCacheBlocks(), CACHE_BLOCKS);
+    assertEquals(START_TIME, model.getStartTime());
+    assertEquals(END_TIME, model.getEndTime());
+    assertEquals(BATCH, model.getBatch());
+    assertEquals(CACHING, model.getCaching());
+    assertEquals(CACHE_BLOCKS, model.getCacheBlocks());
     boolean foundLabel1 = false;
     boolean foundLabel2 = false;
     if (model.getLabels() != null && model.getLabels().size() > 0) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
index 7437096..78afd2f 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterStatusModel.java
@@ -73,6 +73,7 @@ public class TestStorageClusterStatusModel extends TestModelBase<StorageClusterS
           "\"heapSizeMB\":512,\"maxHeapSizeMB\":1024}],\"DeadNodes\":[]}";
   }
 
+  @Override
   protected StorageClusterStatusModel buildTestModel() {
     StorageClusterStatusModel model = new StorageClusterStatusModel();
     model.setRegions(2);
@@ -86,59 +87,59 @@ public class TestStorageClusterStatusModel extends TestModelBase<StorageClusterS
     return model;
   }
 
+  @Override
   protected void checkModel(StorageClusterStatusModel model) {
-    assertEquals(model.getRegions(), 2);
-    assertEquals(model.getRequests(), 0);
-    assertEquals(model.getAverageLoad(), 1.0);
+    assertEquals(2, model.getRegions());
+    assertEquals(0, model.getRequests());
+    assertEquals(1.0, model.getAverageLoad(), 0.0);
     Iterator<StorageClusterStatusModel.Node> nodes =
       model.getLiveNodes().iterator();
     StorageClusterStatusModel.Node node = nodes.next();
-    assertEquals(node.getName(), "test1");
-    assertEquals(node.getStartCode(), 1245219839331L);
-    assertEquals(node.getHeapSizeMB(), 128);
-    assertEquals(node.getMaxHeapSizeMB(), 1024);
+    assertEquals("test1", node.getName());
+    assertEquals(1245219839331L, node.getStartCode());
+    assertEquals(128, node.getHeapSizeMB());
+    assertEquals(1024, node.getMaxHeapSizeMB());
     Iterator<StorageClusterStatusModel.Node.Region> regions = 
       node.getRegions().iterator();
     StorageClusterStatusModel.Node.Region region = regions.next();
     assertTrue(Bytes.toString(region.getName()).equals(
         "hbase:root,,0"));
-    assertEquals(region.getStores(), 1);
-    assertEquals(region.getStorefiles(), 1);
-    assertEquals(region.getStorefileSizeMB(), 0);
-    assertEquals(region.getMemstoreSizeMB(), 0);
-    assertEquals(region.getStorefileIndexSizeMB(), 0);
-    assertEquals(region.getReadRequestsCount(), 1);
-    assertEquals(region.getWriteRequestsCount(), 2);
-    assertEquals(region.getRootIndexSizeKB(), 1);
-    assertEquals(region.getTotalStaticIndexSizeKB(), 1);
-    assertEquals(region.getTotalStaticBloomSizeKB(), 1);
-    assertEquals(region.getTotalCompactingKVs(), 1);
-    assertEquals(region.getCurrentCompactedKVs(), 1);
+    assertEquals(1, region.getStores());
+    assertEquals(1, region.getStorefiles());
+    assertEquals(0, region.getStorefileSizeMB());
+    assertEquals(0, region.getMemstoreSizeMB());
+    assertEquals(0, region.getStorefileIndexSizeMB());
+    assertEquals(1, region.getReadRequestsCount());
+    assertEquals(2, region.getWriteRequestsCount());
+    assertEquals(1, region.getRootIndexSizeKB());
+    assertEquals(1, region.getTotalStaticIndexSizeKB());
+    assertEquals(1, region.getTotalStaticBloomSizeKB());
+    assertEquals(1, region.getTotalCompactingKVs());
+    assertEquals(1, region.getCurrentCompactedKVs());
     assertFalse(regions.hasNext());
     node = nodes.next();
-    assertEquals(node.getName(), "test2");
-    assertEquals(node.getStartCode(), 1245239331198L);
-    assertEquals(node.getHeapSizeMB(), 512);
-    assertEquals(node.getMaxHeapSizeMB(), 1024);
+    assertEquals("test2", node.getName());
+    assertEquals(1245239331198L, node.getStartCode());
+    assertEquals(512, node.getHeapSizeMB());
+    assertEquals(1024, node.getMaxHeapSizeMB());
     regions = node.getRegions().iterator();
     region = regions.next();
     assertEquals(Bytes.toString(region.getName()),
         TableName.META_TABLE_NAME+",,1246000043724");
-    assertEquals(region.getStores(), 1);
-    assertEquals(region.getStorefiles(), 1);
-    assertEquals(region.getStorefileSizeMB(), 0);
-    assertEquals(region.getMemstoreSizeMB(), 0);
-    assertEquals(region.getStorefileIndexSizeMB(), 0);
-    assertEquals(region.getReadRequestsCount(), 1);
-    assertEquals(region.getWriteRequestsCount(), 2);
-    assertEquals(region.getRootIndexSizeKB(), 1);
-    assertEquals(region.getTotalStaticIndexSizeKB(), 1);
-    assertEquals(region.getTotalStaticBloomSizeKB(), 1);
-    assertEquals(region.getTotalCompactingKVs(), 1);
-    assertEquals(region.getCurrentCompactedKVs(), 1);
+    assertEquals(1, region.getStores());
+    assertEquals(1, region.getStorefiles());
+    assertEquals(0, region.getStorefileSizeMB());
+    assertEquals(0, region.getMemstoreSizeMB());
+    assertEquals(0, region.getStorefileIndexSizeMB());
+    assertEquals(1, region.getReadRequestsCount());
+    assertEquals(2, region.getWriteRequestsCount());
+    assertEquals(1, region.getRootIndexSizeKB());
+    assertEquals(1, region.getTotalStaticIndexSizeKB());
+    assertEquals(1, region.getTotalStaticBloomSizeKB());
+    assertEquals(1, region.getTotalCompactingKVs());
+    assertEquals(1, region.getCurrentCompactedKVs());
     
     assertFalse(regions.hasNext());
     assertFalse(nodes.hasNext());
   }
 }
-

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterVersionModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterVersionModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterVersionModel.java
index e468549..4fa2590 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterVersionModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestStorageClusterVersionModel.java
@@ -35,14 +35,16 @@ public class TestStorageClusterVersionModel extends TestModelBase<StorageCluster
     AS_JSON = "{\"Version\": \"0.0.1-testing\"}";
   }
 
+  @Override
   protected StorageClusterVersionModel buildTestModel() {
     StorageClusterVersionModel model = new StorageClusterVersionModel();
     model.setVersion(VERSION);
     return model;
   }
 
+  @Override
   protected void checkModel(StorageClusterVersionModel model) {
-    assertEquals(model.getVersion(), VERSION);
+    assertEquals(VERSION, model.getVersion());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableInfoModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableInfoModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableInfoModel.java
index 88d1c96..c9c2a46 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableInfoModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableInfoModel.java
@@ -23,7 +23,7 @@ import java.util.Iterator;
 
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
-
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 @Category(SmallTests.class)
@@ -54,6 +54,7 @@ public class TestTableInfoModel extends TestModelBase<TableInfoModel>
{
       "startKey\":\"YWJyYWNhZGJyYQ==\"}]}";
   }
 
+  @Override
   protected TableInfoModel buildTestModel() {
     TableInfoModel model = new TableInfoModel();
     model.setName(TABLE);
@@ -61,25 +62,32 @@ public class TestTableInfoModel extends TestModelBase<TableInfoModel>
{
     return model;
   }
 
+  @Override
   protected void checkModel(TableInfoModel model) {
-    assertEquals(model.getName(), TABLE);
+    assertEquals(TABLE, model.getName());
     Iterator<TableRegionModel> regions = model.getRegions().iterator();
     TableRegionModel region = regions.next();
     assertTrue(Bytes.equals(region.getStartKey(), START_KEY));
     assertTrue(Bytes.equals(region.getEndKey(), END_KEY));
-    assertEquals(region.getId(), ID);
-    assertEquals(region.getLocation(), LOCATION);
+    assertEquals(ID, region.getId());
+    assertEquals(LOCATION, region.getLocation());
     assertFalse(regions.hasNext());
   }
 
+  @Test
+  @Override
   public void testBuildModel() throws Exception {
     checkModel(buildTestModel());
   }
 
+  @Test
+  @Override
   public void testFromXML() throws Exception {
     checkModel(fromXML(AS_XML));
   }
 
+  @Test
+  @Override
   public void testFromPB() throws Exception {
     checkModel(fromPB(AS_PB));
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableListModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableListModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableListModel.java
index ea5960d..7cbf4d6 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableListModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableListModel.java
@@ -43,6 +43,7 @@ public class TestTableListModel extends TestModelBase<TableListModel>
{
       "{\"table\":[{\"name\":\"table1\"},{\"name\":\"table2\"},{\"name\":\"table3\"}]}";
   }
 
+  @Override
   protected TableListModel buildTestModel() {
     TableListModel model = new TableListModel();
     model.add(new TableModel(TABLE1));
@@ -51,15 +52,15 @@ public class TestTableListModel extends TestModelBase<TableListModel>
{
     return model;
   }
 
+  @Override
   protected void checkModel(TableListModel model) {
     Iterator<TableModel> tables = model.getTables().iterator();
     TableModel table = tables.next();
-    assertEquals(table.getName(), TABLE1);
+    assertEquals(TABLE1, table.getName());
     table = tables.next();
-    assertEquals(table.getName(), TABLE2);
+    assertEquals(TABLE2, table.getName());
     table = tables.next();
-    assertEquals(table.getName(), TABLE3);
+    assertEquals(TABLE3, table.getName());
     assertFalse(tables.hasNext());
   }
 }
-

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableRegionModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableRegionModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableRegionModel.java
index 5df67b0..d376766 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableRegionModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableRegionModel.java
@@ -48,20 +48,22 @@ public class TestTableRegionModel extends TestModelBase<TableRegionModel>
{
           "startKey\":\"YWJyYWNhZGJyYQ==\"}";
   }
 
+  @Override
   protected TableRegionModel buildTestModel() {
     TableRegionModel model =
       new TableRegionModel(TABLE, ID, START_KEY, END_KEY, LOCATION);
     return model;
   }
 
+  @Override
   protected void checkModel(TableRegionModel model) {
     assertTrue(Bytes.equals(model.getStartKey(), START_KEY));
     assertTrue(Bytes.equals(model.getEndKey(), END_KEY));
-    assertEquals(model.getId(), ID);
-    assertEquals(model.getLocation(), LOCATION);
-    assertEquals(model.getName(), 
-      TABLE + "," + Bytes.toString(START_KEY) + "," + Long.toString(ID) +
-      ".ad9860f031282c46ed431d7af8f94aca.");
+    assertEquals(ID, model.getId());
+    assertEquals(LOCATION, model.getLocation());
+    assertEquals(TABLE + "," + Bytes.toString(START_KEY) + "," + Long.toString(ID) +
+        ".ad9860f031282c46ed431d7af8f94aca.",
+      model.getName());
   }
 
   public void testGetName() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableSchemaModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableSchemaModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableSchemaModel.java
index baaaf8c..853b2a1 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableSchemaModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestTableSchemaModel.java
@@ -21,8 +21,6 @@ package org.apache.hadoop.hbase.rest.model;
 
 import java.util.Iterator;
 
-import javax.xml.bind.JAXBContext;
-
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 
 import org.junit.experimental.categories.Category;
@@ -37,8 +35,6 @@ public class TestTableSchemaModel extends TestModelBase<TableSchemaModel>
{
 
   TestColumnSchemaModel testColumnSchemaModel;
 
-  private JAXBContext context;
-
   public TestTableSchemaModel() throws Exception {
     super(TableSchemaModel.class);
     testColumnSchemaModel = new TestColumnSchemaModel();
@@ -63,6 +59,7 @@ public class TestTableSchemaModel extends TestModelBase<TableSchemaModel>
{
       "\"COMPRESSION\":\"GZ\",\"VERSIONS\":\"1\",\"TTL\":\"86400\",\"IN_MEMORY\":\"false\"}]}";
   }
 
+  @Override
   protected TableSchemaModel buildTestModel() {
     return buildTestModel(TABLE_NAME);
   }
@@ -77,15 +74,16 @@ public class TestTableSchemaModel extends TestModelBase<TableSchemaModel>
{
     return model;
   }
 
+  @Override
   protected void checkModel(TableSchemaModel model) {
     checkModel(model, TABLE_NAME);
   }
 
   public void checkModel(TableSchemaModel model, String tableName) {
-    assertEquals(model.getName(), tableName);
-    assertEquals(model.__getIsMeta(), IS_META);
-    assertEquals(model.__getIsRoot(), IS_ROOT);
-    assertEquals(model.__getReadOnly(), READONLY);
+    assertEquals(tableName, model.getName());
+    assertEquals(IS_META, model.__getIsMeta());
+    assertEquals(IS_ROOT, model.__getIsRoot());
+    assertEquals(READONLY, model.__getReadOnly());
     Iterator<ColumnSchemaModel> families = model.getColumns().iterator();
     assertTrue(families.hasNext());
     ColumnSchemaModel family = families.next();
@@ -93,17 +91,19 @@ public class TestTableSchemaModel extends TestModelBase<TableSchemaModel>
{
     assertFalse(families.hasNext());
   }
 
+  @Override
   public void testBuildModel() throws Exception {
     checkModel(buildTestModel());
   }
 
+  @Override
   public void testFromXML() throws Exception {
     checkModel(fromXML(AS_XML));
   }
 
+  @Override
   public void testFromPB() throws Exception {
     checkModel(fromPB(AS_PB));
   }
 
 }
-

http://git-wip-us.apache.org/repos/asf/hbase/blob/3436ed95/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestVersionModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestVersionModel.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestVersionModel.java
index 154afe1..0a881d3 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestVersionModel.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestVersionModel.java
@@ -21,12 +21,7 @@ package org.apache.hadoop.hbase.rest.model;
 
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 
-import org.junit.Assume;
-import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.mockito.Mockito;
-
-import javax.servlet.ServletContext;
 
 @Category(SmallTests.class)
 public class TestVersionModel extends TestModelBase<VersionModel> {
@@ -55,6 +50,7 @@ public class TestVersionModel extends TestModelBase<VersionModel>
{
           "REST\":\"0.0.1\",\"Server\":\"6.1.14\"}";
   }
 
+  @Override
   protected VersionModel buildTestModel() {
     VersionModel model = new VersionModel();
     model.setRESTVersion(REST_VERSION);
@@ -65,12 +61,13 @@ public class TestVersionModel extends TestModelBase<VersionModel>
{
     return model;
   }
 
+  @Override
   protected void checkModel(VersionModel model) {
-    assertEquals(model.getRESTVersion(), REST_VERSION);
-    assertEquals(model.getOSVersion(), OS_VERSION);
-    assertEquals(model.getJVMVersion(), JVM_VERSION);
-    assertEquals(model.getServerVersion(), JETTY_VERSION);
-    assertEquals(model.getJerseyVersion(), JERSEY_VERSION);
+    assertEquals(REST_VERSION, model.getRESTVersion());
+    assertEquals(OS_VERSION, model.getOSVersion());
+    assertEquals(JVM_VERSION, model.getJVMVersion());
+    assertEquals(JETTY_VERSION, model.getServerVersion());
+    assertEquals(JERSEY_VERSION, model.getJerseyVersion());
   }
 }
 


Mime
View raw message