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 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 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)); }
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)); }
public void testAppendInlineReplyCreatesInlineThread() { ConversationBlip blip = target.getRootThread().appendBlip(); MutableDocument<?, ?, ?> doc = blip.getContent(); int location = locateAfterLineElement(doc); ConversationThread thread = blip.addReplyThread(location); assertSame(blip, thread.getParentBlip()); assertEquals(Collections.singletonList(LocatedReplyThread.of(thread, location)), blip.locateReplyThreads()); assertThreadChildrenConsistent(blip); }
public void testAppendInlineReplyCreatesInlineThread() { ConversationBlip blip = target.getRootThread().appendBlip(); MutableDocument<?, ?, ?> doc = blip.getContent(); int location = locateAfterLineElement(doc); ConversationThread thread = blip.addReplyThread(location); assertSame(blip, thread.getParentBlip()); assertEquals(Collections.singletonList(LocatedReplyThread.of(thread, location)), blip.locateReplyThreads()); assertThreadChildrenConsistent(blip); }
public void testAppendRepliesAppendsRepliesToBlip() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread t1 = blip.addReplyThread(); // Append blips to get a new ID for the next thread. t1.appendBlip(); ConversationThread t2 = blip.addReplyThread(); t2.appendBlip(); ConversationThread t3 = blip.addReplyThread(); t3.appendBlip(); assertSame(blip, t1.getParentBlip()); assertEquals(Arrays.asList(t1, t2, t3), CollectionUtils.newArrayList(blip.getReplyThreads())); assertThreadChildrenConsistent(blip); }
public void testAppendRepliesAppendsRepliesToBlip() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread t1 = blip.addReplyThread(); // Append blips to get a new ID for the next thread. t1.appendBlip(); ConversationThread t2 = blip.addReplyThread(); t2.appendBlip(); ConversationThread t3 = blip.addReplyThread(); t3.appendBlip(); assertSame(blip, t1.getParentBlip()); assertEquals(Arrays.asList(t1, t2, t3), CollectionUtils.newArrayList(blip.getReplyThreads())); assertThreadChildrenConsistent(blip); }
public void testEmptyRootThreadHasNoBlips() { assertNotNull(target.getRootThread()); assertSame(target, target.getRootThread().getConversation()); assertNull(target.getRootThread().getFirstBlip()); assertNull(target.getRootThread().getParentBlip()); }
public void testEmptyRootThreadHasNoBlips() { assertNotNull(target.getRootThread()); assertSame(target, target.getRootThread().getConversation()); assertNull(target.getRootThread().getFirstBlip()); assertNull(target.getRootThread().getParentBlip()); }