Package org.apache.hadoop.hdfs.TestByteRangeInputStream

Examples of org.apache.hadoop.hdfs.TestByteRangeInputStream.MockHttpURLConnection


    final Configuration conf = new Configuration();
    final String uri = WebHdfsFileSystem.SCHEME  + "://localhost:50070/";
    final WebHdfsFileSystem webhdfs = (WebHdfsFileSystem)FileSystem.get(new URI(uri), conf);

    OffsetUrlOpener ospy = spy(webhdfs.new OffsetUrlOpener(new URL("http://test/")));
    doReturn(new MockHttpURLConnection(ospy.getURL())).when(ospy)
        .openConnection();
    OffsetUrlOpener rspy = spy(webhdfs.new OffsetUrlOpener((URL) null));
    doReturn(new MockHttpURLConnection(rspy.getURL())).when(rspy)
        .openConnection();
    final OffsetUrlInputStream is = new OffsetUrlInputStream(ospy, rspy);

    assertEquals("getPos wrong", 0, is.getPos());
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.TestByteRangeInputStream.MockHttpURLConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.