Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.stream.StreamSupport;

import org.assertj.core.api.AbstractStringAssert;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

import java.util.EnumSet;

import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.test.AbstractHadoopTestBase;
Expand All @@ -31,6 +30,7 @@
import static org.apache.hadoop.fs.impl.FlagSet.buildFlagSet;
import static org.apache.hadoop.fs.impl.FlagSet.createFlagSet;
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.assertj.core.api.Assertions.assertThat;

/**
* Unit tests for {@link FlagSet} class.
Expand Down Expand Up @@ -68,7 +68,7 @@ private enum OtherEnum { a }
*/
@Test
public void testEntryEnableDisable() {
Assertions.assertThat(flagSet.flags()).isEmpty();
assertThat(flagSet.flags()).isEmpty();
assertDisabled(SimpleEnum.a);
flagSet.enable(SimpleEnum.a);
assertEnabled(SimpleEnum.a);
Expand All @@ -81,7 +81,7 @@ public void testEntryEnableDisable() {
*/
@Test
public void testSetMethod() {
Assertions.assertThat(flagSet.flags()).isEmpty();
assertThat(flagSet.flags()).isEmpty();
flagSet.set(SimpleEnum.a, true);
assertEnabled(SimpleEnum.a);
flagSet.set(SimpleEnum.a, false);
Expand Down Expand Up @@ -136,15 +136,15 @@ public void testToString() throws Throwable {
* @param expected expected value
*/
private void assertStringValue(final String expected) {
Assertions.assertThat(flagSet.toString())
assertThat(flagSet.toString())
.isEqualTo(expected);
}

/**
* Assert the configuration string form matches that expected.
*/
public void assertConfigurationStringMatches(final String expected) {
Assertions.assertThat(flagSet.toConfigurationString())
assertThat(flagSet.toConfigurationString())
.describedAs("Configuration string of %s", flagSet)
.isEqualTo(expected);
}
Expand Down Expand Up @@ -224,7 +224,7 @@ private static Configuration mkConf(final String value) {
* @param capability capability to probe for
*/
private void assertHasCapability(final String capability) {
Assertions.assertThat(flagSet.hasCapability(capability))
assertThat(flagSet.hasCapability(capability))
.describedAs("Capability of %s on %s", capability, flagSet)
.isTrue();
}
Expand All @@ -234,7 +234,7 @@ private void assertHasCapability(final String capability) {
* @param capability capability to probe for
*/
private void assertLacksCapability(final String capability) {
Assertions.assertThat(flagSet.hasCapability(capability))
assertThat(flagSet.hasCapability(capability))
.describedAs("Capability of %s on %s", capability, flagSet)
.isFalse();
}
Expand All @@ -248,7 +248,7 @@ public void testStarEntry() {
assertFlags(SimpleEnum.a, SimpleEnum.b, SimpleEnum.c);
assertHasCapability(CAPABILITY_A);
assertHasCapability(CAPABILITY_B);
Assertions.assertThat(flagSet.pathCapabilities())
assertThat(flagSet.pathCapabilities())
.describedAs("path capabilities of %s", flagSet)
.containsExactlyInAnyOrder(CAPABILITY_A, CAPABILITY_B, CAPABILITY_C);
}
Expand All @@ -259,7 +259,7 @@ public void testRoundTrip() {
KEYDOT,
allOf(SimpleEnum.class));
final FlagSet<SimpleEnum> s2 = roundTrip(s1);
Assertions.assertThat(s1.flags()).isEqualTo(s2.flags());
assertThat(s1.flags()).isEqualTo(s2.flags());
assertFlagSetMatches(s2, SimpleEnum.a, SimpleEnum.b, SimpleEnum.c);
}

Expand All @@ -268,13 +268,13 @@ public void testEmptyRoundTrip() {
final FlagSet<SimpleEnum> s1 = createFlagSet(SimpleEnum.class, KEYDOT,
noneOf(SimpleEnum.class));
final FlagSet<SimpleEnum> s2 = roundTrip(s1);
Assertions.assertThat(s1.flags())
assertThat(s1.flags())
.isEqualTo(s2.flags());
Assertions.assertThat(s2.isEmpty())
assertThat(s2.isEmpty())
.describedAs("empty flagset %s", s2)
.isTrue();
assertFlagSetMatches(flagSet);
Assertions.assertThat(flagSet.pathCapabilities())
assertThat(flagSet.pathCapabilities())
.describedAs("path capabilities of %s", flagSet)
.isEmpty();
}
Expand All @@ -298,10 +298,10 @@ public void testEquality() {
final FlagSet<SimpleEnum> s2 = createFlagSet(SimpleEnum.class, KEYDOT, SimpleEnum.a);
// make one of them immutable
s2.makeImmutable();
Assertions.assertThat(s1)
assertThat(s1)
.describedAs("s1 == s2")
.isEqualTo(s2);
Assertions.assertThat(s1.hashCode())
assertThat(s1.hashCode())
.describedAs("hashcode of s1 == hashcode of s2")
.isEqualTo(s2.hashCode());
}
Expand All @@ -312,7 +312,7 @@ public void testInequality() {
createFlagSet(SimpleEnum.class, KEYDOT, noneOf(SimpleEnum.class));
final FlagSet<SimpleEnum> s2 =
createFlagSet(SimpleEnum.class, KEYDOT, SimpleEnum.a, SimpleEnum.b);
Assertions.assertThat(s1)
assertThat(s1)
.describedAs("s1 == s2")
.isNotEqualTo(s2);
}
Expand All @@ -323,7 +323,7 @@ public void testClassInequality() {
createFlagSet(SimpleEnum.class, KEYDOT, noneOf(SimpleEnum.class));
final FlagSet<?> s2 =
createFlagSet(OtherEnum.class, KEYDOT, OtherEnum.a);
Assertions.assertThat(s1)
assertThat(s1)
.describedAs("s1 == s2")
.isNotEqualTo(s2);
}
Expand All @@ -338,13 +338,13 @@ public void testCopy() throws Throwable {
createFlagSet(SimpleEnum.class, KEYDOT, SimpleEnum.a, SimpleEnum.b);
s1.makeImmutable();
FlagSet<SimpleEnum> s2 = s1.copy();
Assertions.assertThat(s2)
assertThat(s2)
.describedAs("copy of %s", s1)
.isNotSameAs(s1);
Assertions.assertThat(!s2.isImmutable())
assertThat(!s2.isImmutable())
.describedAs("set %s is immutable", s2)
.isTrue();
Assertions.assertThat(s1)
assertThat(s1)
.describedAs("s1 == s2")
.isEqualTo(s2);
}
Expand Down Expand Up @@ -377,7 +377,7 @@ private FlagSet<SimpleEnum> roundTrip(FlagSet<SimpleEnum> flagset) {
* @param flag flag to check
*/
private void assertEnabled(final SimpleEnum flag) {
Assertions.assertThat(flagSet.enabled(flag))
assertThat(flagSet.enabled(flag))
.describedAs("status of flag %s in %s", flag, flagSet)
.isTrue();
}
Expand All @@ -387,7 +387,7 @@ private void assertEnabled(final SimpleEnum flag) {
* @param flag flag to check
*/
private void assertDisabled(final SimpleEnum flag) {
Assertions.assertThat(flagSet.enabled(flag))
assertThat(flagSet.enabled(flag))
.describedAs("status of flag %s in %s", flag, flagSet)
.isFalse();
}
Expand All @@ -409,7 +409,7 @@ private void assertFlags(final SimpleEnum... flags) {
private void assertFlagSetMatches(
FlagSet<SimpleEnum> fs,
SimpleEnum... flags) {
Assertions.assertThat(fs.flags())
assertThat(fs.flags())
.describedAs("path capabilities of %s", fs)
.containsExactly(flags);
}
Expand All @@ -424,7 +424,7 @@ private void assertFlagSetMatches(
private void assertPathCapabilitiesMatch(
FlagSet<SimpleEnum> fs,
String... capabilities) {
Assertions.assertThat(fs.pathCapabilities())
assertThat(fs.pathCapabilities())
.describedAs("path capabilities of %s", fs)
.containsExactlyInAnyOrder(capabilities);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

import java.util.concurrent.atomic.AtomicInteger;

import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -30,6 +29,7 @@

import static org.apache.hadoop.fs.impl.LeakReporter.THREAD_FORMAT;
import static org.apache.hadoop.test.GenericTestUtils.LogCapturer.captureLogs;
import static org.assertj.core.api.Assertions.assertThat;

public final class TestLeakReporter extends AbstractHadoopTestBase {

Expand Down Expand Up @@ -74,7 +74,7 @@ public void testLeakInvocation() throws Throwable {
oldName,
Thread.currentThread().getId());
// log auditing
Assertions.assertThat(output)
assertThat(output)
.describedAs("output from the logs")
.contains("WARN")
.contains(message)
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testCloseActionSwallowed() throws Throwable {
this::raiseNPE);
reporter.close();

Assertions.assertThat(reporter.isClosed())
assertThat(reporter.isClosed())
.describedAs("reporter closed)")
.isTrue();
}
Expand All @@ -158,7 +158,7 @@ private boolean raiseNPE() {
* @param ex expected.
*/
private void assertCloseCount(final int ex) {
Assertions.assertThat(closeCount.get())
assertThat(closeCount.get())
.describedAs("close count")
.isEqualTo(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@

import java.nio.ByteBuffer;

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

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.LocalDirAllocator;
import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.fs.CommonConfigurationKeys.HADOOP_TMP_DIR;
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class TestBlockCache extends AbstractHadoopTestBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

package org.apache.hadoop.fs.impl.prefetch;

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

import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class TestBlockData extends AbstractHadoopTestBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

import java.lang.reflect.Method;

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

import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class TestBlockOperations extends AbstractHadoopTestBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
import java.util.IdentityHashMap;
import java.util.Set;

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

import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class TestBoundedResourcePool extends AbstractHadoopTestBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
import java.util.List;
import java.util.concurrent.CompletableFuture;

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

import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertSame;

public class TestBufferData extends AbstractHadoopTestBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

package org.apache.hadoop.fs.impl.prefetch;

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

import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;

public class TestBufferPool extends AbstractHadoopTestBase {

Expand Down
Loading