public void testWorthynessConstant() { assertEquals(Blips.THREAD_INLINE_ANCHOR_TAGNAME, WorthyChangeChecker.THREAD_INLINE_ANCHOR_TAGNAME); }
public void testWorthynessConstant() { assertEquals(Blips.THREAD_INLINE_ANCHOR_TAGNAME, WorthyChangeChecker.THREAD_INLINE_ANCHOR_TAGNAME); }
public void testAddedParticipantIsRetreived() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); assertEquals(Arrays.asList(creator, fake), CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testAddedParticipantIsRetreived() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); assertEquals(Arrays.asList(creator, fake), CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testRemovedParticipantNoLongerRetrieved() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); target.removeParticipant(fake); assertEquals(Collections.singletonList(creator), CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testRemovedParticipantNoLongerRetrieved() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); target.removeParticipant(fake); assertEquals(Collections.singletonList(creator), CollectionUtils.newArrayList(target.getParticipantIds())); }
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 testParticipantsAreASet() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake1 = new ParticipantId("joe"); ParticipantId fake2 = new ParticipantId("bill"); List<ParticipantId> participants = CollectionUtils.newArrayList(creator, fake1, fake2); target.addParticipant(fake1); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testParticipantsAreASet() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake1 = new ParticipantId("joe"); ParticipantId fake2 = new ParticipantId("bill"); List<ParticipantId> participants = CollectionUtils.newArrayList(creator, fake1, fake2); target.addParticipant(fake1); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); }
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 testSetAnchor() { populate(alternate); ConversationBlip blip = getFirstBlip(alternate); Anchor anchor = alternate.createAnchor(blip); target.setAnchor(anchor); assertTrue(target.hasAnchor()); assertEquals(anchor, target.getAnchor()); }
public void testSetAnchor() { populate(alternate); ConversationBlip blip = getFirstBlip(alternate); Anchor anchor = alternate.createAnchor(blip); target.setAnchor(anchor); assertTrue(target.hasAnchor()); assertEquals(anchor, target.getAnchor()); }
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 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 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); }
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 testAnchorStillAccessibleAfterBlipAdded() { populate(alternate); ConversationBlip blip = getFirstBlip(alternate); Anchor anchor = alternate.createAnchor(blip); target.setAnchor(anchor); target.getRootThread().appendBlip(); target.getRootThread().getFirstBlip().delete(); assertTrue(target.hasAnchor()); assertEquals(anchor, target.getAnchor()); }
public void testAnchorStillAccessibleAfterBlipAdded() { populate(alternate); ConversationBlip blip = getFirstBlip(alternate); Anchor anchor = alternate.createAnchor(blip); target.setAnchor(anchor); target.getRootThread().appendBlip(); target.getRootThread().getFirstBlip().delete(); assertTrue(target.hasAnchor()); assertEquals(anchor, target.getAnchor()); }