File file = createFile("helloworld", 170);
String nodeName = file.getName();
int chunkSize = 200;
// uplaod first chunk 200 bytes uploaded
uploadChunks(parentPath, file, nodeName, 0, chunkSize, 1);
JSONObject json = getChunkJson(parentPath + "/" + nodeName);
validate(json, 200, 1);
chunkSize = 300;
// upload next two chunks of 300 each.total 800 bytes
// uploaded
uploadChunks(parentPath, file, nodeName, 200, chunkSize, 2);
json = getChunkJson(parentPath + "/" + nodeName);
validate(json, 800, 3);
chunkSize = 400;
// upload two chunk of 400 each. total 1600 bytes and 5 chunks
// uploaded
uploadChunks(parentPath, file, nodeName,
json.getInt(SlingPostConstants.NT_SLING_CHUNKS_LENGTH),
chunkSize, 2);
json = getChunkJson(parentPath + "/" + nodeName);
validate(json, 1600, 5);
chunkSize = 500;
uploadChunks(parentPath, file, nodeName,
json.getInt(SlingPostConstants.NT_SLING_CHUNKS_LENGTH),
chunkSize, Integer.MAX_VALUE);
HttpResponse response = httpGet(parentPath + "/" + nodeName);
InputStream fis = new FileInputStream(file);
Assert.assertEquals("content stream doesn't match", true,