hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uma Maheswara Rao G (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-2116) Cleanup TestStreamFile and TestByteRangeInputStream
Date Sat, 16 Jul 2011 06:56:00 GMT

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

Uma Maheswara Rao G commented on HDFS-2116:
-------------------------------------------

Hi Plamen,

Hudson result shows many -1s. Can you please check them?

There are some more comments to address.

TestByteRangeInputStream.java :

1. unecessary commented code is there. Can you please remove ?

 {code}
  //class MockURL extends URLOpener {
//  String msg;
//  public int responseCode = -1;
//  
//  public MockURL(URL u) {
//    super(u);
//  }
//
//  public MockURL(String s) throws MalformedURLException {
//    this(new URL(s));
//  }
//.............
//.............
..............
 {code}

 2.There is one unncessary supress warning tag present. 
   @SuppressWarnings("hiding")

 3. what is the purpose of below  assertion? 

    {code}
    rspy.setURL(new URL("http://resolvedur1/"));
    
    is.seek(100);
    is.read();

    assertEquals("Seek to 100 bytes made incorrectly (URL Check)",
        "http://resolvedurl/", rspy.getURL().toString());
    {code}
     
     Here whatever URL you set, your assertion will pass. Looks you are returning hardcoded
URL.


   {code}
     
    public URL getURL() {
    URL u = null;
    try {
      u = new URL("http://resolvedurl/");
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }
    return u;
  }
  {code}

TestStreamFile.java :

  1. Looks there are unnecessary suppressWarnings tags.

  2. Mockito.verify(response, Mockito.times(1)).setStatus(416);

  Here you can remove  Mockito.times(1)

  {code}Mockito.verify(response).setStatus(416); {code}whihch is equivalent to {code}Mockito.verify(response,
Mockito.times(1)).setStatus(416);{code}
     

> Cleanup TestStreamFile and TestByteRangeInputStream 
> ----------------------------------------------------
>
>                 Key: HDFS-2116
>                 URL: https://issues.apache.org/jira/browse/HDFS-2116
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Eli Collins
>            Priority: Minor
>              Labels: newbie
>         Attachments: HDFS-2116.patch, HDFS-2116.patch
>
>
> TestStreamFile and TestByteRangeInputStream should use mockito. This would allow the
private URLOpener class to be removed from ByteRangeInputStream. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message