Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions hbase-endpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
*/
package org.apache.hadoop.hbase.client;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.coprocessor.AsyncAggregationClient;
Expand All @@ -33,19 +32,15 @@
import org.apache.hadoop.hbase.testclassification.CoprocessorTests;
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;

@Category({ MediumTests.class, CoprocessorTests.class })
@Tag(MediumTests.TAG)
@Tag(CoprocessorTests.TAG)
public class TestAsyncAggregationClient {

@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestAsyncAggregationClient.class);

private static HBaseTestingUtility UTIL = new HBaseTestingUtility();

private static TableName TABLE_NAME = TableName.valueOf("TestAsyncAggregationClient");
Expand All @@ -62,7 +57,7 @@ public class TestAsyncAggregationClient {

private static AsyncTable<AdvancedScanResultConsumer> TABLE;

@BeforeClass
@BeforeAll
public static void setUp() throws Exception {
Configuration conf = UTIL.getConfiguration();
conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
Expand All @@ -81,7 +76,7 @@ public static void setUp() throws Exception {
.collect(Collectors.toList())).get();
}

@AfterClass
@AfterAll
public static void tearDown() throws Exception {
CONN.close();
UTIL.shutdownMiniCluster();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
*/
package org.apache.hadoop.hbase.client;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.coprocessor.AsyncAggregationClient;
Expand All @@ -35,23 +34,19 @@
import org.apache.hadoop.hbase.testclassification.CoprocessorTests;
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;

/**
* Same as TestAsyncAggregationClient, except that {@link AsyncTableImpl} is involved in addition to
* {@link RawAsyncTableImpl}. Exercises the code paths in {@link AsyncTableImpl#coprocessorService}.
*/
@Category({ MediumTests.class, CoprocessorTests.class })
@Tag(MediumTests.TAG)
@Tag(CoprocessorTests.TAG)
public class TestAsyncAggregationClientWithCallbackThreadPool {

@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestAsyncAggregationClientWithCallbackThreadPool.class);

private static HBaseTestingUtility UTIL = new HBaseTestingUtility();

private static TableName TABLE_NAME = TableName.valueOf("TestAsyncAggregationClient");
Expand All @@ -70,7 +65,7 @@ public class TestAsyncAggregationClientWithCallbackThreadPool {

private static ExecutorService EXECUTOR_SERVICE;

@BeforeClass
@BeforeAll
public static void setUp() throws Exception {
Configuration conf = UTIL.getConfiguration();
conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
Expand All @@ -90,7 +85,7 @@ public static void setUp() throws Exception {
.collect(Collectors.toList())).get();
}

@AfterClass
@AfterAll
public static void tearDown() throws Exception {
CONN.close();
UTIL.shutdownMiniCluster();
Expand Down Expand Up @@ -152,5 +147,4 @@ public void testStd() throws InterruptedException, ExecutionException {
.std(TABLE, new LongColumnInterpreter(), new Scan().addColumn(CF, CQ)).get().doubleValue(),
DELTA);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
package org.apache.hadoop.hbase.client;

import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.CellScannable;
import org.apache.hadoop.hbase.CellScanner;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.TableName;
Expand All @@ -40,25 +39,20 @@
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;

import org.apache.hbase.thirdparty.com.google.common.collect.ConcurrentHashMultiset;
import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
import org.apache.hbase.thirdparty.com.google.common.collect.Multiset;

@Category({ MediumTests.class, ClientTests.class })
@Tag(MediumTests.TAG)
@Tag(ClientTests.TAG)
public class TestRpcControllerFactory {

@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestRpcControllerFactory.class);

public static class StaticRpcControllerFactory extends RpcControllerFactory {

public StaticRpcControllerFactory(Configuration conf) {
Expand Down Expand Up @@ -117,11 +111,8 @@ public void setPriority(TableName tn) {

private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();

@Rule
public TestName name = new TestName();

@BeforeClass
public static void setup() throws Exception {
@BeforeAll
public static void setUp() throws Exception {
// load an endpoint so we have an endpoint to test - it doesn't matter which one, but
// this is already in tests, so we can just use it.
Configuration conf = UTIL.getConfiguration();
Expand All @@ -131,8 +122,8 @@ public static void setup() throws Exception {
UTIL.startMiniCluster();
}

@AfterClass
public static void teardown() throws Exception {
@AfterAll
public static void tearDown() throws Exception {
UTIL.shutdownMiniCluster();
}

Expand All @@ -143,13 +134,13 @@ public static void teardown() throws Exception {
* @throws Exception on failure
*/
@Test
public void testCountController() throws Exception {
public void testCountController(TestInfo testInfo) throws Exception {
Configuration conf = new Configuration(UTIL.getConfiguration());
// setup our custom controller
conf.set(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY,
StaticRpcControllerFactory.class.getName());

final TableName tableName = TableName.valueOf(name.getMethodName());
final TableName tableName = TableName.valueOf(testInfo.getTestMethod().get().getName());
UTIL.createTable(tableName, fam1).close();

// change one of the connection properties so we get a new Connection with our configuration
Expand Down Expand Up @@ -246,6 +237,6 @@ public void testFallbackToDefaultRpcControllerFactory() {
// Should not fail
RpcControllerFactory factory = RpcControllerFactory.instantiate(conf);
assertNotNull(factory);
assertEquals(factory.getClass(), RpcControllerFactory.class);
assertEquals(RpcControllerFactory.class, factory.getClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
*/
package org.apache.hadoop.hbase.client.coprocessor;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
Expand All @@ -35,19 +34,15 @@
import org.apache.hadoop.hbase.testclassification.CoprocessorTests;
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;

@Category({ MediumTests.class, CoprocessorTests.class })
@Tag(MediumTests.TAG)
@Tag(CoprocessorTests.TAG)
public class TestAggregationClient {

@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestAggregationClient.class);

private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();

private static final TableName TABLE_NAME = TableName.valueOf("TestAggregationClient");
Expand All @@ -58,7 +53,7 @@ public class TestAggregationClient {

private static Table TABLE;

@BeforeClass
@BeforeAll
public static void setUp() throws Exception {
Configuration conf = UTIL.getConfiguration();
conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
Expand All @@ -69,7 +64,7 @@ public static void setUp() throws Exception {
TABLE = CONN.getTable(TABLE_NAME);
}

@AfterClass
@AfterAll
public static void tearDown() throws Exception {
CONN.close();
UTIL.shutdownMiniCluster();
Expand Down
Loading
Loading