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

Szilard Nemeth commented on YARN-9995:
--------------------------------------

Hi [~BilwaST], 
No, I didn't mean to use reflection at all. 
I only meant creating some helper methods, for example to contain these lines 
into a method: 

{code:java}
 QueueConfigInfo bAddInfo = schedUpdateInfo.getAddQueueInfo().get(0);
    assertEquals("root.b", bAddInfo.getQueue());
    Map<String, String> bParams = bAddInfo.getParams();
    assertEquals(1, bParams.size());
    assertEquals("bVal1", bParams.get("b1"));
{code}

These calls are strictly related to each other, so a method that could validate 
a QueueConfigInfo could be useful.
Its parameter could be: the index of queueConfigInfo object (0 in this case), a 
path to validate ("root.b"), an expected number of params of bAddInfo (1) and a 
pair of queue name and expected value ("b1", "bVal1"). I meant something like 
this.

> Code cleanup in TestSchedConfCLI
> --------------------------------
>
>                 Key: YARN-9995
>                 URL: https://issues.apache.org/jira/browse/YARN-9995
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Szilard Nemeth
>            Assignee: Bilwa S T
>            Priority: Minor
>
> Some tests are too verbose: 
> - add / delete / remove queues testcases: Creating SchedConfUpdateInfo 
> instances could be simplified with a helper method or something like that.
> - Some fields can be converted to local variables: sysOutStream, sysOut, 
> sysErr, csConf
> - Any additional cleanup



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to