lib/src/test/java/edu/utexas/tacc/tapis/files/lib/clients/ITestIrodsClient.java
@Test
    public void testGetBytesByRangeOutOfBounds() throws Exception {
        int fileSize = 20;
        int byteCount = 200;
        IrodsDataClient client = new IrodsDataClient("dev", "dev", system);
        byte[] input = Utils.makeFakeFile(fileSize).readAllBytes();
        Assert.assertEquals(input.length, fileSize);
        client.insert("/a/b/c/test.txt", new ByteArrayInputStream(input));
        try (InputStream stream = client.getBytesByRange("/a/b/c/test.txt", 30, byteCount)) {
            byte[] output = IOUtils.toByteArray(stream);
            Assert.assertEquals(output.length, 0);
        }
    }
/**
     * This should check for the case when the startByte is greater than the length of
     * the actual file, which *should* return an empty array
     * @throws Exception
     */
This should check for the case when the startByte is greater than the length of
the actual file, which *should* return an empty array
@throws Exception
This should check for the case when the startByte is greater than the length of the actual file which * should * return an empty array @throws Exception
@Test
    public void testGetBytesByRangeOutOfBounds() throws Exception {
        int fileSize = 20;
        int byteCount = 200;
        IrodsDataClient client = new IrodsDataClient("dev", "dev", system);
        byte[] input = Utils.makeFakeFile(fileSize).readAllBytes();
        Assert.assertEquals(input.length, fileSize);
        client.insert("/a/b/c/test.txt", new ByteArrayInputStream(input));
        try (InputStream stream = client.getBytesByRange("/a/b/c/test.txt", 30, byteCount)) {
            byte[] output = IOUtils.toByteArray(stream);
            Assert.assertEquals(output.length, 0);
        }
    }
@ Test public void testGetBytesByRangeOutOfBounds ( ) throws Exception { int fileSize = 20 ; int byteCount = 200 ; IrodsDataClient client = new IrodsDataClient ( "dev" , "dev" , system ) ; byte [ ] input = Utils . makeFakeFile ( fileSize ) . readAllBytes ( ) ; Assert . assertEquals ( input . length , fileSize ) ; client . insert ( "/a/b/c/test.txt" , new ByteArrayInputStream ( input ) ) ; try ( InputStream stream = client . getBytesByRange ( "/a/b/c/test.txt" , 30 , byteCount ) ) { byte [ ] output = IOUtils . toByteArray ( stream ) ; Assert . assertEquals ( output . length , 0 ) ; } }
This should check for the case when the startByte is greater than the length of
 the actual file, which *should* return an empty array
 @throws Exception
This should check for the case when the startByte is greater than the length of the actual file which * should * return an empty array @throws Exception