Package org.waveprotocol.wave.model.conversation

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


    FakeWaveView view = BasicFactories.fakeWaveViewBuilder().with(idgen).build();
    Wavelet userDataWavelet = view.createUserData();
    ObservablePrimitiveSupplement primitiveSupplement =
        WaveletBasedSupplement.create(userDataWavelet);
    WaveBasedConversationView conversationView = WaveBasedConversationView.create(view, idgen);
    WaveletBasedConversation rootConversation = conversationView.createRoot();

    supplementedWave =
        new LiveSupplementedWaveImpl(primitiveSupplement, view, viewer, DefaultFollow.ALWAYS,
            conversationView);
    monitor = ThreadReadStateMonitorImpl.create(supplementedWave, conversationView);
    rootThread = rootConversation.getRootThread();
  }
View Full Code Here


  /**
   * Sets up the test supplement with a real wave model behind it.
   */
  private WaveletBasedConversation setUpWithWaveModel() {
    FakeConversationView view = FakeConversationView.builder().with(schemas).build();
    WaveletBasedConversation conversation = view.createRoot();
    ParticipantId viewer = new ParticipantId("nobody@nowhere.com");
    supplement = SupplementedWaveImpl.create(substrate, view, viewer, DefaultFollow.ALWAYS);
    return conversation;
  }
View Full Code Here

  //
  // Read/unread tests.
  //

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

    assertTrue(supplement.isUnread(b));
  }
View Full Code Here

    assertTrue(supplement.isUnread(b));
  }

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

    supplement.markAsRead(b);
    assertFalse(supplement.isUnread(b));
  }
View Full Code Here

    assertFalse(supplement.isUnread(b));
  }

  public void testMarkBlipIsIdempotent() {
    // Use real wave-model view.
    WaveletBasedConversation c = setUpWithWaveModel();
    Wavelet w = c.getWavelet();
    ObservableConversationThread t = c.getRootThread();
    ConversationBlip b = t.appendBlip();

    supplement.markAsRead(b);
    int blipReadVersion = substrate.getLastReadBlipVersion(w.getId(), b.getId());
    int waveletVersion = (int) w.getVersion();
View Full Code Here

  public void testMarkingBlipAsReadAfterWaveUnreadMarksAtWaveletVersion() {
    // Mark blip as read, then mark wavelet as unread, then mark blip as read
    // again, and test that it is marked at wavelet version. There is no real
    // design reason to test this use case; this is just here because it was a
    // specific case that was failing before.
    WaveletBasedConversation c = setUpWithWaveModel();
    Wavelet w = c.getWavelet();
    ObservableConversationThread t = c.getRootThread();
    ConversationBlip b = t.appendBlip();

    supplement.markAsRead(b);
    supplement.markAsUnread();
View Full Code Here

  public void testMarkingBlipAsReadAfterBlipModifiedMarksAtWaveletVersion() {
    // Mark blip as read, then mark wavelet as unread, then mark blip as read
    // again, and test that it is marked at wavelet version. There is no real
    // design reason to test this use case; this is just here because it was a
    // specific case that was failing before.
    WaveletBasedConversation c = setUpWithWaveModel();
    Wavelet w = c.getWavelet();
    ObservableConversationThread t = c.getRootThread();
    ConversationBlip b = t.appendBlip();

    supplement.markAsRead(b);
    supplement.markAsUnread();
View Full Code Here

    supplement.mute();
    assertEquals(Collections.singleton(100), supplement.getFolders());
  }

  public void testParticipantReadState() {
    WaveletBasedConversation c = setUpWithWaveModel();
    Wavelet w = c.getWavelet();

    assertFalse(supplement.haveParticipantsEverBeenRead(w));
    assertTrue(supplement.isParticipantsUnread(w));

    supplement.markParticipantAsRead(w);
View Full Code Here

    assertTrue(supplement.haveParticipantsEverBeenRead(w));
    assertFalse(supplement.isParticipantsUnread(w));
  }

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

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

    supplement.markParticipantAsRead(c.getWavelet());
  }

  public void testParticipantReadStateAffectedByWaveletReadState() {
    WaveletBasedConversation c = setUpWithWaveModel();
    Wavelet w = c.getWavelet();

    assertFalse(supplement.haveParticipantsEverBeenRead(w));
    assertTrue(supplement.isParticipantsUnread(w));

    supplement.markAsRead();
View Full Code Here

TOP

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

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.