Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,19 @@ public void testPreExecute() throws Exception {

@Test
public void testValidateAndUpdateCache() throws Exception {

OMRequest modifiedOmRequest =
doPreExecute(createAllocateBlockRequest());

OMAllocateBlockRequest omAllocateBlockRequest =
new OMAllocateBlockRequest(modifiedOmRequest);


// Add volume, bucket, key entries to DB.
TestOMRequestUtils.addVolumeAndBucketToDB(volumeName, bucketName,
omMetadataManager);

TestOMRequestUtils.addKeyToTable(true, volumeName, bucketName, keyName,
clientID, replicationType, replicationFactor, omMetadataManager);

OMRequest modifiedOmRequest =
doPreExecute(createAllocateBlockRequest());

OMAllocateBlockRequest omAllocateBlockRequest =
new OMAllocateBlockRequest(modifiedOmRequest);

// Check before calling validateAndUpdateCache. As adding DB entry has
// not added any blocks, so size should be zero.

Expand Down Expand Up @@ -97,8 +95,12 @@ public void testValidateAndUpdateCache() throws Exception {
// Check modification time
Assert.assertEquals(modifiedOmRequest.getAllocateBlockRequest()
.getKeyArgs().getModificationTime(), omKeyInfo.getModificationTime());
Assert.assertNotEquals(omKeyInfo.getCreationTime(),
omKeyInfo.getModificationTime());

// creationTime was assigned at TestOMRequestUtils.addKeyToTable
// modificationTime was assigned at
// doPreExecute(createAllocateBlockRequest())
Assert.assertTrue(
omKeyInfo.getCreationTime() <= omKeyInfo.getModificationTime());

// Check data of the block
OzoneManagerProtocolProtos.KeyLocation keyLocation =
Expand Down