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-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,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.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.hadoop.hbase.testclassification.IntegrationTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.util.ToolRunner;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import org.apache.hbase.thirdparty.com.google.common.collect.Sets;

Expand All @@ -45,7 +45,7 @@
* -DnumGetters=2 -DnumScanners=2 -DnumUniqueRows=5
* </pre>
*/
@Category(IntegrationTests.class)
@Tag(IntegrationTests.TAG)
public class IntegrationTestAcidGuarantees extends IntegrationTestBase {
private static final int SERVER_COUNT = 1; // number of slaves for the smallest cluster

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
package org.apache.hadoop.hbase;

import static org.apache.hadoop.hbase.IntegrationTestingUtility.createPreSplitLoadTestTable;
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.nio.charset.Charset;
Expand Down Expand Up @@ -52,11 +53,10 @@
import org.apache.hadoop.hbase.testclassification.IntegrationTests;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.apache.hadoop.util.ToolRunner;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -71,7 +71,7 @@
* @see <a href="https://issues.apache.org/jira/browse/HBASE-7912">HBASE-7912</a>
* @see <a href="https://issues.apache.org/jira/browse/HBASE-14123">HBASE-14123</a>
*/
@Category(IntegrationTests.class)
@Tag(IntegrationTests.TAG)
public class IntegrationTestBackupRestore extends IntegrationTestBase {
private static final String CLASS_NAME = IntegrationTestBackupRestore.class.getSimpleName();
protected static final Logger LOG = LoggerFactory.getLogger(IntegrationTestBackupRestore.class);
Expand Down Expand Up @@ -135,7 +135,7 @@ public void run() {
}

@Override
@Before
@BeforeEach
public void setUp() throws Exception {
util = new IntegrationTestingUtility();
Configuration conf = util.getConfiguration();
Expand All @@ -151,7 +151,7 @@ public void setUp() throws Exception {
LOG.info("Cluster initialized and ready");
}

@After
@AfterEach
public void tearDown() throws IOException {
LOG.info("Cleaning up after test.");
if (util.isDistributedCluster()) {
Expand Down Expand Up @@ -330,7 +330,7 @@ private void runTestSingle(TableName table) throws IOException {
restore(createRestoreRequest(BACKUP_ROOT_DIR, backupId, false, tablesRestoreIncMultiple, null,
true), client);
Table hTable = conn.getTable(table);
Assert.assertEquals(util.countRows(hTable), rowsInIteration * numIterations);
assertEquals(util.countRows(hTable), rowsInIteration * numIterations);
hTable.close();
LOG.info("{} loop {} finished.", Thread.currentThread().getName(), (count - 1));
}
Expand All @@ -343,7 +343,7 @@ private void restoreVerifyTable(Connection conn, BackupAdmin client, TableName t
createRestoreRequest(BACKUP_ROOT_DIR, backupId, false, tablesRestoreIncMultiple, null, true),
client);
Table hTable = conn.getTable(table);
Assert.assertEquals(expectedRows, util.countRows(hTable));
assertEquals(expectedRows, util.countRows(hTable));
hTable.close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import org.apache.hadoop.hbase.chaos.factories.MonkeyFactory;
import org.apache.hadoop.hbase.chaos.monkies.ChaosMonkey;
import org.apache.hadoop.hbase.util.AbstractHBaseTool;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -159,13 +159,13 @@ protected int doWork() throws Exception {
return result;
}

@Before
@BeforeEach
public void setUp() throws Exception {
setUpCluster();
setUpMonkey();
}

@After
@AfterEach
public void cleanUp() throws Exception {
cleanUpMonkey();
cleanUpCluster();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package org.apache.hadoop.hbase;

import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -195,8 +197,8 @@ protected void verifyNamespaces() throws IOException {
// iterating concurrent map
for (String nsName : namespaceMap.keySet()) {
try {
Assert.assertTrue("Namespace: " + nsName + " in namespaceMap does not exist",
admin.getNamespaceDescriptor(nsName) != null);
assertTrue(admin.getNamespaceDescriptor(nsName) != null,
"Namespace: " + nsName + " in namespaceMap does not exist");
} catch (NamespaceNotFoundException nsnfe) {
Assert
.fail("Namespace: " + nsName + " in namespaceMap does not exist: " + nsnfe.getMessage());
Expand All @@ -210,12 +212,12 @@ protected void verifyTables() throws IOException {
Admin admin = connection.getAdmin();
// iterating concurrent map
for (TableName tableName : enabledTables.keySet()) {
Assert.assertTrue("Table: " + tableName + " in enabledTables is not enabled",
admin.isTableEnabled(tableName));
assertTrue(admin.isTableEnabled(tableName),
"Table: " + tableName + " in enabledTables is not enabled");
}
for (TableName tableName : disabledTables.keySet()) {
Assert.assertTrue("Table: " + tableName + " in disabledTables is not disabled",
admin.isTableDisabled(tableName));
assertTrue(admin.isTableDisabled(tableName),
"Table: " + tableName + " in disabledTables is not disabled");
}
for (TableName tableName : deletedTables.keySet()) {
Assert.assertFalse("Table: " + tableName + " in deletedTables is not deleted",
Expand Down Expand Up @@ -291,7 +293,7 @@ void perform() throws IOException {
LOG.info("Creating namespace:" + nsd);
admin.createNamespace(nsd);
NamespaceDescriptor freshNamespaceDesc = admin.getNamespaceDescriptor(nsd.getName());
Assert.assertTrue("Namespace: " + nsd + " was not created", freshNamespaceDesc != null);
assertTrue(freshNamespaceDesc != null, "Namespace: " + nsd + " was not created");
namespaceMap.put(nsd.getName(), freshNamespaceDesc);
LOG.info("Created namespace:" + freshNamespaceDesc);
} catch (Exception e) {
Expand Down Expand Up @@ -333,10 +335,10 @@ void perform() throws IOException {
modifiedNsd.setConfiguration(nsTestConfigKey, nsValueNew);
admin.modifyNamespace(modifiedNsd);
NamespaceDescriptor freshNamespaceDesc = admin.getNamespaceDescriptor(namespaceName);
Assert.assertTrue("Namespace: " + selected + " was not modified",
freshNamespaceDesc.getConfigurationValue(nsTestConfigKey).equals(nsValueNew));
Assert.assertTrue("Namespace: " + namespaceName + " does not exist",
admin.getNamespaceDescriptor(namespaceName) != null);
assertTrue(freshNamespaceDesc.getConfigurationValue(nsTestConfigKey).equals(nsValueNew),
"Namespace: " + selected + " was not modified");
assertTrue(admin.getNamespaceDescriptor(namespaceName) != null,
"Namespace: " + namespaceName + " does not exist");
namespaceMap.put(namespaceName, freshNamespaceDesc);
LOG.info("Modified namespace :" + freshNamespaceDesc);
} catch (Exception e) {
Expand Down Expand Up @@ -364,7 +366,7 @@ void perform() throws IOException {
try {
if (admin.getNamespaceDescriptor(namespaceName) != null) {
// the namespace still exists.
Assert.assertTrue("Namespace: " + selected + " was not deleted", false);
assertTrue(false, "Namespace: " + selected + " was not deleted");
} else {
LOG.info("Deleted namespace :" + selected);
}
Expand Down Expand Up @@ -415,10 +417,10 @@ void perform() throws IOException {
byte[] endKey = Bytes.toBytes("row-" + Integer.MAX_VALUE);
LOG.info("Creating table:" + td);
admin.createTable(td, startKey, endKey, numRegions);
Assert.assertTrue("Table: " + td + " was not created", admin.tableExists(tableName));
assertTrue(admin.tableExists(tableName), "Table: " + td + " was not created");
TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
Assert.assertTrue("After create, Table: " + tableName + " in not enabled",
admin.isTableEnabled(tableName));
assertTrue(admin.isTableEnabled(tableName),
"After create, Table: " + tableName + " in not enabled");
enabledTables.put(tableName, freshTableDesc);
LOG.info("Created table:" + freshTableDesc);
} catch (Exception e) {
Expand Down Expand Up @@ -453,11 +455,10 @@ void perform() throws IOException {
TableName tableName = selected.getTableName();
LOG.info("Disabling table :" + selected);
admin.disableTable(tableName);
Assert.assertTrue("Table: " + selected + " was not disabled",
admin.isTableDisabled(tableName));
assertTrue(admin.isTableDisabled(tableName), "Table: " + selected + " was not disabled");
TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
Assert.assertTrue("After disable, Table: " + tableName + " is not disabled",
admin.isTableDisabled(tableName));
assertTrue(admin.isTableDisabled(tableName),
"After disable, Table: " + tableName + " is not disabled");
disabledTables.put(tableName, freshTableDesc);
LOG.info("Disabled table :" + freshTableDesc);
} catch (Exception e) {
Expand Down Expand Up @@ -501,11 +502,10 @@ void perform() throws IOException {
TableName tableName = selected.getTableName();
LOG.info("Enabling table :" + selected);
admin.enableTable(tableName);
Assert.assertTrue("Table: " + selected + " was not enabled",
admin.isTableEnabled(tableName));
assertTrue(admin.isTableEnabled(tableName), "Table: " + selected + " was not enabled");
TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
Assert.assertTrue("After enable, Table: " + tableName + " in not enabled",
admin.isTableEnabled(tableName));
assertTrue(admin.isTableEnabled(tableName),
"After enable, Table: " + tableName + " in not enabled");
enabledTables.put(tableName, freshTableDesc);
LOG.info("Enabled table :" + freshTableDesc);
} catch (Exception e) {
Expand Down Expand Up @@ -598,10 +598,10 @@ void perform() throws IOException {
admin.addColumnFamily(tableName, cfd);
// assertion
TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
Assert.assertTrue("Column family: " + cfd + " was not added",
freshTableDesc.hasColumnFamily(cfd.getName()));
Assert.assertTrue("After add column family, Table: " + tableName + " is not disabled",
admin.isTableDisabled(tableName));
assertTrue(freshTableDesc.hasColumnFamily(cfd.getName()),
"Column family: " + cfd + " was not added");
assertTrue(admin.isTableDisabled(tableName),
"After add column family, Table: " + tableName + " is not disabled");
disabledTables.put(tableName, freshTableDesc);
LOG.info("Added column family: " + cfd + " to table: " + tableName);
} catch (Exception e) {
Expand Down Expand Up @@ -652,9 +652,8 @@ void perform() throws IOException {
freshColumnDesc.getMaxVersions(), versions);
Assert.assertEquals("Column family: " + freshColumnDesc + " was not altered",
freshColumnDesc.getMinVersions(), versions);
Assert.assertTrue(
"After alter versions of column family, Table: " + tableName + " is not disabled",
admin.isTableDisabled(tableName));
assertTrue(admin.isTableDisabled(tableName),
"After alter versions of column family, Table: " + tableName + " is not disabled");
disabledTables.put(tableName, freshTableDesc);
LOG.info("Altered versions of column family: " + columnDesc + " to: " + versions
+ " in table: " + tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/
package org.apache.hadoop.hbase;

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

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -30,9 +33,8 @@
import org.apache.hadoop.hbase.util.Threads;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.ToolRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -43,7 +45,7 @@
* A base class for tests that do something with the cluster while running {@link LoadTestTool} to
* write and verify some data.
*/
@Category(IntegrationTests.class)
@Tag(IntegrationTests.TAG)
public class IntegrationTestIngest extends IntegrationTestBase {
public static final char HIPHEN = '-';
private static final int SERVER_COUNT = 1; // number of slaves for the smallest cluster
Expand Down Expand Up @@ -93,7 +95,7 @@ protected int getMinServerCount() {

protected void initTable() throws IOException {
int ret = loadTool.run(getArgsForLoadTestToolInitTable());
Assert.assertEquals("Failed to initialize LoadTestTool", 0, ret);
assertEquals(0, ret, "Failed to initialize LoadTestTool");
}

@Override
Expand Down Expand Up @@ -173,15 +175,15 @@ protected void runIngestTest(long defaultRunTime, long keysPerServerPerIter, int
if (0 != ret) {
String errorMsg = "Load failed with error code " + ret;
LOG.error(errorMsg);
Assert.fail(errorMsg);
fail(errorMsg);
}

ret = loadTool.run(getArgsForLoadTestTool("-update", String.format("60:%d:1", writeThreads),
startKey, numKeys));
if (0 != ret) {
String errorMsg = "Update failed with error code " + ret;
LOG.error(errorMsg);
Assert.fail(errorMsg);
fail(errorMsg);
}

ret = loadTool.run(
Expand All @@ -195,7 +197,7 @@ protected void runIngestTest(long defaultRunTime, long keysPerServerPerIter, int
if (0 != ret) {
LOG.error("Rerun of Verification failed with error code " + ret);
}
Assert.fail(errorMsg);
fail(errorMsg);
}
startKey += numKeys;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
import org.apache.hadoop.hbase.testclassification.IntegrationTests;
import org.apache.hadoop.hbase.util.HFileTestUtil;
import org.apache.hadoop.util.ToolRunner;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Tag;

/**
* A test class that does the same things as IntegrationTestIngest but with stripe compactions. Can
* be used with ChaosMonkey in the same manner.
*/
@Category(IntegrationTests.class)
@Tag(IntegrationTests.TAG)
public class IntegrationTestIngestStripeCompactions extends IntegrationTestIngest {
@Override
protected void initTable() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.hadoop.hbase.util.LoadTestTool;
import org.apache.hadoop.hbase.util.test.LoadTestDataGeneratorWithACL;
import org.apache.hadoop.util.ToolRunner;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Tag;

import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;

Expand All @@ -39,7 +39,7 @@
* WRITE permissions are not read back and cells with READ permissions are read back. Every
* operation happens in the user's specific context
*/
@Category(IntegrationTests.class)
@Tag(IntegrationTests.TAG)
public class IntegrationTestIngestWithACL extends IntegrationTestIngest {

private static final char COLON = ':';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
import org.apache.hadoop.hbase.testclassification.IntegrationTests;
import org.apache.hadoop.hbase.util.EncryptionTest;
import org.apache.hadoop.util.ToolRunner;
import org.junit.Before;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category(IntegrationTests.class)
@Tag(IntegrationTests.TAG)
public class IntegrationTestIngestWithEncryption extends IntegrationTestIngest {
private final static Logger LOG =
LoggerFactory.getLogger(IntegrationTestIngestWithEncryption.class);
Expand Down Expand Up @@ -63,7 +63,7 @@ public void setUpCluster() throws Exception {
initialized = true;
}

@Before
@BeforeEach
@Override
public void setUp() throws Exception {
// Initialize the cluster. This invokes LoadTestTool -init_only, which
Expand Down
Loading