add UT for testing multiple files for different days
This commit is contained in:
@@ -48,4 +48,26 @@ public class TagsToFilesTest {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void testMultipleFilesForTag() throws Exception {
|
||||
|
||||
try (H2DB db = new H2DB(new File(dataDirectory.toFile(), "lu.db"))) {
|
||||
db.createField(Fields.DATE_OFFSET, FieldType.STRING);
|
||||
|
||||
final TagsToFile tagsToFile = new TagsToFile(dataDirectory, db);
|
||||
|
||||
final OffsetDateTime day1 = DateUtils.getDate(2016, 1, 1, 1, 1, 1);
|
||||
final OffsetDateTime day2 = DateUtils.getDate(2016, 1, 2, 1, 1, 1);
|
||||
|
||||
final Tags tags = Tags.create("myKey", "myValue");
|
||||
|
||||
final PdbFile fileForDay1 = tagsToFile.getFile(day1, tags);
|
||||
final PdbFile fileForDay2 = tagsToFile.getFile(day2, tags);
|
||||
|
||||
Assert.assertNotEquals(fileForDay1, fileForDay2);
|
||||
|
||||
final PdbFile existingFileForDay1 = tagsToFile.getFile(day1, tags);
|
||||
Assert.assertEquals(fileForDay1, existingFileForDay1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user