public void testInsertBlipBetweenBlipsInserts() { ConversationThread thread = target.getRootThread(); ConversationBlip first = thread.appendBlip(); ConversationBlip last = thread.appendBlip(); ConversationBlip middle = thread.insertBlip(last); assertEquals(Arrays.asList(first, middle, last), getBlipList(thread)); }
public void testInsertBlipBetweenBlipsInserts() { ConversationThread thread = target.getRootThread(); ConversationBlip first = thread.appendBlip(); ConversationBlip last = thread.appendBlip(); ConversationBlip middle = thread.insertBlip(last); assertEquals(Arrays.asList(first, middle, last), getBlipList(thread)); }
public void testDeleteBlipInThreadLeavesSiblings() { ConversationBlip b1 = target.getRootThread().appendBlip(); ConversationBlip b2 = target.getRootThread().appendBlip(); ConversationBlip b3 = target.getRootThread().appendBlip(); b2.delete(); assertEquals(Arrays.asList(b1, b3), getBlipList(target.getRootThread())); b1.delete(); assertEquals(Arrays.asList(b3), getBlipList(target.getRootThread())); }
public void testDeleteBlipInThreadLeavesSiblings() { ConversationBlip b1 = target.getRootThread().appendBlip(); ConversationBlip b2 = target.getRootThread().appendBlip(); ConversationBlip b3 = target.getRootThread().appendBlip(); b2.delete(); assertEquals(Arrays.asList(b1, b3), getBlipList(target.getRootThread())); b1.delete(); assertEquals(Arrays.asList(b3), getBlipList(target.getRootThread())); }
public void testDeleteSingleNonRootThreadBlipRemovesIt() { ConversationThread thread = target.getRootThread().appendBlip().addReplyThread(); ConversationBlip unDeleted = thread.appendBlip(); ConversationBlip blip = thread.appendBlip(); blip.delete(); assertEquals(Arrays.asList(unDeleted), getBlipList(thread)); assertBlipInvalid(blip); }
public void testDeleteSingleNonRootThreadBlipRemovesIt() { ConversationThread thread = target.getRootThread().appendBlip().addReplyThread(); ConversationBlip unDeleted = thread.appendBlip(); ConversationBlip blip = thread.appendBlip(); blip.delete(); assertEquals(Arrays.asList(unDeleted), getBlipList(thread)); assertBlipInvalid(blip); }
/** * Tests that methods which access the state of a blip without changing it * are correct after blip deletion. */ public void testBlipCanBeAccessedAfterDeletion() { ConversationBlip blip = target.getRootThread().appendBlip(); blip.delete(); assertBlipInvalid(blip); assertBlipAccessible(blip); assertEquals(target.getRootThread(), blip.getThread()); assertEquals(Collections.emptyList(), getBlipList(target.getRootThread())); assertEquals(Collections.emptyList(), getAllReplyList(blip)); }
/** * Tests that methods which access the state of a blip without changing it * are correct after blip deletion. */ public void testBlipCanBeAccessedAfterDeletion() { ConversationBlip blip = target.getRootThread().appendBlip(); blip.delete(); assertBlipInvalid(blip); assertBlipAccessible(blip); assertEquals(target.getRootThread(), blip.getThread()); assertEquals(Collections.emptyList(), getBlipList(target.getRootThread())); assertEquals(Collections.emptyList(), getAllReplyList(blip)); }
public void testInsetBlipBeforeFirstBlipCreatesNewFirstBlip() { ConversationThread thread = target.getRootThread(); ConversationBlip oldFirst = thread.appendBlip(); ConversationBlip newFirst = thread.insertBlip(oldFirst); assertSame(thread.getFirstBlip(), newFirst); assertSame(newFirst, target.getBlip(newFirst.getId())); assertSame(oldFirst, target.getBlip(oldFirst.getId())); assertEquals(Arrays.asList(newFirst, oldFirst), getBlipList(thread)); }
/** * Tests that methods which access the state of a thread without changing it * are correct after thread deletion. */ public void testThreadCanBeAccessedAfterDeletion() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread thread = blip.addReplyThread(); ConversationBlip replyBlip = thread.appendBlip(); thread.delete(); assertBlipInvalid(replyBlip); assertBlipAccessible(replyBlip); assertThreadInvalid(thread); assertThreadAccessible(thread); assertEquals(blip, thread.getParentBlip()); assertFalse(blip.getReplyThreads().iterator().hasNext()); assertEquals(thread, replyBlip.getThread()); assertEquals(Collections.emptyList(), getBlipList(thread)); }
public void testInsetBlipBeforeFirstBlipCreatesNewFirstBlip() { ConversationThread thread = target.getRootThread(); ConversationBlip oldFirst = thread.appendBlip(); ConversationBlip newFirst = thread.insertBlip(oldFirst); assertSame(thread.getFirstBlip(), newFirst); assertSame(newFirst, target.getBlip(newFirst.getId())); assertSame(oldFirst, target.getBlip(oldFirst.getId())); assertEquals(Arrays.asList(newFirst, oldFirst), getBlipList(thread)); }
/** * Tests that methods which access the state of a thread without changing it * are correct after thread deletion. */ public void testThreadCanBeAccessedAfterDeletion() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread thread = blip.addReplyThread(); ConversationBlip replyBlip = thread.appendBlip(); thread.delete(); assertBlipInvalid(replyBlip); assertBlipAccessible(replyBlip); assertThreadInvalid(thread); assertThreadAccessible(thread); assertEquals(blip, thread.getParentBlip()); assertFalse(blip.getReplyThreads().iterator().hasNext()); assertEquals(thread, replyBlip.getThread()); assertEquals(Collections.emptyList(), getBlipList(thread)); }
public void testDeleteRootThreadRemovesAllBlips() { ConversationThread rootThread = target.getRootThread(); ConversationBlip first = rootThread.appendBlip(); ConversationBlip second = rootThread.appendBlip(); rootThread.delete(); assertBlipInvalid(first); assertBlipInvalid(second); assertEquals(CollectionUtils.newArrayList(), getBlipList(rootThread)); assertThreadValid(rootThread); }
/** * Tests that methods which access the state of a blip (this time with a * child thread) without changing it are correct after blip deletion. */ public void testBlipWithThreadCanBeAccessedAfterDeletion() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread thread = blip.addReplyThread(); blip.delete(); assertBlipInvalid(blip); assertBlipAccessible(blip); assertEquals(target.getRootThread(), blip.getThread()); assertEquals(Collections.emptyList(), getBlipList(target.getRootThread())); assertEquals(blip, thread.getParentBlip()); assertEquals(Collections.emptyList(), getAllReplyList(blip)); }
public void testAppendBlipAppendsBlipsToThread() { ConversationThread thread = target.getRootThread(); ConversationBlip b1 = thread.appendBlip(); ConversationBlip b2 = thread.appendBlip(); ConversationBlip b3 = thread.appendBlip(); assertSame(b1, thread.getFirstBlip()); assertSame(target, b1.getConversation()); assertSame(thread, b1.getThread()); assertSame(b1, target.getBlip(b1.getId())); assertEquals(Arrays.asList(b1, b2, b3), getBlipList(thread)); }
public void testDeleteRootThreadRemovesAllBlips() { ConversationThread rootThread = target.getRootThread(); ConversationBlip first = rootThread.appendBlip(); ConversationBlip second = rootThread.appendBlip(); rootThread.delete(); assertBlipInvalid(first); assertBlipInvalid(second); assertEquals(CollectionUtils.newArrayList(), getBlipList(rootThread)); assertThreadValid(rootThread); }
/** * Tests that methods which access the state of a blip (this time with a * child thread) without changing it are correct after blip deletion. */ public void testBlipWithThreadCanBeAccessedAfterDeletion() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread thread = blip.addReplyThread(); blip.delete(); assertBlipInvalid(blip); assertBlipAccessible(blip); assertEquals(target.getRootThread(), blip.getThread()); assertEquals(Collections.emptyList(), getBlipList(target.getRootThread())); assertEquals(blip, thread.getParentBlip()); assertEquals(Collections.emptyList(), getAllReplyList(blip)); }
public void testAppendBlipAppendsBlipsToThread() { ConversationThread thread = target.getRootThread(); ConversationBlip b1 = thread.appendBlip(); ConversationBlip b2 = thread.appendBlip(); ConversationBlip b3 = thread.appendBlip(); assertSame(b1, thread.getFirstBlip()); assertSame(target, b1.getConversation()); assertSame(thread, b1.getThread()); assertSame(b1, target.getBlip(b1.getId())); assertEquals(Arrays.asList(b1, b2, b3), getBlipList(thread)); }