Package org.waveprotocol.wave.model.conversation

Examples of org.waveprotocol.wave.model.conversation.ConversationBlip


  }

  public void testParticipantReadStateWithBlip() {
    WaveletBasedConversation c = setUpWithWaveModel();
    ObservableConversationThread t = c.getRootThread();
    ConversationBlip b = t.appendBlip();

    supplement.markParticipantAsRead(c.getWavelet());
  }
View Full Code Here


  }

  public void testParticipantReadStateAffectedByWaveletReadStateWithBlip() {
    WaveletBasedConversation c = setUpWithWaveModel();
    ObservableConversationThread t = c.getRootThread();
    ConversationBlip b = t.appendBlip();

    supplement.markAsRead();
  }
View Full Code Here

      assertTrue(blips.contains(blip.getId()));
    }
  }

  public void testResolveRootContext() throws Exception {
    ConversationBlip newBlip = conversation.getRootThread().appendBlip();
    eventMessages.requireBlip(newBlip.getId(), Lists.newArrayList(Context.ROOT));

    ContextResolver.resolveContext(
        eventMessages, wavelet, conversation, new EventDataConverterV21());

    Set<String> blips = eventMessages.getBlipData().keySet();
    assertEquals(2, blips.size());
    assertTrue(blips.contains(conversation.getRootThread().getFirstBlip().getId()));
    assertTrue(blips.contains(newBlip.getId()));
  }
View Full Code Here

  public void testToBlipData() throws Exception {
    Wavelet wavelet = mock(Wavelet.class);
    when(wavelet.getWaveId()).thenReturn(WAVE_ID);
    when(wavelet.getId()).thenReturn(WAVELET_ID);

    ConversationBlip blip = conversation.getRootThread().getFirstBlip();
    String replyThreadId = blip.addReplyThread(3).getId();

    EventDataConverterV22 converter = new EventDataConverterV22();
    EventMessageBundle eventMessageBundle = new EventMessageBundle(null, null);
    BlipData blipData = converter.toBlipData(blip, wavelet,
        eventMessageBundle);
    assertEquals(blip.getThread().getId(), blipData.getThreadId());
    assertEquals(Lists.newArrayList(replyThreadId), blipData.getReplyThreadIds());
    Map<String, BlipThread> threads = eventMessageBundle.getThreads();
    assertEquals(1, threads.size());
    assertEquals(1, threads.get(replyThreadId).getLocation());
  }
View Full Code Here

    assertEquals(1, threads.size());
    assertEquals(1, threads.get(replyThreadId).getLocation());
  }

  public void testFindBlipParent() {
    ConversationBlip first = conversation.getRootThread().getFirstBlip();
    ConversationBlip second = conversation.getRootThread().appendBlip();
    ConversationBlip reply = first.addReplyThread().appendBlip();
    ConversationBlip secondReply = reply.getThread().appendBlip();
    ConversationBlip inlineReply = first.addReplyThread(3).appendBlip();

    EventDataConverterV22 converter = new EventDataConverterV22();
    assertNull(converter.findBlipParent(first));
    assertNull(converter.findBlipParent(second));
    assertSame(first, converter.findBlipParent(reply));
View Full Code Here

    assertSame(first, converter.findBlipParent(inlineReply));
    assertSame(first, converter.findBlipParent(secondReply));
  }

  public void testFindBlipChildren() {
    ConversationBlip first = conversation.getRootThread().getFirstBlip();
    ConversationBlip second = conversation.getRootThread().appendBlip();
    ConversationBlip reply = first.addReplyThread().appendBlip();
    ConversationBlip secondReply = reply.getThread().appendBlip();
    ConversationBlip inlineReply = first.addReplyThread(3).appendBlip();

    EventDataConverterV22 converter = new EventDataConverterV22();
    assertEquals(0, converter.findBlipChildren(second).size());

    List<ConversationBlip> children = converter.findBlipChildren(first);
    assertEquals(3, children.size());
    assertEquals(inlineReply.getId(), children.get(0).getId());
    assertEquals(reply.getId(), children.get(1).getId());
    assertEquals(secondReply.getId(), children.get(2).getId());
  }
View Full Code Here

    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;
  }
View Full Code Here

            new EventMessageBundle(null, null)).getContent());
  }

  public void testFindBlipParent() {
    Conversation conversation = makeConversation();
    ConversationBlip first = conversation.getRootThread().getFirstBlip();
    ConversationBlip second = conversation.getRootThread().appendBlip();
    ConversationBlip reply = first.addReplyThread().appendBlip();
    ConversationBlip secondReply = reply.getThread().appendBlip();

    EventDataConverterV21 converter = new EventDataConverterV21();
    assertNull(converter.findBlipParent(first));
    assertSame(first, converter.findBlipParent(second));
    assertSame(first, converter.findBlipParent(reply));
View Full Code Here

    assertSame(reply, converter.findBlipParent(secondReply));
  }

  public void testFindBlipPreviousSibling() {
    Conversation conversation = makeConversation();
    ConversationBlip first = conversation.getRootThread().getFirstBlip();
    ConversationBlip second = conversation.getRootThread().appendBlip();
    ConversationBlip reply = first.addReplyThread().appendBlip();
    ConversationBlip secondReply = reply.getThread().appendBlip();

    assertNull(EventDataConverterV21.findPreviousSibling(first));
    assertSame(first, EventDataConverterV21.findPreviousSibling(second));
    assertNull(EventDataConverterV21.findPreviousSibling(reply));
    assertSame(reply, EventDataConverterV21.findPreviousSibling(secondReply));
View Full Code Here

    assertSame(reply, EventDataConverterV21.findPreviousSibling(secondReply));
  }

  public void testFindBlipNextSibling() {
    Conversation conversation = makeConversation();
    ConversationBlip first = conversation.getRootThread().getFirstBlip();
    ConversationBlip second = conversation.getRootThread().appendBlip();
    ConversationBlip reply = first.addReplyThread().appendBlip();
    ConversationBlip secondReply = reply.getThread().appendBlip();

    assertSame(second, EventDataConverterV21.findNextSibling(first));
    assertNull(EventDataConverterV21.findNextSibling(second));
    assertSame(secondReply, EventDataConverterV21.findNextSibling(reply));
    assertNull(EventDataConverterV21.findNextSibling(secondReply));
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.conversation.ConversationBlip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.