Package org.waveprotocol.wave.model.wave

Examples of org.waveprotocol.wave.model.wave.Wavelet


      return WaveBasedConversationView.create(getWave(), getIdGenerator());
    }

    /** @return the user supplement of the wave. Subclasses may override. */
    protected LocalSupplementedWave createSupplement() {
      Wavelet udw = getWave().getUserData();
      if (udw == null) {
         udw = getWave().createUserData();
      }
      ObservablePrimitiveSupplement state = WaveletBasedSupplement.create(udw);
      ObservableSupplementedWave live = new LiveSupplementedWaveImpl(
View Full Code Here


  /**
   * Tests that an empty wavelet is recognised as having no conversation
   * structure.
   */
  public void testNewWaveletHasNoConversation() {
    Wavelet wavelet = waveView.createWavelet();
    assertFalse(WaveletBasedConversation.waveletHasConversation(wavelet));
  }
View Full Code Here

  /**
   * Tests that makeWaveletConversational does so.
   */
  public void testHackMakeWaveletConversationalMakesConversation() {
    Wavelet wavelet = waveView.createWavelet();
    WaveletBasedConversation.makeWaveletConversational(wavelet);
    assertTrue(WaveletBasedConversation.waveletHasConversation(wavelet));
  }
View Full Code Here

   * stored in the conversation documents.
   */
  public void testConversationBlipMetadataMatchesWavelet() {
    populate(target);
    ConversationBlip convBlip = target.getRootThread().getFirstBlip();
    Wavelet wavelet = target.getWavelet();
    Blip blip = wavelet.getBlip(convBlip.getId());

    assertEquals(blip.getId(), convBlip.getId());
    assertEquals(blip.getLastModifiedVersion().longValue(), convBlip.getLastModifiedVersion());
    assertEquals(blip.getLastModifiedTime().longValue(), convBlip.getLastModifiedTime());
    assertEquals(blip.getAuthorId(), convBlip.getAuthorId());
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();

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

  }

  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();
    assertEquals(waveletVersion, blipReadVersion);

    // Do something to increase wavelet version without increasing blip last-modified version.
    t.appendBlip();
    assert w.getVersion() > waveletVersion : "test wave model did not increase version";

    // Test that marking blip as read again has no effect.
    supplement.markAsRead(b);
    long newBlipReadVersion = substrate.getLastReadBlipVersion(w.getId(), b.getId());
    assertEquals(blipReadVersion, (int) newBlipReadVersion);
  }
View Full Code Here

    // because the wavelet version can change independently of that blip, the
    // mark-blip-as-read action is not idempotent. Therefore, to minimise
    // chatter, we do it only for unread blips.
    if (isUnread(b)) {
      Blip raw = b.hackGetRaw();
      Wavelet wavelet = raw.getWavelet();
      supplement.markBlipAsRead(wavelet.getId(), raw.getId(),
          // It is possible that during a VersionUpdateOperatin, the blip version is updated
          // before the wavelet version is updated, hence the max.
          // TODO(user, zdwang) to remove this once the wave model does correct event boundaries.
          (int) Math.max(raw.getLastModifiedVersion(), wavelet.getVersion()));
    }
  }
View Full Code Here

    // 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();

    // Do something to increase wavelet version without increasing blip last-modified version.
    t.appendBlip();

    // Mark as read again, test that it's marked at wavelet version.
    supplement.markAsRead(b);
    int blipReadVersion = substrate.getLastReadBlipVersion(w.getId(), b.getId());
    assertEquals(blipReadVersion, (int) w.getVersion());
  }
View Full Code Here

    // 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();

    // Increase both last-modified blip version and wavelet version (but latter more than former).
    b.getContent().appendXml(Blips.INITIAL_CONTENT);
    t.appendBlip();

    // Mark as read again, test that it's marked at wavelet version, not blip last-modified version.
    supplement.markAsRead(b);
    long blipReadVersion = substrate.getLastReadBlipVersion(w.getId(), b.getId());
    assertEquals(blipReadVersion, (int) w.getVersion());
  }
View Full Code Here

    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

TOP

Related Classes of org.waveprotocol.wave.model.wave.Wavelet

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.