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

Haohui Mai commented on HDFS-5866:
----------------------------------

It seems to me that the unit test only needs to test whether it accepts the 
command line.

I suggest moving the code from the {{main()}} function into a {{run()}} 
function, which returns an integer as a status code. Then the unit test can 
looks like this:

{code}
int status = OfflineImageViewerPB.run(new String[] { "-i", 
originalFsImage.getAbsolutePath(), "-o", "-", "-p", "FileDistribution", 
"-maxSize", "512", "-step", "8"});
Assert.assertEquals(0, status);
{code}


> '-maxSize' and '-step' option fail in OfflineImageViewer
> --------------------------------------------------------
>
>                 Key: HDFS-5866
>                 URL: https://issues.apache.org/jira/browse/HDFS-5866
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: tools
>    Affects Versions: 3.0.0, 2.2.0
>            Reporter: Akira AJISAKA
>            Assignee: Akira AJISAKA
>         Attachments: HDFS-5866.2.patch, HDFS-5866.3.patch, HDFS-5866.patch
>
>
> Executing -step or/and -maxSize option will get the following error:
> {code}
> $ hdfs oiv -p FileDistribution -step 102400 -i input -o output
> Error parsing command-line options:
> Usage: bin/hdfs oiv [OPTIONS] -i INPUTFILE -o OUTPUTFILE
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to