[ 
https://issues.apache.org/jira/browse/HDFS-11011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mingliang Liu updated HDFS-11011:
---------------------------------
    Attachment: HDFS-11011.004.patch

The v3 patch looks good to me overall.

{code}
1454            new String[] {
1455                "It should be one line error message like:"
1456                    + " clrSpaceQuota...Access denied for user...",
1457                "clrSpaceQuota",
1458                "Access denied for user"});
{code}
For var args, we don't need to construct the String[] every time. Just pass as 
many parameters as we wish.

{code:title= runAndVerifyQuota()}
...
1539        /* verify outputs */
1540        scanIntoList(ioBuf, outs);
1541        assertEquals(msgs[0], expectedOutNum, outs.size());
1542        if (expectedOutNum > 0) {
1543          assertThat(outs.get(0),
1544              is(allOf(containsString(msgs[1]),
1545                  containsString(msgs[2]))));
1546        }
1547      }
{code}
This indicates that if {{expectedOutNum}} is greater than zero, the {{msgs}} 
will always have at least three parameters. This is error-prone to use. 
Meanwhile, the first string aka {{msg\[0\]}} is the assertEquals failing 
message, different from other msgs. Let's split them.

I updated the patch slightly and upload a v4 version. Can you review that, 
[~xiaobingo]? Thanks,

> Add unit tests for HDFS command 'dfsadmin -set/clrSpaceQuota'
> -------------------------------------------------------------
>
>                 Key: HDFS-11011
>                 URL: https://issues.apache.org/jira/browse/HDFS-11011
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>              Labels: fs, shell, test
>         Attachments: HDFS-11011.000.patch, HDFS-11011.001.patch, 
> HDFS-11011.002.patch, HDFS-11011.003.patch, HDFS-11011.004.patch
>
>
> This proposes adding a bunch of unit tests for command  'dfsadmin 
> setSpaceQuota' and  'dfsadmin clrSpaceQuota'.
> 1. test to set space quote using negative number.
> 2. test to set and clear space quote, regular usage.
> 3. test to set and clear space quote by storage type.
> 4. test to set and clear space quote when directory doesn't exist.
> 5. test to set and clear space quote when path is a file.
> 6. test to set and clear space quote when user has no access right.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to