public class TestFileChannelUtility
extends junit.framework.TestCase
FileChannelUtility
.Constructor and Description |
---|
TestFileChannelUtility() |
TestFileChannelUtility(String arg0) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertSameData(byte[] expected,
byte[] actual) |
protected void |
doReadTest(int ntrials,
byte[] expected,
RandomAccessFile raf)
Verify
FileChannelUtility.readAll(FileChannel, ByteBuffer, long)
using a file that the caller has pre-written and a byte[] containing the
ground truth data for that file. |
protected int |
getRandomLength(RandomAccessFile raf,
long pos)
Choose #of bytes for the an operation which is no more bytes than exist
from that position to the end of the file but up to 4 times the capacity
of the direct buffers in use by the pool (and no more than
Integer.MAX_VALUE bytes regardless).
|
protected long |
getRandomPosition(RandomAccessFile raf)
Start at any position in the source file (up to int32 offset).
|
void |
no_testAsyncReadersCancelled() |
void |
no_testAsyncReadersCloseChannel() |
protected void |
setUp() |
protected void |
tearDown() |
void |
test_oneTrial_readAll_writeAll()
A single trial testing the behavior of readAll() and writeAll()
|
void |
test_readAll_writeAll()
A sequence of trials testing the behavior of readAll() and writeAll().
|
void |
test_transferAllFrom()
Test of
FileChannelUtility#transferAll(FileChannel, long, long, RandomAccessFile)
on 20M of random data using a bunch of transfer of different sizes from
different positions in the source file. |
void |
testReopenerInputStream() |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
public TestFileChannelUtility()
public TestFileChannelUtility(String arg0)
arg0
- protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
protected long getRandomPosition(RandomAccessFile raf) throws IOException
IOException
protected int getRandomLength(RandomAccessFile raf, long pos) throws IOException
pos
- A position within that file.IOException
protected void assertSameData(byte[] expected, byte[] actual)
public void test_oneTrial_readAll_writeAll() throws IOException
IOException
public void test_readAll_writeAll() throws IOException
IOException
protected void doReadTest(int ntrials, byte[] expected, RandomAccessFile raf) throws IOException
FileChannelUtility.readAll(FileChannel, ByteBuffer, long)
using a file that the caller has pre-written and a byte[] containing the
ground truth data for that file.expected
- The ground truth data.raf
- A file pre-written with that ground truth data.IOException
public void test_transferAllFrom() throws IOException
FileChannelUtility#transferAll(FileChannel, long, long, RandomAccessFile)
on 20M of random data using a bunch of transfer of different sizes from
different positions in the source file.IOException
public void testReopenerInputStream() throws IOException, InterruptedException
IOException
InterruptedException
public void no_testAsyncReadersCancelled() throws IOException, InterruptedException
IOException
InterruptedException
public void no_testAsyncReadersCloseChannel() throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.