dannycjones commented on code in PR #4334:
URL: https://github.com/apache/hadoop/pull/4334#discussion_r879406416
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractFSContractTestBase.java:
##########
@@ -400,4 +402,12 @@ protected String generateAndLogErrorListing(Path src, Path
dst) throws
}
return destDirLS;
}
+
+ public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
+ assertThat("", actual, matcher);
+ }
+
+ public static <T> void assertThat(String reason, T actual, Matcher<? super
T> matcher) {
+ MatcherAssert.assertThat(reason, actual, matcher);
+ }
Review Comment:
similar to another comment: Please add a short JavaDoc explaining why they
are here and when we should remove them.
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsTestWithTimeout.java:
##########
@@ -126,4 +128,8 @@ protected boolean validateContent(AzureBlobFileSystem fs,
Path path,
}
+ public static <T> void assertThat(String reason, T actual, Matcher<? super
T> matcher) {
+ MatcherAssert.assertThat(reason, actual, matcher);
+ }
Review Comment:
Please add a short JavaDoc explaining why its here.
Something like
"Override `assertThat` introduced by extending JUnit `Assertions` in base
test class. If extending `Assertions` is removed, we can elimiate this method
and import directly."
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java:
##########
@@ -917,7 +917,8 @@ private void checkEachCompInstancesInOrder(Component
component, String
int i = 0;
for (String s : instances) {
- assertThat(s).isEqualTo(component.getName() + "-" + i);
+ assertThat(s,
+ CoreMatchers.containsString(component.getName() + "-" + i));
Review Comment:
I'm not sure if there's any side effects here, we are changing the test.
Can we stick with equals?
```suggestion
assertThat(s, CoreMatchers.equalTo(component.getName() + "-" + i));
```
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/HadoopTestBase.java:
##########
@@ -105,4 +107,8 @@ public static void nameTestThread() {
public void nameThreadToMethod() {
Thread.currentThread().setName("JUnit-" + getMethodName());
}
+
+ public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
+ MatcherAssert.assertThat("", actual, matcher);
+ }
Review Comment:
similar to another comment: Please add a short JavaDoc explaining why its
here and when we should remove it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]