Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.XMLUtils;

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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,7 +85,7 @@ protected void readTestConfigFile() {
testConfigFile, e);
success = false;
}
assertTrue("Error reading test config file", success);
assertTrue(success, "Error reading test config file");
}
}

@@ -262,9 +262,9 @@ private void displayResults() {
LOG.info("NONE");
}

assertTrue("One of the tests failed. " +
assertTrue(overallResults, "One of the tests failed. " +
"See the Detailed results to identify " +
"the command that failed", overallResults);
"the command that failed");

}

@@ -310,8 +310,8 @@ private boolean compareTextExitCode(ComparatorData compdata,
*********************************/

public void testAll() {
assertTrue("Number of tests has to be greater then zero",
testsFromConfigFile.size() > 0);
assertTrue(
testsFromConfigFile.size() > 0, "Number of tests has to be greater then zero");
LOG.info("TestAll");
// Run the tests defined in the testConf.xml config file.
for (int index = 0; index < testsFromConfigFile.size(); index++) {
Original file line number Diff line number Diff line change
@@ -20,21 +20,21 @@

import org.apache.hadoop.cli.util.CLICommand;
import org.apache.hadoop.cli.util.CommandExecutor;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
* Tests for the Command Line Interface (CLI)
*/
public class TestCLI extends CLITestHelper {
@Before
@BeforeEach
@Override
public void setUp() throws Exception {
super.setUp();
}

@After
@AfterEach
@Override
public void tearDown() throws Exception {
super.tearDown();
Original file line number Diff line number Diff line change
@@ -43,13 +43,13 @@
import org.apache.hadoop.http.HttpServer2;
import org.apache.hadoop.util.XMLUtils;

import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.mockito.Mockito.when;
import static org.mockito.Mockito.mock;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* Basic test case that the ConfServlet can write configuration
@@ -64,7 +64,7 @@ public class TestConfServlet {
new HashMap<String, String>();
private static final Map<String, String> MASK_PROPERTIES = new HashMap<>();

@BeforeClass
@BeforeAll
public static void initTestProperties() {
TEST_PROPERTIES.put("test.key1", "value1");
TEST_PROPERTIES.put("test.key2", "value2");
Original file line number Diff line number Diff line change
@@ -18,8 +18,8 @@

package org.apache.hadoop.conf;

import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.List;
@@ -75,9 +75,9 @@ private void testRedact(Configuration conf) throws Exception {
);
for (String key : sensitiveKeys) {
processedText = redactor.redact(key, ORIGINAL_VALUE);
Assert.assertEquals(
"Config parameter wasn't redacted and should be: " + key,
REDACTED_TEXT, processedText);
Assertions.assertEquals(

REDACTED_TEXT, processedText, "Config parameter wasn't redacted and should be: " + key);
}

List<String> normalKeys = Arrays.asList(
@@ -90,9 +90,9 @@ private void testRedact(Configuration conf) throws Exception {
);
for (String key : normalKeys) {
processedText = redactor.redact(key, ORIGINAL_VALUE);
Assert.assertEquals(
"Config parameter was redacted and shouldn't be: " + key,
ORIGINAL_VALUE, processedText);
Assertions.assertEquals(

ORIGINAL_VALUE, processedText, "Config parameter was redacted and shouldn't be: " + key);
}
}
}
Loading