Queue<NamespaceNotification> historyNotifications;
new Thread(history).start();
// Step 1 - test with FILE_ADDED
history.storeNotification(new NamespaceNotification("/a/b",
EventType.FILE_ADDED.getByteValue(), 10));
history.storeNotification(new NamespaceNotification("/a/c",
EventType.FILE_ADDED.getByteValue(), 11));
historyNotifications = new LinkedList<NamespaceNotification>();
history.addNotificationsToQueue(new NamespaceEvent("/a",
EventType.FILE_ADDED.getByteValue()), 10, historyNotifications);
Assert.assertEquals(1, historyNotifications.size());
Assert.assertEquals(11, historyNotifications.peek().txId);
Assert.assertEquals("/a/c", historyNotifications.peek().path);
// Step 2 - test with FILE_CLOSED
history.storeNotification(new NamespaceNotification("/a/d",
EventType.FILE_CLOSED.getByteValue(), 12));
history.storeNotification(new NamespaceNotification("/a/e",
EventType.FILE_CLOSED.getByteValue(), 13));
historyNotifications = new LinkedList<NamespaceNotification>();
history.addNotificationsToQueue(new NamespaceEvent("/a",
EventType.FILE_CLOSED.getByteValue()), 12, historyNotifications);
Assert.assertEquals(1, historyNotifications.size());