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

Sandy Ryza commented on YARN-1332:
----------------------------------

Thanks Sebastian.  The last thing is that, for assertEquals where we're 
comparing a variable with a constant, we should be consistent with the order of 
arguments:
{code}
-    assertTrue(amClient.ask.size() == 0);
-    assertTrue(amClient.release.size() == 0);
+    assertEquals(0, amClient.ask.size());
+    assertEquals(amClient.release.size(), 0);
{code}

The expected value, i.e. the constant, should be the first argument.

> In TestAMRMClient, replace assertTrue with assertEquals where possible
> ----------------------------------------------------------------------
>
>                 Key: YARN-1332
>                 URL: https://issues.apache.org/jira/browse/YARN-1332
>             Project: Hadoop YARN
>          Issue Type: Improvement
>    Affects Versions: 2.2.0
>            Reporter: Sandy Ryza
>            Assignee: Sebastian Wong
>            Priority: Minor
>              Labels: newbie
>         Attachments: YARN-1332-2.patch, YARN-1332.patch
>
>
> TestAMRMClient uses a lot of "assertTrue(amClient.ask.size() == 0)" where 
> "assertEquals(0, amClient.ask.size())" would make it easier to see why it's 
> failing at a glance.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to