public void TODOtestTitleOperations() throws XTraceException {
if (!canTest) return;
/* Insert a single report into the file store */
TaskID taskId = new TaskID(8);
Report report = randomReport(new XTraceMetadata(taskId, 0));
fs.receiveReport(report.toString());
fs.sync();
/* Test that the title is the taskID (since no title field was given) */
assertEquals(taskId.toString(), fs.getLatestTasks(0, 1).get(0).getTitle());
assertEquals(1, fs.getTasksByTitle(taskId.toString(), 0, Integer.MAX_VALUE).size());
/* Insert another report in the same task, with no title */
report = randomReport(new XTraceMetadata(taskId, 1));
fs.receiveReport(report.toString());
fs.sync();
/* Test that the title is the taskID (since no title field was given) */
assertEquals(taskId.toString(), fs.getLatestTasks(0, 1).get(0).getTitle());
assertEquals(1, fs.getTasksByTitle(taskId.toString(), 0, Integer.MAX_VALUE).size());
/* Insert another report in the same task, with a title */
report = randomReport(new XTraceMetadata(taskId, 2));
report.put("Title", "title1");
fs.receiveReport(report.toString());
fs.sync();
/* Test that the title is title1 */
assertEquals("title1", fs.getLatestTasks(0, 1).get(0).getTitle());
assertEquals(0, fs.getTasksByTitle(taskId.toString(), 0, Integer.MAX_VALUE).size());
assertEquals(1, fs.getTasksByTitle("title1", 0, Integer.MAX_VALUE).size());
/* Insert another report in the same task, with another title */
report = randomReport(new XTraceMetadata(taskId, 3));
report.put("Title", "title2");
fs.receiveReport(report.toString());
fs.sync();
/* Test that the title is title1 */
assertEquals("title2", fs.getLatestTasks(0, 1).get(0).getTitle());
assertEquals(0, fs.getTasksByTitle(taskId.toString(), 0, Integer.MAX_VALUE).size());
assertEquals(0, fs.getTasksByTitle("title1", 0, Integer.MAX_VALUE).size());
assertEquals(1, fs.getTasksByTitle("title2", 0, Integer.MAX_VALUE).size());
assertEquals(1, fs.getTasksByTitleSubstring("title2", 0, Integer.MAX_VALUE).size());
assertEquals(1, fs.getTasksByTitleSubstring("itle", 0, Integer.MAX_VALUE).size());
assertEquals(1, fs.getTasksByTitleSubstring("t", 0, Integer.MAX_VALUE).size());