[
https://issues.apache.org/jira/browse/HADOOP-19426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949415#comment-17949415
]
ASF GitHub Bot commented on HADOOP-19426:
-----------------------------------------
anujmodi2021 commented on code in PR #7652:
URL: https://github.com/apache/hadoop/pull/7652#discussion_r2073308197
##########
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:
nit: EOF
##########
hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlInternalCreateNonRecursive.java:
##########
@@ -23,25 +23,23 @@
import org.apache.hadoop.fs.FileAlreadyExistsException;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.adl.common.Parallelized;
import org.apache.hadoop.fs.permission.FsPermission;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Collection;
import java.util.UUID;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
/**
* Test createNonRecursive API.
*/
-@RunWith(Parallelized.class)
Review Comment:
Is this removed intentionally?
> 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: [email protected]
For additional commands, e-mail: [email protected]