Skip to content

Commit 3924100

Browse files
authored
HADOOP-19425. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-azure Part4. (#7954) Contributed by Hualong Zhang.
* HADOOP-19425. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-azure Part4. Reviewed-by: Anuj Modi <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent 79f37d0 commit 3924100

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/commit/ITestAbfsJobThroughManifestCommitter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import java.util.List;
2323

2424
import org.assertj.core.api.Assertions;
25-
import org.junit.FixMethodOrder;
25+
import org.junit.jupiter.api.MethodOrderer;
2626
import org.junit.jupiter.api.BeforeEach;
27-
import org.junit.runners.MethodSorters;
27+
import org.junit.jupiter.api.TestMethodOrder;
2828

2929
import org.apache.hadoop.conf.Configuration;
3030
import org.apache.hadoop.fs.FileStatus;
@@ -43,7 +43,7 @@
4343
/**
4444
* Test the Manifest committer stages against ABFS.
4545
*/
46-
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
46+
@TestMethodOrder(MethodOrderer.MethodName.class)
4747
public class ITestAbfsJobThroughManifestCommitter
4848
extends TestJobThroughManifestCommitter {
4949

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/commit/ITestAbfsTerasort.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
import java.util.Optional;
2727
import java.util.function.Consumer;
2828

29-
import org.junit.FixMethodOrder;
29+
import org.junit.jupiter.api.TestMethodOrder;
3030
import org.junit.jupiter.api.BeforeEach;
3131
import org.junit.jupiter.api.Test;
32-
import org.junit.runners.MethodSorters;
32+
import org.junit.jupiter.api.MethodOrderer;
3333
import org.slf4j.Logger;
3434
import org.slf4j.LoggerFactory;
3535

@@ -65,7 +65,7 @@
6565
* The tests run in sequence, so each operation is isolated.
6666
* Scale test only (it is big and slow)
6767
*/
68-
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
68+
@TestMethodOrder(MethodOrderer.MethodName.class)
6969
@SuppressWarnings({"StaticNonFinalField", "OptionalUsedAsFieldOrParameterType"})
7070
public class ITestAbfsTerasort extends AbstractAbfsClusterITest {
7171

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/contract/ITestAbfsFileSystemContractRootDirectory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.apache.hadoop.conf.Configuration;
2121
import org.apache.hadoop.fs.contract.AbstractContractRootDirectoryTest;
2222
import org.apache.hadoop.fs.contract.AbstractFSContract;
23-
import org.junit.Ignore;
23+
import org.junit.jupiter.api.Disabled;
2424
import org.junit.jupiter.api.BeforeEach;
2525

2626
/**
@@ -53,7 +53,7 @@ protected AbstractFSContract createContract(final Configuration conf) {
5353
}
5454

5555
@Override
56-
@Ignore("ABFS always return false when non-recursively remove root dir")
56+
@Disabled("ABFS always return false when non-recursively remove root dir")
5757
public void testRmNonEmptyRootDirNonRecursive() throws Throwable {
5858
}
5959
}

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestExponentialRetryPolicy.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import static org.apache.hadoop.fs.azurebfs.constants.TestConfigurationKeys.FS_AZURE_ACCOUNT_NAME;
3434
import static org.apache.hadoop.fs.azurebfs.constants.TestConfigurationKeys.TEST_CONFIGURATION_FILE_NAME;
3535

36-
import static org.junit.Assume.assumeTrue;
36+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
3737
import static org.mockito.Mockito.mock;
3838
import static org.mockito.Mockito.when;
3939

@@ -154,8 +154,8 @@ public void testCreateMultipleAccountThrottling() throws Exception {
154154
// check if accountName is set using different config key
155155
accountName = config.get(FS_AZURE_ABFS_ACCOUNT1_NAME);
156156
}
157-
assumeTrue("Not set: " + FS_AZURE_ABFS_ACCOUNT1_NAME,
158-
accountName != null && !accountName.isEmpty());
157+
assumeTrue(accountName != null && !accountName.isEmpty(),
158+
"Not set: " + FS_AZURE_ABFS_ACCOUNT1_NAME);
159159

160160
Configuration rawConfig1 = new Configuration();
161161
rawConfig1.addResource(TEST_CONFIGURATION_FILE_NAME);
@@ -173,8 +173,8 @@ public void testCreateMultipleAccountThrottling() throws Exception {
173173
AbfsThrottlingIntercept instance1 = AbfsThrottlingInterceptFactory.getInstance(accountName, configuration);
174174
String accountName1 = config.get(FS_AZURE_ABFS_ACCOUNT1_NAME);
175175

176-
assumeTrue("Not set: " + FS_AZURE_ABFS_ACCOUNT1_NAME,
177-
accountName1 != null && !accountName1.isEmpty());
176+
assumeTrue(accountName1 != null && !accountName1.isEmpty(),
177+
"Not set: " + FS_AZURE_ABFS_ACCOUNT1_NAME);
178178

179179
AbfsThrottlingIntercept instance2 = AbfsThrottlingInterceptFactory.getInstance(accountName1, configuration);
180180
//if singleton is enabled, for different accounts both the instances should return same value
@@ -233,8 +233,8 @@ public void testOperationOnAccountIdle() throws Exception {
233233
AzureBlobFileSystem fs1 = new AzureBlobFileSystem();
234234
Configuration config = new Configuration(getRawConfiguration());
235235
String accountName1 = config.get(FS_AZURE_ABFS_ACCOUNT1_NAME);
236-
assumeTrue("Not set: " + FS_AZURE_ABFS_ACCOUNT1_NAME,
237-
accountName1 != null && !accountName1.isEmpty());
236+
assumeTrue(accountName1 != null && !accountName1.isEmpty(),
237+
"Not set: " + FS_AZURE_ABFS_ACCOUNT1_NAME);
238238
final String abfsUrl1 = this.getFileSystemName() + "12" + "@" + accountName1;
239239
URI defaultUri1 = null;
240240
defaultUri1 = new URI("abfss", abfsUrl1, null, null, null);

0 commit comments

Comments
 (0)