Skip to content

Commit 8b7539a

Browse files
committed
ass messages to Junit4 assumptions
1 parent ef27d7d commit 8b7539a

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,7 @@ public void checkPermission(Permission perm) {
599599
}
600600
});
601601
} catch (UnsupportedOperationException e) {
602-
// Test is skipped because SecurityManager cannot be set (JEP411)
603-
// TODO add message when migrating to Junit 5
604-
assumeTrue(false);
602+
assumeTrue("Test is skipped because SecurityManager cannot be set (JEP 411)", false);
605603
}
606604
show("copy local " + f1 + " to remote " + dst);
607605
dfs.copyFromLocalFile(false, false, new Path(f1.getPath()), dst);

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeRegistration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ public void testDNSLookups() throws Exception {
8383
try {
8484
System.setSecurityManager(sm);
8585
} catch (UnsupportedOperationException e) {
86-
// Test is skipped because SecurityManager cannot be set (JEP411)
87-
// TODO add message when migrating to Junit 5
88-
assumeTrue(false);
86+
assumeTrue("Test is skipped because SecurityManager cannot be set (JEP 411)", false);
8987
}
9088

9189
MiniDFSCluster cluster = null;

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestExternalCall.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ public void setup() {
7070
try {
7171
System.setSecurityManager(new NoExitSecurityManager());
7272
} catch (UnsupportedOperationException e) {
73-
assumeTrue(false,
74-
"Test is skipped because SecurityManager cannot be set (JEP411)");
73+
assumeTrue(false, "Test is skipped because SecurityManager cannot be set (JEP 411)");
7574
}
7675
try {
7776
fs = FileSystem.get(getConf());

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ private void testPreMountedControllerInitialization(String myHierarchy)
375375
try {
376376
System.setSecurityManager(new MockSecurityManagerDenyWrite());
377377
} catch (UnsupportedOperationException e) {
378-
assumeTrue(false,
379-
"Test is skipped because SecurityManager cannot be set (JEP411)");
378+
assumeTrue(false, "Test is skipped because SecurityManager cannot be set (JEP 411)");
380379
}
381380
try {
382381
cGroupsHandler.initializeCGroupController(

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAsyncScheduling.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,7 @@ public void testAsyncScheduleThreadExit() throws Exception {
10941094
try {
10951095
System.setSecurityManager(noExitSecurityManager);
10961096
} catch (UnsupportedOperationException e) {
1097-
// Test is skipped because SecurityManager cannot be set (JEP411)
1098-
// TODO add message when migrating to Junit 5
1099-
Assume.assumeTrue(false);
1097+
Assume.assumeTrue("Test is skipped because SecurityManager cannot be set (JEP 411)", false);
11001098
}
11011099

11021100
// test async-scheduling thread exit

0 commit comments

Comments
 (0)