Skip to content

Commit 494cbe4

Browse files
authored
HBASE-29558: Addendum to fix checkstyle warnings (#7277)
Signed-off-by: Viraj Jasani <[email protected]>
1 parent e4efbda commit 494cbe4

File tree

10 files changed

+84
-43
lines changed

10 files changed

+84
-43
lines changed

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
package org.apache.hadoop.hbase.client;
1919

2020
import java.io.IOException;
21-
import org.apache.hadoop.fs.FileSystem;
2221
import org.apache.hadoop.hbase.HBaseTestingUtil;
23-
import org.apache.hadoop.hdfs.DistributedFileSystem;
2422
import org.jruby.embed.ScriptingContainer;
2523
import org.junit.After;
2624
import org.junit.Before;
@@ -30,14 +28,17 @@ public abstract class AbstractTestShell implements RubyShellTest {
3028
protected final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
3129
protected final ScriptingContainer jruby = new ScriptingContainer();
3230

31+
@Override
3332
public HBaseTestingUtil getTEST_UTIL() {
3433
return TEST_UTIL;
3534
}
3635

36+
@Override
3737
public ScriptingContainer getJRuby() {
3838
return jruby;
3939
}
4040

41+
@Override
4142
public String getSuitePattern() {
4243
return "**/*_test.rb";
4344
}
@@ -47,20 +48,13 @@ public void setUp() throws Exception {
4748
RubyShellTest.setUpConfig(this);
4849

4950
// Start mini cluster
50-
// 3 datanodes needed for erasure coding checks
51-
TEST_UTIL.startMiniCluster(3);
51+
TEST_UTIL.startMiniCluster(1);
5252

5353
RubyShellTest.setUpJRubyRuntime(this);
5454

5555
RubyShellTest.doTestSetup(this);
5656
}
5757

58-
protected void setupDFS() throws IOException {
59-
DistributedFileSystem dfs =
60-
(DistributedFileSystem) FileSystem.get(TEST_UTIL.getConfiguration());
61-
dfs.enableErasureCodingPolicy("XOR-2-1-1024k");
62-
}
63-
6458
@After
6559
public void tearDown() throws Exception {
6660
TEST_UTIL.shutdownMiniCluster();

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/BaseTestShell.java

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase.client;
19+
20+
import java.io.IOException;
21+
import org.apache.hadoop.fs.FileSystem;
22+
import org.apache.hadoop.hbase.HBaseClassTestRule;
23+
import org.apache.hadoop.hbase.testclassification.ClientTests;
24+
import org.apache.hadoop.hbase.testclassification.LargeTests;
25+
import org.apache.hadoop.hdfs.DistributedFileSystem;
26+
import org.junit.Before;
27+
import org.junit.ClassRule;
28+
import org.junit.experimental.categories.Category;
29+
import org.slf4j.Logger;
30+
import org.slf4j.LoggerFactory;
31+
32+
@Category({ ClientTests.class, LargeTests.class })
33+
public class TestAdminShell extends AbstractTestShell {
34+
private static final Logger LOG = LoggerFactory.getLogger(TestAdminShell.class);
35+
36+
@ClassRule
37+
public static final HBaseClassTestRule CLASS_RULE =
38+
HBaseClassTestRule.forClass(TestAdminShell.class);
39+
40+
@Override
41+
public String getIncludeList() {
42+
return "admin_test.rb";
43+
}
44+
45+
@Before
46+
public void setUp() throws Exception {
47+
RubyShellTest.setUpConfig(this);
48+
49+
// Start mini cluster
50+
// 3 datanodes needed for erasure coding checks
51+
TEST_UTIL.startMiniCluster(3);
52+
53+
setupDFS();
54+
55+
RubyShellTest.setUpJRubyRuntime(this);
56+
57+
RubyShellTest.doTestSetup(this);
58+
}
59+
60+
protected void setupDFS() throws IOException {
61+
DistributedFileSystem dfs =
62+
(DistributedFileSystem) FileSystem.get(TEST_UTIL.getConfiguration());
63+
dfs.enableErasureCodingPolicy("XOR-2-1-1024k");
64+
}
65+
}

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestQuotasShell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.experimental.categories.Category;
2525

2626
@Category({ ClientTests.class, LargeTests.class })
27-
public class TestQuotasShell extends BaseTestShell {
27+
public class TestQuotasShell extends AbstractTestShell {
2828
@ClassRule
2929
public static final HBaseClassTestRule CLASS_RULE =
3030
HBaseClassTestRule.forClass(TestQuotasShell.class);

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestRSGroupShell.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@ public class TestRSGroupShell extends AbstractTestShell {
3232
public static final HBaseClassTestRule CLASS_RULE =
3333
HBaseClassTestRule.forClass(TestRSGroupShell.class);
3434

35+
@Override
3536
@Before
3637
public void setUp() throws Exception {
38+
RubyShellTest.setUpConfig(this);
3739
// enable rs group
3840
RSGroupUtil.enableRSGroup(TEST_UTIL.getConfiguration());
39-
super.setUp();
41+
42+
// Start mini cluster, need 3 nodes
43+
TEST_UTIL.startMiniCluster(3);
44+
45+
RubyShellTest.setUpJRubyRuntime(this);
46+
47+
RubyShellTest.doTestSetup(this);
4048
}
4149

4250
@Override

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestReplicationShell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.experimental.categories.Category;
2525

2626
@Category({ ClientTests.class, LargeTests.class })
27-
public class TestReplicationShell extends BaseTestShell {
27+
public class TestReplicationShell extends AbstractTestShell {
2828
@ClassRule
2929
public static final HBaseClassTestRule CLASS_RULE =
3030
HBaseClassTestRule.forClass(TestReplicationShell.class);

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.experimental.categories.Category;
2525

2626
@Category({ ClientTests.class, LargeTests.class })
27-
public class TestShell extends BaseTestShell {
27+
public class TestShell extends AbstractTestShell {
2828
@ClassRule
2929
public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestShell.class);
3030

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShellNoCluster.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class TestShellNoCluster extends AbstractTestShell {
3131
public static final HBaseClassTestRule CLASS_RULE =
3232
HBaseClassTestRule.forClass(TestShellNoCluster.class);
3333

34+
@Override
3435
@Before
3536
public void setUp() throws Exception {
3637
RubyShellTest.setUpConfig(this);
@@ -42,6 +43,7 @@ public void setUp() throws Exception {
4243
RubyShellTest.doTestSetup(this);
4344
}
4445

46+
@Override
4547
@After
4648
public void tearDown() throws Exception {
4749
// no cluster

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestTableShell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.experimental.categories.Category;
2525

2626
@Category({ ClientTests.class, MediumTests.class })
27-
public class TestTableShell extends BaseTestShell {
27+
public class TestTableShell extends AbstractTestShell {
2828
@ClassRule
2929
public static final HBaseClassTestRule CLASS_RULE =
3030
HBaseClassTestRule.forClass(TestTableShell.class);

0 commit comments

Comments
 (0)