Apache9 commented on code in PR #8190:
URL: https://github.com/apache/hbase/pull/8190#discussion_r3182103714
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestBadReplicationPeer.java:
##########
@@ -29,37 +28,38 @@
import org.apache.hadoop.hbase.replication.ReplicationPeerConfigBuilder;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Category({ MediumTests.class, ClientTests.class })
+@Tag(MediumTests.TAG)
+@Tag(ClientTests.TAG)
public class TestBadReplicationPeer {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestBadReplicationPeer.class);
private static final Logger LOG =
LoggerFactory.getLogger(TestBadReplicationPeer.class);
private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
private static Configuration conf;
- @Rule
- public TestName name = new TestName();
+ private String methodName;
- @BeforeClass
+ @BeforeEach
+ public void setUp(TestInfo info) {
+ methodName =
info.getTestMethod().map(java.lang.reflect.Method::getName).orElse("unknown");
Review Comment:
Not necessary...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableRegionReplicasRead.java:
##########
@@ -65,27 +60,20 @@ public abstract class
AbstractTestAsyncTableRegionReplicasRead {
protected static AsyncConnection ASYNC_CONN;
- @Rule
- public TestName testName = new TestName();
+ protected Supplier<AsyncTable<?>> getTable;
- @Parameter
- public Supplier<AsyncTable<?>> getTable;
+ protected AbstractTestAsyncTableRegionReplicasRead(Supplier<AsyncTable<?>>
getTable) {
+ this.getTable = getTable;
+ }
- private static AsyncTable<?> getRawTable() {
+ protected static AsyncTable<?> getRawTable() {
return ASYNC_CONN.getTable(TABLE_NAME);
}
- private static AsyncTable<?> getTable() {
+ protected static AsyncTable<?> getTable() {
return ASYNC_CONN.getTable(TABLE_NAME, ForkJoinPool.commonPool());
}
- @Parameters
- public static List<Object[]> params() {
Review Comment:
Should be placed in this class, not sub classes...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestCITimeout.java:
##########
@@ -46,8 +46,8 @@ public abstract class AbstractTestCITimeout {
protected static final byte[] FAM_NAM = Bytes.toBytes("f");
- @Rule
- public final TestName name = new TestName();
+ @RegisterExtension
+ public final TableNameTestExtension name = new TableNameTestExtension();
Review Comment:
private or protected
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java:
##########
@@ -215,49 +211,52 @@ public void testTableNames() throws IOException {
/**
* For HADOOP-2579
*/
- @Test(expected = TableExistsException.class)
+ @Test
public void testTableExistsExceptionWithATable() throws IOException {
- final TableName name = TableName.valueOf(this.name.getMethodName());
+ final TableName name = TableName.valueOf(methodName);
TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY).close();
- TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY);
+ assertThrows(TableExistsException.class,
+ () -> TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY));
}
/**
* Can't disable a table if the table isn't in enabled state
*/
- @Test(expected = TableNotEnabledException.class)
+ @Test
public void testTableNotEnabledExceptionWithATable() throws IOException {
- final TableName name = TableName.valueOf(this.name.getMethodName());
+ final TableName name = TableName.valueOf(methodName);
TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY).close();
ADMIN.disableTable(name);
- ADMIN.disableTable(name);
+ assertThrows(TableNotEnabledException.class, () ->
ADMIN.disableTable(name));
}
/**
* Can't enable a table if the table isn't in disabled state
*/
- @Test(expected = TableNotDisabledException.class)
+ @Test
public void testTableNotDisabledExceptionWithATable() throws IOException {
- final TableName name = TableName.valueOf(this.name.getMethodName());
+ final TableName name = TableName.valueOf(methodName);
try (Table t = TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY)) {
- ADMIN.enableTable(name);
+ assertThrows(TableNotDisabledException.class, () ->
ADMIN.enableTable(name));
}
}
/**
* For HADOOP-2579
*/
- @Test(expected = TableNotFoundException.class)
- public void testTableNotFoundExceptionWithoutAnyTables() throws IOException {
+ @Test
+ public void testTableNotFoundExceptionWithoutAnyTables() {
TableName tableName =
TableName.valueOf("testTableNotFoundExceptionWithoutAnyTables");
- try (Table ht = TEST_UTIL.getConnection().getTable(tableName)) {
- ht.get(new Get(Bytes.toBytes("e")));
- }
+ assertThrows(TableNotFoundException.class, () -> {
+ try (Table ht = TEST_UTIL.getConnection().getTable(tableName)) {
Review Comment:
Need to figure out which statement throws TableNotFoundException, getTable
or ht.get
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/SnapshotWithAclTestBase.java:
##########
@@ -48,17 +48,17 @@
import org.apache.hadoop.hbase.snapshot.SnapshotDoesNotExistException;
import org.apache.hadoop.hbase.snapshot.SnapshotManifest;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
public abstract class SnapshotWithAclTestBase extends SecureTestUtil {
- @Rule
- public TableNameTestRule name = new TableNameTestRule();
+ @RegisterExtension
+ public TableNameTestExtension name = new TableNameTestExtension();
Review Comment:
private or protected
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java:
##########
@@ -47,8 +47,8 @@ public class MetaWithReplicasTestBase {
protected static final int REGIONSERVERS_COUNT = 3;
- @Rule
- public TableNameTestRule name = new TableNameTestRule();
+ @RegisterExtension
+ public TableNameTestExtension name = new TableNameTestExtension();
Review Comment:
private or protected?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAppendFromClientSide.java:
##########
@@ -17,58 +17,49 @@
*/
package org.apache.hadoop.hbase.client;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.CellBuilderType;
import org.apache.hadoop.hbase.ExtendedCellBuilderFactory;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtil;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
/**
* Run Append tests that use the HBase clients;
*/
-@Category(MediumTests.class)
+@Tag(MediumTests.TAG)
Review Comment:
Add a ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBuilder.java:
##########
@@ -40,34 +39,30 @@
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.util.Threads;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.params.provider.Arguments;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
-@RunWith(Parameterized.class)
-@Category({ LargeTests.class, ClientTests.class })
+@HBaseParameterizedTestTemplate(name = "[{index}]")
Review Comment:
The name expression is not necessary...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanException.java:
##########
@@ -114,27 +110,29 @@ public static void setUp() throws Exception {
CONN =
ConnectionFactory.createAsyncConnection(UTIL.getConfiguration()).get();
}
- @AfterClass
+ @AfterAll
public static void tearDown() throws Exception {
Closeables.close(CONN, true);
UTIL.shutdownMiniCluster();
}
- @Before
+ @BeforeEach
public void setUpBeforeTest() {
REQ_COUNT.set(0);
ERROR_AT = 0;
ERROR = false;
DO_NOT_RETRY = false;
}
- @Test(expected = DoNotRetryIOException.class)
+ @Test
public void testDoNotRetryIOException() throws IOException {
ERROR_AT = 1;
DO_NOT_RETRY = true;
- try (ResultScanner scanner = CONN.getTable(TABLE_NAME).getScanner(FAMILY))
{
- scanner.next();
- }
+ assertThrows(DoNotRetryIOException.class, () -> {
+ try (ResultScanner scanner =
CONN.getTable(TABLE_NAME).getScanner(FAMILY)) {
Review Comment:
Figure out which statement throws DNRIOE.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java:
##########
@@ -93,14 +88,20 @@ public class TestAvoidCellReferencesIntoShippedBlocks {
private CountDownLatch latch = new CountDownLatch(1);
private static CountDownLatch compactReadLatch = new CountDownLatch(1);
private static AtomicBoolean doScan = new AtomicBoolean(false);
+ private String methodName;
- @Rule
- public TestName name = new TestName();
+ /**
Review Comment:
Can remove this useless javadoc.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableGetMultiThreadedWithEagerCompaction.java:
##########
@@ -17,25 +17,20 @@
*/
package org.apache.hadoop.hbase.client;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.MemoryCompactionPolicy;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Tag;
-@Ignore // Can't move hbase:meta off master server in AMv2. TODO.
-@Category({ LargeTests.class, ClientTests.class })
+@Disabled // Can't move hbase:meta off master server in AMv2. TODO.
Review Comment:
Ditto
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java:
##########
@@ -43,43 +43,36 @@
import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-
-@Category(MediumTests.class)
-public class TestCheckAndMutate {
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestCheckAndMutate.class);
+@Tag(MediumTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTestBase.java:
##########
@@ -18,9 +18,9 @@
package org.apache.hadoop.hbase.client;
import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
Review Comment:
Ah, good, this is a missing part when rewriting TestFromClientSide...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerTimeouts.java:
##########
@@ -82,11 +76,9 @@ public class TestClientScannerTimeouts {
private static Table table;
private static AsyncTable<AdvancedScanResultConsumer> asyncTable;
+ private String methodName;
Review Comment:
Where do we use this field?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTableMetrics.java:
##########
@@ -17,42 +17,36 @@
*/
package org.apache.hadoop.hbase.client;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.codahale.metrics.Timer;
import java.io.IOException;
import java.util.Arrays;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HBaseTestingUtil;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
import
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService;
-@Category(MediumTests.class)
+@Tag(MediumTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java:
##########
@@ -67,24 +63,18 @@
/**
* This class is for testing {@link Connection}.
*/
-@Category({ LargeTests.class })
+@Tag(LargeTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHbck.java:
##########
@@ -79,31 +74,28 @@
* Class to test HBaseHbck. Spins up the minicluster once at test start and
then takes it down
* afterward. Add any testing of HBaseHbck functionality here.
*/
-@RunWith(Parameterized.class)
-@Category({ LargeTests.class, ClientTests.class })
+@Tag(LargeTests.TAG)
+@Tag(ClientTests.TAG)
+@HBaseParameterizedTestTemplate(name = "{index}: async={0}")
public class TestHbck {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestHbck.class);
private static final Logger LOG = LoggerFactory.getLogger(TestHbck.class);
private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
- @Rule
- public TestName name = new TestName();
Review Comment:
So this is not used at all?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java:
##########
@@ -96,13 +86,14 @@ public static void setUpBeforeClass() throws Exception {
}
- @AfterClass
+ @AfterAll
public static void tearDownAfterClass() throws Exception {
TEST_UTIL.shutdownMiniCluster();
}
- @After
- public void tearDown() throws IOException {
+ @AfterEach
+ public void tearDown(TestInfo testInfo) throws IOException {
+ this.methodName = testInfo.getTestMethod().get().getName();
Review Comment:
Should be in BeforeEach, not AfterEach...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestDropTimeoutRequest.java:
##########
@@ -33,30 +32,21 @@
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Threads;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Test a drop timeout request. This test used to be in TestHCM but it has
particulare requirements
* -- i.e. one handler only -- so run it apart from the rest of TestHCM.
*/
-@Category({ MediumTests.class })
+@Tag(MediumTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java:
##########
@@ -97,7 +94,7 @@ public static void beforeClass() throws Exception {
/**
Review Comment:
Remove
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java:
##########
@@ -17,29 +17,26 @@
*/
package org.apache.hadoop.hbase.client;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
Review Comment:
No star imports
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java:
##########
@@ -38,37 +37,37 @@
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.TableDescriptorChecker;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
-@Category({ LargeTests.class, ClientTests.class })
+@Tag(LargeTests.TAG)
+@Tag(ClientTests.TAG)
public class TestIllegalTableDescriptor {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestIllegalTableDescriptor.class);
-
// NOTE: Increment tests were moved to their own class,
TestIncrementsFromClientSide.
private static final Logger LOGGER;
protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
private static byte[] FAMILY = Bytes.toBytes("testFamily");
- @Rule
- public TestName name = new TestName();
+ private String methodName;
static {
LOGGER = mock(Logger.class);
Review Comment:
Not in BeforeAll?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutWithDelete.java:
##########
@@ -17,55 +17,46 @@
*/
package org.apache.hadoop.hbase.client;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtil;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
-@Category({ MediumTests.class, ClientTests.class })
+@Tag(MediumTests.TAG)
+@Tag(ClientTests.TAG)
public class TestPutWithDelete {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestPutWithDelete.class);
-
private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
- @Rule
- public TestName name = new TestName();
-
/**
Review Comment:
Remove
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java:
##########
@@ -93,20 +87,19 @@ public class TestScannersFromClientSide {
private static byte[] QUALIFIER = Bytes.toBytes("testQualifier");
private static byte[] VALUE = Bytes.toBytes("testValue");
- @Rule
- public TableNameTestRule name = new TableNameTestRule();
+ @RegisterExtension
+ public TableNameTestExtension name = new TableNameTestExtension();
Review Comment:
private
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerLoadDurability.java:
##########
@@ -34,40 +34,35 @@
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.params.provider.Arguments;
/**
* HBASE-19496 noticed that the RegionLoad/ServerLoad may be corrupted if rpc
server reuses the
* bytebuffer backed, so this test call the
Admin#getLastMajorCompactionTimestamp() to invoke
* HMaster to iterate all stored server/region loads.
*/
-@RunWith(Parameterized.class)
-@Category({ MediumTests.class, ClientTests.class })
+@HBaseParameterizedTestTemplate
+@Tag(MediumTests.TAG)
+@Tag(ClientTests.TAG)
public class TestServerLoadDurability {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestServerLoadDurability.class);
-
private static final byte[] FAMILY = Bytes.toBytes("testFamily");
- @Parameterized.Parameter
- public Configuration conf;
+ private final Configuration conf;
+
+ public TestServerLoadDurability(Configuration conf) {
+ this.conf = conf;
+ }
- @Parameterized.Parameters
- public static final Collection<Object[]> parameters() {
+ public static Stream<Arguments> parameters() {
List<Object[]> configurations = new ArrayList<>();
configurations.add(new Object[] { createConfigurationForSimpleRpcServer()
});
Review Comment:
Use Argments.of directly?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java:
##########
@@ -17,77 +17,75 @@
*/
package org.apache.hadoop.hbase.client;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtil;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.TimestampsFilter;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
/**
* Run tests related to {@link TimestampsFilter} using HBase client APIs. Sets
up the HBase mini
* cluster once at start. Each creates a table named for the method and does
its stuff against that.
*/
-@Category({ MediumTests.class, ClientTests.class })
+@Tag(MediumTests.TAG)
+@Tag(ClientTests.TAG)
public class TestTimestampsFilter {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestTimestampsFilter.class);
-
private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
- @Rule
- public TestName name = new TestName();
+ private String methodName;
+
+ @BeforeEach
+ public void setUpMethodName(TestInfo testInfo) {
+ this.methodName = testInfo.getTestMethod().get().getName();
+ }
/**
Review Comment:
Remove
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java:
##########
@@ -56,28 +56,22 @@
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.apache.hadoop.hbase.util.ServerRegionReplicaUtil;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.params.provider.Arguments;
import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
-@Category({ MediumTests.class, ClientTests.class })
-@RunWith(Parameterized.class)
+@Tag(MediumTests.TAG)
+@Tag(ClientTests.TAG)
+@HBaseParameterizedTestTemplate(name = "[{index}]")
Review Comment:
The name expression is not needed.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java:
##########
@@ -217,15 +208,15 @@ public boolean evaluate() throws Exception {
});
table.close();
connection.close();
- Assert.assertTrue("Unexpected exception is " + failed.get(), failed.get()
== null);
+ assertTrue(failed.get() == null, "Unexpected exception is " +
failed.get());
Review Comment:
Use assertNull.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java:
##########
@@ -87,23 +81,25 @@ public class TestSnapshotFromClient {
protected static final TableName TABLE_NAME =
TableName.valueOf(STRING_TABLE_NAME);
private static final Pattern MATCH_ALL = Pattern.compile(".*");
- @Rule
- public TableNameTestRule name = new TableNameTestRule();
+ @RegisterExtension
+ public TableNameTestExtension name = new TableNameTestExtension();
Review Comment:
private
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClientWithRegionReplicas.java:
##########
@@ -17,18 +17,18 @@
*/
package org.apache.hadoop.hbase.client;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
+import
org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTrackerFactory;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.ClassRule;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.Tag;
-@Category({ LargeTests.class, ClientTests.class })
+@Tag(LargeTests.TAG)
+@Tag(ClientTests.TAG)
public class TestSnapshotFromClientWithRegionReplicas extends
TestSnapshotFromClient {
Review Comment:
Parameterized?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java:
##########
@@ -650,24 +648,24 @@ public void testGetRegionInfo() throws Exception {
HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(table.getName());
List<HRegion> regions = rs.getRegions(tableName);
- Assert.assertEquals(1, regions.size());
+ Assertions.assertEquals(1, regions.size());
Review Comment:
Ah, we should always use static imports.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatch.java:
##########
@@ -91,11 +85,14 @@ public class TestAsyncTableBatch {
private static int MAX_KEY_VALUE_SIZE = 64 * 1024;
- @Parameter(0)
- public String tableType;
+ private final String tableType;
Review Comment:
Is this field really needed?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableGetMultiThreadedWithBasicCompaction.java:
##########
@@ -17,25 +17,20 @@
*/
package org.apache.hadoop.hbase.client;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.MemoryCompactionPolicy;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Tag;
-@Ignore // Can't move hbase:meta off master server in AMv2. TODO.
-@Category({ LargeTests.class, ClientTests.class })
+@Disabled // Can't move hbase:meta off master server in AMv2. TODO.
Review Comment:
This is not the case now, can file a separated issue to enable it.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java:
##########
@@ -43,43 +43,36 @@
import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-
-@Category(MediumTests.class)
-public class TestCheckAndMutate {
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestCheckAndMutate.class);
+@Tag(MediumTests.TAG)
+public class TestCheckAndMutate {
private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
private static final byte[] ROWKEY = Bytes.toBytes("12345");
private static final byte[] ROWKEY2 = Bytes.toBytes("67890");
private static final byte[] ROWKEY3 = Bytes.toBytes("abcde");
private static final byte[] ROWKEY4 = Bytes.toBytes("fghij");
private static final byte[] FAMILY = Bytes.toBytes("cf");
+ private String methodName;
- @Rule
- public TestName name = new TestName();
-
- @BeforeClass
+ @BeforeAll
public static void setUpBeforeClass() throws Exception {
TEST_UTIL.startMiniCluster();
}
- @AfterClass
+ @AfterAll
public static void tearDownAfterClass() throws Exception {
TEST_UTIL.shutdownMiniCluster();
}
- private Table createTable() throws IOException, InterruptedException {
- final TableName tableName = TableName.valueOf(name.getMethodName());
+ private Table createTable(TestInfo testInfo) throws IOException,
InterruptedException {
+ this.methodName = testInfo.getTestMethod().get().getName();
Review Comment:
Does not make sense... Should introduce a BeforeEach method to do this.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTable.java:
##########
@@ -59,29 +61,20 @@
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.apache.hadoop.hbase.util.Pair;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.params.provider.Arguments;
import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
-@RunWith(Parameterized.class)
-@Category({ MediumTests.class, ClientTests.class })
+@HBaseParameterizedTestTemplate(name = "[{index}]")
Review Comment:
The name expression is not needed.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutateWithByteBuff.java:
##########
@@ -40,33 +39,24 @@
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.wal.WAL;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Category(LargeTests.class)
+@Tag(LargeTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementFromClientSideWithCoprocessor.java:
##########
@@ -18,28 +18,22 @@
package org.apache.hadoop.hbase.client;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
import org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint;
import org.apache.hadoop.hbase.regionserver.NoOpScanPolicyObserver;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
/**
* Test all {@link Increment} client operations with a coprocessor that just
implements the default
* flush/compact/scan policy. This test takes a long time. The test it derives
from is parameterized
* so we run through both options of the test.
*/
-@Category(LargeTests.class)
+@Tag(LargeTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java:
##########
@@ -132,25 +135,15 @@ public static void setUpBeforeClass() throws Exception {
/**
Review Comment:
remove
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java:
##########
@@ -48,54 +45,38 @@
* APIs. Sets up the HBase mini cluster once at start. Each creates a table
named for the method and
* does its stuff against that.
*/
-@Category({ LargeTests.class, ClientTests.class })
+@Tag(LargeTests.TAG)
+@Tag(ClientTests.TAG)
public class TestMultipleTimestamps {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestMultipleTimestamps.class);
-
private static final Logger LOG =
LoggerFactory.getLogger(TestMultipleTimestamps.class);
private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
- @Rule
- public TestName name = new TestName();
+ private String methodName;
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
+ @BeforeEach
+ public void setUp(TestInfo testInfo) {
+ methodName = testInfo.getTestMethod().get().getName();
+ }
+
+ @BeforeAll
public static void setUpBeforeClass() throws Exception {
TEST_UTIL.startMiniCluster();
}
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
+ @AfterAll
public static void tearDownAfterClass() throws Exception {
TEST_UTIL.shutdownMiniCluster();
}
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- // Nothing to do.
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
+ @AfterEach
public void tearDown() throws Exception {
Review Comment:
Just remove
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobSnapshotCloneIndependence.java:
##########
@@ -18,31 +18,21 @@
package org.apache.hadoop.hbase.client;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.mob.MobConstants;
import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils;
import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
/**
* Test to verify that the cloned table is independent of the table from which
it was cloned
*/
-@Category(LargeTests.class)
+@Tag(LargeTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java:
##########
@@ -67,13 +64,9 @@
* should be faster than starting/stopping a cluster per test. Test takes a
long time because spin
* up a cluster between each run -- ugh.
*/
-@Category(LargeTests.class)
[email protected](LargeTests.TAG)
Review Comment:
Add ClientTests.TAG
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDeleteEtcCellIteration.java:
##########
@@ -66,21 +62,23 @@ public void testPutIteration() throws IOException {
assertEquals(COUNT, index);
}
- @Test(expected = ConcurrentModificationException.class)
+ @Test
public void testPutConcurrentModificationOnIteration() throws IOException {
- Put p = new Put(ROW);
- for (int i = 0; i < COUNT; i++) {
- byte[] bytes = Bytes.toBytes(i);
- p.addColumn(bytes, bytes, TIMESTAMP, bytes);
- }
- int index = 0;
- for (CellScanner cellScanner = p.cellScanner(); cellScanner.advance();) {
- Cell cell = cellScanner.current();
- byte[] bytes = Bytes.toBytes(index++);
- // When we hit the trigger, try inserting a new KV; should trigger
exception
- p.addColumn(bytes, bytes, TIMESTAMP, bytes);
- assertEquals(new KeyValue(ROW, bytes, bytes, TIMESTAMP, bytes), cell);
- }
+ assertThrows(ConcurrentModificationException.class, () -> {
Review Comment:
Figure out which statement throws the exception.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutWithDelete.java:
##########
@@ -101,13 +92,13 @@ public void testHbasePutDeleteCell() throws Exception {
// get row back and assert the values
get = new Get(rowKey);
result = table.get(get);
- assertTrue("Column A value should be a1",
- Bytes.toString(result.getValue(family,
Bytes.toBytes("A"))).equals("a1"));
- assertTrue("Column B value should be b1",
- Bytes.toString(result.getValue(family,
Bytes.toBytes("B"))).equals("b1"));
- assertTrue("Column C should not exist", result.getValue(family,
Bytes.toBytes("C")) == null);
- assertTrue("Column D value should be d1",
- Bytes.toString(result.getValue(family,
Bytes.toBytes("D"))).equals("d1"));
+ assertTrue(Bytes.toString(result.getValue(family,
Bytes.toBytes("A"))).equals("a1"),
+ "Column A value should be a1");
+ assertTrue(Bytes.toString(result.getValue(family,
Bytes.toBytes("B"))).equals("b1"),
+ "Column B value should be b1");
+ assertTrue(result.getValue(family, Bytes.toBytes("C")) == null, "Column
C should not exist");
+ assertTrue(Bytes.toString(result.getValue(family,
Bytes.toBytes("D"))).equals("d1"),
+ "Column D value should be d1");
} finally {
table.close();
Review Comment:
Try with resources
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMvccConsistentScanner.java:
##########
@@ -56,26 +50,25 @@ public class TestMvccConsistentScanner {
private static final byte[] CQ2 = Bytes.toBytes("cq2");
private static final byte[] CQ3 = Bytes.toBytes("cq3");
- @Rule
- public TestName testName = new TestName();
private TableName tableName;
- @BeforeClass
+ @BeforeAll
public static void setUpBeforeClass() throws Exception {
UTIL.startMiniCluster(2);
CONN = ConnectionFactory.createConnection(UTIL.getConfiguration());
}
- @AfterClass
+ @AfterAll
public static void tearDownAfterClass() throws Exception {
CONN.close();
UTIL.shutdownMiniCluster();
}
- @Before
- public void setUp() throws IOException, InterruptedException {
- tableName =
TableName.valueOf(testName.getMethodName().replaceAll("[^0-9a-zA-Z]", "_"));
+ @BeforeEach
+ public void setUp(TestInfo testInfo) throws IOException,
InterruptedException {
+ tableName =
+
TableName.valueOf(testInfo.getTestMethod().get().getName().replaceAll("[^0-9a-zA-Z]",
"_"));
Review Comment:
ReplaceAll is not necessary...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerLoadDurability.java:
##########
@@ -87,26 +82,23 @@ private static Configuration
createConfigurationForNettyRpcServer() {
protected Connection conn;
protected Admin admin;
- @Rule
- public TestName testName = new TestName();
protected TableName tableName;
- @Before
+ @BeforeEach
public void setUp() throws Exception {
utility = new HBaseTestingUtil(conf);
utility.startMiniCluster(2);
conn = ConnectionFactory.createConnection(utility.getConfiguration());
admin = conn.getAdmin();
- String methodName = testName.getMethodName();
- tableName = TableName.valueOf(methodName.substring(0, methodName.length()
- 3));
+ tableName = TableName.valueOf("testTable");
Review Comment:
OK, there is only one test...
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java:
##########
@@ -77,14 +74,11 @@
* A client-side test, mostly testing scanners with various parameters.
Parameterized on different
* registry implementations.
*/
-@Category({ ClientTests.class, LargeTests.class })
-@RunWith(Parameterized.class)
+@Tag(ClientTests.TAG)
+@Tag(LargeTests.TAG)
+@HBaseParameterizedTestTemplate
Review Comment:
name
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotDFSTemporaryDirectory.java:
##########
@@ -19,36 +19,42 @@
import java.io.IOException;
import java.util.UUID;
+import java.util.stream.Stream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseParameterizedTestTemplate;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.master.snapshot.SnapshotManager;
import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy;
import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.params.provider.Arguments;
/**
* This class tests that the use of a temporary snapshot directory supports
snapshot functionality
* while the temporary directory is on the same file system as the root
directory
* <p>
* This is an end-to-end test for the snapshot utility
*/
-@Category(LargeTests.class)
+@Tag(LargeTests.TAG)
+@HBaseParameterizedTestTemplate
public class TestSnapshotDFSTemporaryDirectory extends
TestSnapshotTemporaryDirectory {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestSnapshotDFSTemporaryDirectory.class);
+ public TestSnapshotDFSTemporaryDirectory(int manifestVersion) {
+ super(manifestVersion);
+ }
+
+ public static Stream<Arguments> parameters() {
Review Comment:
Not necessary.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSeparateClientZKCluster.java:
##########
@@ -67,11 +66,7 @@ public class TestSeparateClientZKCluster {
@Rule
Review Comment:
Should be removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]