[ 
https://issues.apache.org/jira/browse/HADOOP-19426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949436#comment-17949436
 ] 

ASF GitHub Bot commented on HADOOP-19426:
-----------------------------------------

slfan1989 commented on code in PR #7652:
URL: https://github.com/apache/hadoop/pull/7652#discussion_r2073467005


##########
hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlSupportedCharsetInPath.java:
##########
@@ -286,49 +284,45 @@ private boolean contains(FileStatus[] statuses, String 
remotePath) {
     return false;
   }
 
-  @Before
+  @BeforeEach
   public void setup() throws Exception {
-    org.junit.Assume
-        .assumeTrue(AdlStorageConfiguration.isContractTestEnabled());
+    assumeTrue(AdlStorageConfiguration.isContractTestEnabled());
   }
 
-  @Test
-  public void testAllowedSpecialCharactersRename()
+  @MethodSource("adlCharTestData")
+  @ParameterizedTest(name = "filePath {0}")
+  public void testAllowedSpecialCharactersRename(String filePath)
       throws IOException, URISyntaxException {
-
+    initTestAdlSupportedCharsetInPath(filePath);
     String parentPath = TEST_ROOT + UUID.randomUUID().toString() + "/";
     Path specialFile = new Path(parentPath + path);
     Path anotherLocation = new Path(parentPath + UUID.randomUUID().toString());
     FileSystem fs = AdlStorageConfiguration.createStorageConnector();
 
-    Assert.assertTrue("Could not create " + specialFile.toString(),
-        fs.createNewFile(specialFile));
-    Assert.assertTrue(
-        "Failed to rename " + specialFile.toString() + " --> " + 
anotherLocation
-            .toString(), fs.rename(specialFile, anotherLocation));
-    Assert.assertFalse("File should not be present after successful rename : "
-        + specialFile.toString(), fs.exists(specialFile));
-    Assert.assertTrue("File should be present after successful rename : "
-        + anotherLocation.toString(), fs.exists(anotherLocation));
-    Assert.assertFalse(
-        "Listed under parent whereas expected not listed : " + parentPath,
-        contains(fs.listStatus(new Path(parentPath)),
-            fs.makeQualified(specialFile).toString()));
+    assertTrue(fs.createNewFile(specialFile),
+        "Could not create " + specialFile.toString());
+    assertTrue(fs.rename(specialFile, anotherLocation),
+        "Failed to rename " + specialFile.toString() + " --> " + 
anotherLocation.toString());
+    assertFalse(fs.exists(specialFile), "File should not be present after 
successful rename : "
+        + specialFile.toString());
+    assertTrue(fs.exists(anotherLocation), "File should be present after 
successful rename : "
+        + anotherLocation.toString());
+    assertFalse(contains(fs.listStatus(new Path(parentPath)),
+        fs.makeQualified(specialFile).toString()),
+        "Listed under parent whereas expected not listed : " + parentPath);
 
-    Assert.assertTrue(
+    assertTrue(fs.rename(anotherLocation, specialFile),
         "Failed to rename " + anotherLocation.toString() + " --> " + 
specialFile
-            .toString(), fs.rename(anotherLocation, specialFile));
-    Assert.assertTrue(
-        "File should be present after successful rename : " + "" + specialFile
-            .toString(), fs.exists(specialFile));
-    Assert.assertFalse("File should not be present after successful rename : "
-        + anotherLocation.toString(), fs.exists(anotherLocation));
+        .toString());
+    assertTrue(fs.exists(specialFile),
+        "File should be present after successful rename : " + "" + 
specialFile.toString());
+    assertFalse(fs.exists(anotherLocation),
+        "File should not be present after successful rename : "
+        + anotherLocation.toString());
 
-    Assert.assertTrue("Not listed under parent " + parentPath,
-        contains(fs.listStatus(new Path(parentPath)),
-            fs.makeQualified(specialFile).toString()));
+    assertTrue(contains(fs.listStatus(new Path(parentPath)),
+        fs.makeQualified(specialFile).toString()), "Not listed under parent " 
+ parentPath);
 
-    Assert.assertTrue("Failed to delete " + parentPath,
-        fs.delete(new Path(parentPath), true));
+    assertTrue(fs.delete(new Path(parentPath), true), "Failed to delete " + 
parentPath);
   }
 }

Review Comment:
   Thank you for helping with the review! I will make improvements to it.





> Upgrade JUnit from 4 to 5 in hadoop-azure-datalake.
> ---------------------------------------------------
>
>                 Key: HADOOP-19426
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19426
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: build, test
>    Affects Versions: 3.5.0
>            Reporter: Shilun Fan
>            Assignee: Shilun Fan
>            Priority: Major
>              Labels: pull-request-available
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to