Examples of Conversation


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

  private Conversation makeConversation() {
    IdGenerator idGenerator = FakeIdGenerator.create();
    ObservableWaveView waveView = BasicFactories.fakeWaveViewBuilder().with(idGenerator).build();
    ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator);
    Conversation conversation = convView.createRoot();
    conversation.getRootThread().appendBlip();
    conversation.getRootThread().appendBlip();
    return conversation;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.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;
  }
View Full Code Here

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

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

        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

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

    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

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

    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

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

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

      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

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

    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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.