Bläddra i källkod

YARN-1880. Cleanup TestApplicationClientProtocolOnHA. Contributed by ozawa.

(cherry picked from commit 8a9bbf548dad82598354c24fcd4dc80a715da7ac)
Harsh J 10 år sedan
förälder
incheckning
e7702ac6a1

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -10,6 +10,9 @@ Release 2.8.0 - UNRELEASED
 
 
   IMPROVEMENTS
   IMPROVEMENTS
 
 
+    YARN-1880. Cleanup TestApplicationClientProtocolOnHA
+    (ozawa via harsh)
+
     YARN-3243. CapacityScheduler should pass headroom from parent to children
     YARN-3243. CapacityScheduler should pass headroom from parent to children
     to make sure ParentQueue obey its capacity limits. (Wangda Tan via jianhe)
     to make sure ParentQueue obey its capacity limits. (Wangda Tan via jianhe)
 
 

+ 10 - 6
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestApplicationClientProtocolOnHA.java

@@ -93,7 +93,8 @@ public class TestApplicationClientProtocolOnHA extends ProtocolHATestBase {
   public void testGetApplicationsOnHA() throws Exception {
   public void testGetApplicationsOnHA() throws Exception {
     List<ApplicationReport> reports =
     List<ApplicationReport> reports =
         client.getApplications();
         client.getApplications();
-    Assert.assertTrue(reports != null && !reports.isEmpty());
+    Assert.assertTrue(reports != null);
+    Assert.assertFalse(reports.isEmpty());
     Assert.assertEquals(cluster.createFakeAppReports(),
     Assert.assertEquals(cluster.createFakeAppReports(),
         reports);
         reports);
   }
   }
@@ -101,7 +102,8 @@ public class TestApplicationClientProtocolOnHA extends ProtocolHATestBase {
   @Test(timeout = 15000)
   @Test(timeout = 15000)
   public void testGetClusterNodesOnHA() throws Exception {
   public void testGetClusterNodesOnHA() throws Exception {
     List<NodeReport> reports = client.getNodeReports(NodeState.RUNNING);
     List<NodeReport> reports = client.getNodeReports(NodeState.RUNNING);
-    Assert.assertTrue(reports != null && !reports.isEmpty());
+    Assert.assertTrue(reports != null);
+    Assert.assertFalse(reports.isEmpty());
     Assert.assertEquals(cluster.createFakeNodeReports(),
     Assert.assertEquals(cluster.createFakeNodeReports(),
         reports);
         reports);
   }
   }
@@ -117,8 +119,8 @@ public class TestApplicationClientProtocolOnHA extends ProtocolHATestBase {
   @Test(timeout = 15000)
   @Test(timeout = 15000)
   public void testGetQueueUserAclsOnHA() throws Exception {
   public void testGetQueueUserAclsOnHA() throws Exception {
     List<QueueUserACLInfo> queueUserAclsList = client.getQueueAclsInfo();
     List<QueueUserACLInfo> queueUserAclsList = client.getQueueAclsInfo();
-    Assert.assertTrue(queueUserAclsList != null
-        && !queueUserAclsList.isEmpty());
+    Assert.assertTrue(queueUserAclsList != null);
+    Assert.assertFalse(queueUserAclsList.isEmpty());
     Assert.assertEquals(cluster.createFakeQueueUserACLInfoList(),
     Assert.assertEquals(cluster.createFakeQueueUserACLInfoList(),
         queueUserAclsList);
         queueUserAclsList);
   }
   }
@@ -136,7 +138,8 @@ public class TestApplicationClientProtocolOnHA extends ProtocolHATestBase {
   public void testGetApplicationAttemptsOnHA() throws Exception {
   public void testGetApplicationAttemptsOnHA() throws Exception {
     List<ApplicationAttemptReport> reports =
     List<ApplicationAttemptReport> reports =
         client.getApplicationAttempts(cluster.createFakeAppId());
         client.getApplicationAttempts(cluster.createFakeAppId());
-    Assert.assertTrue(reports != null && !reports.isEmpty());
+    Assert.assertTrue(reports != null);
+    Assert.assertFalse(reports.isEmpty());
     Assert.assertEquals(cluster.createFakeApplicationAttemptReports(),
     Assert.assertEquals(cluster.createFakeApplicationAttemptReports(),
         reports);
         reports);
   }
   }
@@ -153,7 +156,8 @@ public class TestApplicationClientProtocolOnHA extends ProtocolHATestBase {
   public void testGetContainersOnHA() throws Exception {
   public void testGetContainersOnHA() throws Exception {
     List<ContainerReport> reports =
     List<ContainerReport> reports =
         client.getContainers(cluster.createFakeApplicationAttemptId());
         client.getContainers(cluster.createFakeApplicationAttemptId());
-    Assert.assertTrue(reports != null && !reports.isEmpty());
+    Assert.assertTrue(reports != null);
+    Assert.assertFalse(reports.isEmpty());
     Assert.assertEquals(cluster.createFakeContainerReports(),
     Assert.assertEquals(cluster.createFakeContainerReports(),
         reports);
         reports);
   }
   }