Package org.waveprotocol.wave.model.conversation

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


  private static final WaveletId WAVELET_ID = WaveletId.of("example.com", "conv+root");

  public void testToBlipDataHandlesBlipWithEmptyDocument() throws Exception {
    Blips.init();

    Conversation conversation = makeConversation();

    Wavelet wavelet = mock(Wavelet.class);
    when(wavelet.getWaveId()).thenReturn(WAVE_ID);
    when(wavelet.getId()).thenReturn(WAVELET_ID);

    EventDataConverterV21 converter = new EventDataConverterV21();
    assertEquals("",
        converter.toBlipData(conversation.getRootThread().getFirstBlip(), wavelet,
            new EventMessageBundle(null, null)).getContent());
  }
View Full Code Here


        converter.toBlipData(conversation.getRootThread().getFirstBlip(), wavelet,
            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));
View Full Code Here

    assertSame(first, converter.findBlipParent(reply));
    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));
View Full Code Here

    assertNull(EventDataConverterV21.findPreviousSibling(reply));
    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));
View Full Code Here

  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.
    conversation.getRootThread().appendBlip(new DocInitializationBuilder().build());
    return conversation;
  }
View Full Code Here

      Window.alert(e.getMessage());
      return;
    }

    ParticipantsView participantsUi = views.fromAddButton(context);
    Conversation conversation = models.getParticipants(participantsUi);
    for (ParticipantId participant : participants) {
      conversation.addParticipant(participant);
    }
  }
View Full Code Here

    String[] parts = split(longId);

    if (parts.length != 2) {
      throw new IllegalArgumentException("Not a blip model id: " + modelId);
    } else {
      Conversation c = model.getConversation(parts[0]);
      return c != null ? c.getBlip(parts[1]) : null;
    }
  }
View Full Code Here

    String[] parts = split(longId);

    if (parts.length != 2) {
      throw new IllegalArgumentException("Not a thread model id: " + modelId);
    } else {
      Conversation c = model.getConversation(parts[0]);
      return c != null ? c.getThread(parts[1]) : null;
    }
  }
View Full Code Here

    String[] parts = split(longId);

    if (parts.length != 2) {
      throw new IllegalArgumentException("Not a participant model id: " + modelId);
    } else {
      Conversation c = model.getConversation(parts[0]);
      ParticipantId p = new ParticipantId(parts[1]);
      return Pair.of(c, p);
    }
  }
View Full Code Here

  /**
   * @return the most recently modified blip.
   */
  public BlipView selectMostRecentlyModified() {
    Conversation conversation  = wave.getRoot();
    if (conversation == null) {
      return null;
    } else {
      ConversationBlip blip = wave.getRoot().getRootThread().getFirstBlip();
      BlipView rootBlipUi = views.getBlipView(blip);
View Full Code Here

TOP

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

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.