Test for versioned input streams. More...
Public Member Functions | |
void | testCCNVersionedInputStreamContentNameLongPublisherKeyIDCCNLibrary () throws Exception |
void | testCCNVersionedInputStreamContentNamePublisherKeyIDCCNLibrary () throws Exception |
void | testCCNVersionedInputStreamContentName () throws Exception |
void | testCCNVersionedInputStreamContentNameCCNLibrary () throws Exception |
void | testCCNVersionedInputStreamContentNameInt () throws Exception |
void | testCCNVersionedInputStreamContentObjectCCNLibrary () throws Exception |
void | testReadByteArray () throws Exception |
void | testReadProblematicLengths () throws Exception |
Static Public Member Functions | |
static void | setUpBeforeClass () throws Exception |
static void | cleanupAfterClass () |
static byte[] | writeFileFloss (ContentName completeName, int fileLength, Random randBytes) throws IOException, NoSuchAlgorithmException |
Trick to get around lack of repo. | |
static void | startReader (final ContentName completeName, final int fileLength) |
static byte[] | readFile (ContentName completeName, int fileLength) throws IOException |
static byte[] | readFile (InputStream inputStream, int fileLength) throws IOException |
Protected Member Functions | |
void | testArgumentRunner (CCNVersionedInputStream vfirst, CCNVersionedInputStream vlatest) throws Exception |
Static Package Attributes | |
static ContentName | defaultStreamName |
static ContentName | firstVersionName |
static int | firstVersionLength |
static int | firstVersionMaxSegment |
static byte[] | firstVersionDigest |
static ContentName | middleVersionName |
static int | middleVersionLength |
static int | middleVersionMaxSegment |
static byte[] | middleVersionDigest |
static ContentName | latestVersionName |
static int | latestVersionLength |
static int | latestVersionMaxSegment |
static byte[] | latestVersionDigest |
static CCNHandle | outputHandle |
static CCNHandle | inputHandle |
static CCNHandle | inputHandle2 |
static CCNReader | reader |
static final int | MAX_FILE_SIZE = 1024*1024 |
static final int | BUF_SIZE = 4096 |
static final int | MERKLE_TREE_LENGTH = SegmentationProfile.DEFAULT_BLOCKSIZE * CCNOutputStream.BLOCK_BUF_COUNT |
static int[] | problematicLengths |
static byte[][] | problematicDigests = new byte[problematicLengths.length][] |
static ContentName[] | problematicNames = new ContentName[problematicLengths.length] |
static CCNTestHelper | testHelper = new CCNTestHelper(CCNVersionedInputStreamTest.class) |
Handle naming for the test. |
Test for versioned input streams.
Uses a slightly simpler mechanism to set up data in ccnd for the test, namely writing and simultaneously reading the data in the setupBeforeClass. That could be replaced by a Flosser.
static byte [] org.ccnx.ccn.test.io.CCNVersionedInputStreamTest.writeFileFloss | ( | ContentName | completeName, | |
int | fileLength, | |||
Random | randBytes | |||
) | throws IOException, NoSuchAlgorithmException [static] |
Trick to get around lack of repo.
We want the test below to read data out of ccnd. Problem is to do that, we have to get it into ccnd. This pre-loads ccnd with data by "flossing" it -- starting up a reader thread that will pull our generated data into ccnd for us, where it will wait till we read it back out.
completeName | ||
fileLength | ||
randBytes |
IOException | ||
NoSuchAlgorithmException |
int [] org.ccnx.ccn.test.io.CCNVersionedInputStreamTest.problematicLengths [static, package] |
{ SegmentationProfile.DEFAULT_BLOCKSIZE, SegmentationProfile.DEFAULT_BLOCKSIZE/2, SegmentationProfile.DEFAULT_BLOCKSIZE*2, ((int)(SegmentationProfile.DEFAULT_BLOCKSIZE*1.5)), ((int)(SegmentationProfile.DEFAULT_BLOCKSIZE*2.5)), MERKLE_TREE_LENGTH + SegmentationProfile.DEFAULT_BLOCKSIZE, MERKLE_TREE_LENGTH + SegmentationProfile.DEFAULT_BLOCKSIZE/2, MERKLE_TREE_LENGTH + SegmentationProfile.DEFAULT_BLOCKSIZE*2, MERKLE_TREE_LENGTH + ((int)(SegmentationProfile.DEFAULT_BLOCKSIZE*1.5)), MERKLE_TREE_LENGTH + ((int)(SegmentationProfile.DEFAULT_BLOCKSIZE*2.5))}