public void testBlipAppendReplyFiresEvent() { ObservableConversation mirror = mirrorConversation(target); ObservableConversationBlip b1 = target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); mirror.addListener(convListener); b1.addReplyThread(); ObservableConversationThread t1mirror = b1mirror.getReplyThreads().iterator().next(); verify(convListener).onThreadAdded(t1mirror); verifyNoMoreInteractions(convListener); }
public void testThreadAppendInsertBlipFiresEvent() { ObservableConversation mirror = mirrorConversation(target); mirror.addListener(convListener); ObservableConversationBlip b1 = target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); verify(convListener).onBlipAdded(b1mirror); target.getRootThread().insertBlip(b1); ObservableConversationBlip b2mirror = mirror.getRootThread().getFirstBlip(); verify(convListener).onBlipAdded(b2mirror); allowBlipTimestampChanged(convListener); verifyNoMoreInteractions(convListener); }
public void testThreadAppendInsertBlipFiresEvent() { ObservableConversation mirror = mirrorConversation(target); mirror.addListener(convListener); ObservableConversationBlip b1 = target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); verify(convListener).onBlipAdded(b1mirror); target.getRootThread().insertBlip(b1); ObservableConversationBlip b2mirror = mirror.getRootThread().getFirstBlip(); verify(convListener).onBlipAdded(b2mirror); allowBlipTimestampChanged(convListener); verifyNoMoreInteractions(convListener); }
private ObservableConversationBlip getRootBlip() throws InvalidRequestException { ObservableConversationBlip rootBlip = helper.getContext().openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot().getRootThread() .getFirstBlip(); return rootBlip; } }
private ObservableConversationBlip getRootBlip() throws InvalidRequestException { ObservableConversationBlip rootBlip = helper.getContext().openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot().getRootThread() .getFirstBlip(); return rootBlip; } }
private ObservableConversationBlip getRootBlip() throws InvalidRequestException { ObservableConversationBlip rootBlip = helper.getContext().openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot().getRootThread() .getFirstBlip(); return rootBlip; } }
public void testBlipRemovalFiresEvent() { ObservableConversation mirror = mirrorConversation(target); ObservableConversationBlip b1 = target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); mirror.addListener(convListener); b1.delete(); verify(convListener).onBlipDeleted(b1mirror); allowBlipTimestampChanged(convListener); verifyNoMoreInteractions(convListener); }
public void testBlipRemovalFiresEvent() { ObservableConversation mirror = mirrorConversation(target); ObservableConversationBlip b1 = target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); mirror.addListener(convListener); b1.delete(); verify(convListener).onBlipDeleted(b1mirror); allowBlipTimestampChanged(convListener); verifyNoMoreInteractions(convListener); }
public void testRootThreadRemovalDoesntFireEvent() { ObservableConversation mirror = mirrorConversation(target); target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); mirror.addListener(convListener); // Trigger thread deletion. target.getRootThread().delete(); verify(convListener).onBlipDeleted(b1mirror); allowBlipTimestampChanged(convListener); verifyNoMoreInteractions(convListener); }
public void testRootThreadRemovalDoesntFireEvent() { ObservableConversation mirror = mirrorConversation(target); target.getRootThread().appendBlip(); ObservableConversationBlip b1mirror = mirror.getRootThread().getFirstBlip(); mirror.addListener(convListener); // Trigger thread deletion. target.getRootThread().delete(); verify(convListener).onBlipDeleted(b1mirror); allowBlipTimestampChanged(convListener); verifyNoMoreInteractions(convListener); }
public void testDeleteSingleRootThreadBlipRemovesIt() { ConversationBlip blip = target.getRootThread().appendBlip(); blip.delete(); assertNull(target.getRootThread().getFirstBlip()); assertBlipInvalid(blip); }
public void testDeleteSingleRootThreadBlipRemovesIt() { ConversationBlip blip = target.getRootThread().appendBlip(); blip.delete(); assertNull(target.getRootThread().getFirstBlip()); assertBlipInvalid(blip); }
public void testGenerateDocumentChangedEventOnlyOnce() throws Exception { ConversationBlip rootBlip = conversationUtil.buildConversation(wavelet).getRoot().getRootThread().getFirstBlip(); // Change the document twice XmlStringBuilder builder = XmlStringBuilder.createText("some random content"); LineContainers.appendToLastLine(rootBlip.getContent(), builder); LineContainers.appendToLastLine(rootBlip.getContent(), builder); EventMessageBundle messages = generateAndCheckEvents(EventType.DOCUMENT_CHANGED); assertEquals("Expected one event only", 1, messages.getEvents().size()); }
public void testGenerateAnnotatedTextChangedEvent() throws Exception { ConversationBlip rootBlip = conversationUtil.buildConversation(wavelet).getRoot().getRootThread().getFirstBlip(); String annotationKey = "key"; String annotationValue = "value"; rootBlip.getContent().setAnnotation(0, 1, annotationKey, annotationValue); EventMessageBundle messages = generateAndCheckEvents(EventType.ANNOTATED_TEXT_CHANGED); assertEquals("Expected one event only", 1, messages.getEvents().size()); AnnotatedTextChangedEvent event = AnnotatedTextChangedEvent.as(messages.getEvents().get(0)); assertEquals("Expected the key of the annotation", annotationKey, event.getName()); assertEquals("Expected the value of the annotation", annotationValue, event.getValue()); }
public void testGenerateAnnotatedTextChangedEvent() throws Exception { ConversationBlip rootBlip = conversationUtil.buildConversation(wavelet).getRoot().getRootThread().getFirstBlip(); String annotationKey = "key"; String annotationValue = "value"; rootBlip.getContent().setAnnotation(0, 1, annotationKey, annotationValue); EventMessageBundle messages = generateAndCheckEvents(EventType.ANNOTATED_TEXT_CHANGED); assertEquals("Expected one event only", 1, messages.getEvents().size()); AnnotatedTextChangedEvent event = AnnotatedTextChangedEvent.as(messages.getEvents().get(0)); assertEquals("Expected the key of the annotation", annotationKey, event.getName()); assertEquals("Expected the value of the annotation", annotationValue, event.getValue()); }
public void testGenerateDocumentChangedEventOnlyOnce() throws Exception { ConversationBlip rootBlip = conversationUtil.buildConversation(wavelet).getRoot().getRootThread().getFirstBlip(); // Change the document twice XmlStringBuilder builder = XmlStringBuilder.createText("some random content"); LineContainers.appendToLastLine(rootBlip.getContent(), builder); LineContainers.appendToLastLine(rootBlip.getContent(), builder); EventMessageBundle messages = generateAndCheckEvents(EventType.DOCUMENT_CHANGED); assertEquals("Expected one event only", 1, messages.getEvents().size()); }
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()); }
public void testDeleteBlipWithInlineReplyDeletesReply() { ConversationBlip blip = target.getRootThread().appendBlip(); MutableDocument<?, ?, ?> doc = blip.getContent(); ConversationThread reply = blip.addReplyThread(locateAfterLineElement(doc)); ConversationBlip replyBlip = reply.appendBlip(); blip.delete(); assertNull(target.getRootThread().getFirstBlip()); assertThreadInvalid(reply); assertBlipInvalid(replyBlip); }
public void testDeleteBlipWithInlineReplyDeletesReply() { ConversationBlip blip = target.getRootThread().appendBlip(); MutableDocument<?, ?, ?> doc = blip.getContent(); ConversationThread reply = blip.addReplyThread(locateAfterLineElement(doc)); ConversationBlip replyBlip = reply.appendBlip(); blip.delete(); assertNull(target.getRootThread().getFirstBlip()); assertThreadInvalid(reply); assertBlipInvalid(replyBlip); }