private static void sampleContent(Document d) { d.emptyElement(d.getDocumentElement()); d.appendXml(XmlStringBuilder.createFromXmlString("<body><line></line>Hello World</body>")); }
private static void sampleContent(Document d) { d.emptyElement(d.getDocumentElement()); d.appendXml(XmlStringBuilder.createFromXmlString("<body><line></line>Hello World</body>")); }
private static void write(ConversationBlip blip, String msg) { org.waveprotocol.wave.model.document.Document d = blip.getContent(); d.emptyElement(d.getDocumentElement()); d.appendXml(XmlStringBuilder.createFromXmlString("<body><line></line>" + msg + "</body>")); }
private static void write(ConversationBlip blip) { org.waveprotocol.wave.model.document.Document d = blip.getContent(); d.emptyElement(d.getDocumentElement()); d.appendXml(XmlStringBuilder.createFromXmlString("<body><line></line>Hello World</body>")); }
private static void write(ConversationBlip blip, String msg) { org.waveprotocol.wave.model.document.Document d = blip.getContent(); d.emptyElement(d.getDocumentElement()); d.appendXml(XmlStringBuilder.createFromXmlString("<body><line></line>" + msg + "</body>")); }
private static Conversation makeConversation() { IdGenerator idGenerator = FakeIdGenerator.create(); ObservableWaveView waveView = BasicFactories.fakeWaveViewBuilder().with(idGenerator).build(); ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator); Conversation conversation = convView.createRoot(); // Force empty document. ConversationBlip blip = conversation.getRootThread().appendBlip( new DocInitializationBuilder().build()); Document document = blip.getContent(); document.appendXml(Blips.INITIAL_BODY); return conversation; } }
private static Conversation makeConversation() { IdGenerator idGenerator = FakeIdGenerator.create(); ObservableWaveView waveView = BasicFactories.fakeWaveViewBuilder().with(idGenerator).build(); ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator); Conversation conversation = convView.createRoot(); // Force empty document. ConversationBlip blip = conversation.getRootThread().appendBlip( new DocInitializationBuilder().build()); Document document = blip.getContent(); document.appendXml(Blips.INITIAL_BODY); return conversation; } }
public void testMarkingBlipAsReadAfterBlipModifiedMarksAtWaveletVersion() { // Mark blip as read, then mark wavelet as unread, then mark blip as read // again, and test that it is marked at wavelet version. There is no real // design reason to test this use case; this is just here because it was a // specific case that was failing before. WaveletBasedConversation c = setUpWithWaveModel(); Wavelet w = c.getWavelet(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markAsRead(b); supplement.markAsUnread(); // Increase both last-modified blip version and wavelet version (but latter more than former). b.getContent().appendXml(Blips.INITIAL_CONTENT); t.appendBlip(); // Mark as read again, test that it's marked at wavelet version, not blip last-modified version. supplement.markAsRead(b); long blipReadVersion = substrate.getLastReadBlipVersion(w.getId(), b.getId()); assertEquals(blipReadVersion, (int) w.getVersion()); }
public void testMarkingBlipAsReadAfterBlipModifiedMarksAtWaveletVersion() { // Mark blip as read, then mark wavelet as unread, then mark blip as read // again, and test that it is marked at wavelet version. There is no real // design reason to test this use case; this is just here because it was a // specific case that was failing before. WaveletBasedConversation c = setUpWithWaveModel(); Wavelet w = c.getWavelet(); ObservableConversationThread t = c.getRootThread(); ConversationBlip b = t.appendBlip(); supplement.markAsRead(b); supplement.markAsUnread(); // Increase both last-modified blip version and wavelet version (but latter more than former). b.getContent().appendXml(Blips.INITIAL_CONTENT); t.appendBlip(); // Mark as read again, test that it's marked at wavelet version, not blip last-modified version. supplement.markAsRead(b); long blipReadVersion = substrate.getLastReadBlipVersion(w.getId(), b.getId()); assertEquals(blipReadVersion, (int) w.getVersion()); }