Package org.waveprotocol.wave.model.conversation

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


    wave = FakeConversationView.builder().build();
    target = new DiffController(wave, supplement, documents, models);
  }

  public void testFreshBlipsAreSuppressedOnStartup() {
    Conversation conv = wave.createRoot();
    ConversationBlip root = conv.getRootThread().appendBlip();

    MockDoc fresh = mock(MockDoc.class);
    when(fresh.isCompleteDiff()).thenReturn(true, false);
    when(documents.get(root)).thenReturn(fresh);
    target.install();
View Full Code Here


    verify(fresh).startDiffSuppression();
    verify(fresh, never()).stopDiffSuppression();
  }

  public void testReadBlipsNotSuppressedOnStartup() {
    Conversation conv = wave.createRoot();
    ConversationBlip root = conv.getRootThread().appendBlip();

    MockDoc seen = mock(MockDoc.class);
    when(seen.isCompleteDiff()).thenReturn(false);
    when(documents.get(root)).thenReturn(seen);
    target.install();
View Full Code Here

    verify(seen, never()).startDiffSuppression();
    verify(seen, never()).stopDiffSuppression();
  }

  public void testDynamicFreshBlipsAreSuppressed() {
    Conversation conv = wave.createRoot();

    target.install();

    // Instrument first.
    MockDoc doc = mock(MockDoc.class);
    when(doc.isCompleteDiff()).thenReturn(true, false);
    when(documents.get(any(ConversationBlip.class))).thenReturn(doc);

    conv.getRootThread().appendBlip();

    verify(doc).startDiffSuppression();
    verify(doc, never()).stopDiffSuppression();
  }
View Full Code Here

    this.followPolicy = followPolicy;
  }

  @Override
  public ThreadState getThreadState(ConversationThread thread) {
    Conversation c = thread.getConversation();
    String id = c.getId();
    return supplement.getThreadState(WaveletBasedConversation.widFor(id), thread.getId());
  }
View Full Code Here

      return ids;
    }

    @Override
    public HashedVersion getSignature(WaveletId id) {
      Conversation c = view.getConversation(WaveletBasedConversation.idFor(id));
      return (null != c) ?
          ((WaveletBasedConversation) c).getWavelet().getHashedVersion()
          : HashedVersion.unsigned(0);
    }
View Full Code Here

          : HashedVersion.unsigned(0);
    }

    @Override
    public long getVersion(WaveletId id) {
      Conversation c = view.getConversation(WaveletBasedConversation.idFor(id));
      return c != null ?
          // TODO(user): Once bug 2820511 is fixed, get rid of the cast.
          ((WaveletBasedConversation) c).getWavelet().getVersion()
          : PrimitiveSupplement.NO_VERSION;
    }
View Full Code Here

          : PrimitiveSupplement.NO_VERSION;
    }

    @Override
    public Map<String, Long> getBlipVersions(WaveletId id) {
      Conversation c = view.getConversation(WaveletBasedConversation.idFor(id));
      Map<String, Long> blipVersions = new HashMap<String, Long>();
      for (ConversationBlip blip : BlipIterators.breadthFirst(c)) {
        blipVersions.put(blip.getId(), blip.getLastModifiedVersion());
      }
      return blipVersions;
View Full Code Here

    // conversation promoted to first. Project out the participants of those
    // conversations into a list.
    // 2. The digest author is the first participant in that list.
    // 3. The participant snippet is the next PARTICIPANT_SNIPPET_SIZE unique
    // participants in that list.
    Conversation main = ConversationStructure.getMainConversation(wave.getConversations());
    List<Conversation> conversations = CollectionUtils.newLinkedList();
    conversations.addAll(wave.getConversations().getConversations());
    // Waves are not forced to have conversations in them, so it is legitimate
    // for main to be null.
    if (main != null) {
View Full Code Here

  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

  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

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.