Skip to content

Commit

Permalink
Added Null pointer check in teardown of ReadOnlyStorageEngineTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Soman committed Apr 15, 2013
1 parent 4b1557b commit db6ac44
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/unit/voldemort/store/readonly/ReadOnlyStorageEngineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public ReadOnlyStorageEngineTest(SearchStrategy strategy, ReadOnlyStorageFormat

@After
public void tearDown() {
Utils.rm(dir);
if(dir != null) {
Utils.rm(dir);
}
}

/**
Expand Down Expand Up @@ -613,10 +615,12 @@ private void createStoreFiles(File dir, int indexBytes, int dataBytes, Node node
case READONLY_V1: {
for(Integer partitionId: node.getPartitionIds()) {
for(int chunkId = 0; chunkId < numChunks; chunkId++) {
File index = createFile(dir, Integer.toString(partitionId) + "_"
+ Integer.toString(chunkId) + ".index");
File data = createFile(dir, Integer.toString(partitionId) + "_"
+ Integer.toString(chunkId) + ".data");
File index = createFile(dir,
Integer.toString(partitionId) + "_"
+ Integer.toString(chunkId) + ".index");
File data = createFile(dir,
Integer.toString(partitionId) + "_"
+ Integer.toString(chunkId) + ".data");
// write some random crap for index and data
FileOutputStream dataOs = new FileOutputStream(data);
for(int i = 0; i < dataBytes; i++)
Expand All @@ -637,8 +641,9 @@ private void createStoreFiles(File dir, int indexBytes, int dataBytes, Node node
for(int chunkId = 0; chunkId < numChunks; chunkId++) {
File index = createFile(dir, Integer.toString(partitionId) + "_0_"
+ Integer.toString(chunkId) + ".index");
File data = createFile(dir, Integer.toString(partitionId) + "_0_"
+ Integer.toString(chunkId) + ".data");
File data = createFile(dir,
Integer.toString(partitionId) + "_0_"
+ Integer.toString(chunkId) + ".data");
// write some random crap for index and data
FileOutputStream dataOs = new FileOutputStream(data);
for(int i = 0; i < dataBytes; i++)
Expand Down

0 comments on commit db6ac44

Please sign in to comment.