/** * Tests that empty threads are not ignored. */ public void testCreateWithEmptyManifestThreadNotIgnored() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread thread = blip.addReplyThread(); WaveletBasedConversation another = mirrorConversation(target); assertNotNull(another.getRootThread().getFirstBlip()); assertTrue(another.getRootThread().getFirstBlip().getReplyThreads().iterator().hasNext()); }
/** * Tests that empty threads are not ignored. */ public void testCreateWithEmptyManifestThreadNotIgnored() { ConversationBlip blip = target.getRootThread().appendBlip(); ConversationThread thread = blip.addReplyThread(); WaveletBasedConversation another = mirrorConversation(target); assertNotNull(another.getRootThread().getFirstBlip()); assertTrue(another.getRootThread().getFirstBlip().getReplyThreads().iterator().hasNext()); }
/** * Asserts that a new conversation model built on top of the target * conversation's substrate matches the structure of that. */ private void assertMirrorConversationEquivalent() { Conversation copy = mirrorConversation(target); assertThreadsEquivalent(target.getRootThread(), copy.getRootThread()); }
public void testParticipantReadStateAffectedByWaveletReadStateWithBlip() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markAsRead(); }
public void testParticipantReadStateAffectedByWaveletReadStateWithBlip() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markAsRead(); }
public void testNewBlipIsUnread() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); assertTrue(supplement.isUnread(b)); }
public void testNewBlipIsUnread() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); assertTrue(supplement.isUnread(b)); }
public void testParticipantReadStateWithBlip() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markParticipantAsRead(c.getWavelet()); }
public void testAppendBlipsInRootThreadUpdatesManifest() { WaveletBasedConversationBlip first = target.getRootThread().appendBlip(); assertManifestXml("<blip id=\"" + first.getId() + "\"></blip>"); WaveletBasedConversationBlip second = target.getRootThread().appendBlip(); assertManifestXml("<blip id=\"" + first.getId() + "\"></blip>" + "<blip id=\"" + second.getId() + "\"></blip>"); assertMirrorConversationEquivalent(); }
public void testMarkBlipAsReadAffectsBlipReadState() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markAsRead(b); assertFalse(supplement.isUnread(b)); }
public void testMarkBlipAsReadAffectsBlipReadState() { WaveletBasedConversation c = setUpWithWaveModel(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markAsRead(b); assertFalse(supplement.isUnread(b)); }
public void testAbstractBlipIdMatchesConcreteBlipId() { populate(target); WaveletBasedConversationBlip convBlip = target.getRootThread().getFirstBlip(); assertEquals(convBlip.getId(), convBlip.getBlip().getId()); }
/** * Tests copying of a wavelet with a single blip containing some content. */ public void testSingleBlip() { WaveletBasedConversationBlip blip = source.getRootThread().appendBlip(); Document doc = blip.getContent(); LineContainers.appendToLastLine(doc, XmlStringBuilder.createText(SAMPLE_TEXT)); ConversationCopier.copyWaveletContents(sourceWavelet, destWavelet); compareWavelets(sourceWavelet, destWavelet); }
public void testAbstractBlipIdMatchesConcreteBlipId() { populate(target); WaveletBasedConversationBlip convBlip = target.getRootThread().getFirstBlip(); assertEquals(convBlip.getId(), convBlip.getBlip().getId()); }
public void testDeleteBlipNoRepliesUpdatesManifest() { WaveletBasedConversationBlip blip = target.getRootThread().appendBlip(); blip.delete(); assertManifestXml(""); assertStructureEquivalent(XmlStringBuilder.createEmpty(), blip.getContent()); assertMirrorConversationEquivalent(); }
public void testDeleteBlipNoRepliesUpdatesManifest() { WaveletBasedConversationBlip blip = target.getRootThread().appendBlip(); blip.delete(); assertManifestXml(""); assertStructureEquivalent(XmlStringBuilder.createEmpty(), blip.getContent()); assertMirrorConversationEquivalent(); }
/** * Tests copying of a wavelet with a root thread and a reply thread. */ public void testReplyThreadCopy() { WaveletBasedConversationBlip blip = source.getRootThread().appendBlip(); WaveletBasedConversationThread conversationThread = blip.addReplyThread(); Document doc = conversationThread.appendBlip().getContent(); LineContainers.appendToLastLine(doc, XmlStringBuilder.createText(SAMPLE_TEXT)); ConversationCopier.copyWaveletContents(sourceWavelet, destWavelet); compareWavelets(sourceWavelet, destWavelet); }
/** * Tests copying of a wavelet with a root thread and a reply thread. */ public void testReplyThreadCopy() { WaveletBasedConversationBlip blip = source.getRootThread().appendBlip(); WaveletBasedConversationThread conversationThread = blip.addReplyThread(); Document doc = conversationThread.appendBlip().getContent(); LineContainers.appendToLastLine(doc, XmlStringBuilder.createText(SAMPLE_TEXT)); ConversationCopier.copyWaveletContents(sourceWavelet, destWavelet); compareWavelets(sourceWavelet, destWavelet); }
public void testGetBlipRetrievesBlip() { WaveletBasedConversationBlip blip = target.getRootThread().appendBlip(); WaveletBasedConversationThread reply = blip.addReplyThread(); WaveletBasedConversationBlip replyBlip = reply.appendBlip(); assertSame(blip, target.getBlip(blip.getId())); assertSame(replyBlip, target.getBlip(replyBlip.getId())); assertNull(target.getBlip("foobar")); }
public void testGetBlipRetrievesBlip() { WaveletBasedConversationBlip blip = target.getRootThread().appendBlip(); WaveletBasedConversationThread reply = blip.addReplyThread(); WaveletBasedConversationBlip replyBlip = reply.appendBlip(); assertSame(blip, target.getBlip(blip.getId())); assertSame(replyBlip, target.getBlip(replyBlip.getId())); assertNull(target.getBlip("foobar")); }