Examples of Wavelet


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

    assertTrue(supplementedWave.hasBeenSeen());
  }

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

    assertTrue(supplement.isTagsUnread(w));

    addTags(w);
    assertTrue(supplement.isTagsUnread(w));
View Full Code Here

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

    DocInitialization seenOp =
        BasicFactories.observableDocumentProvider().parse(
            "<seen i=\"conversation/root\"></seen>").toInitialization();

    FakeWaveView view = BasicFactories.fakeWaveViewBuilder().build();
    Wavelet userData = view.createUserData();

    userData.getDocument(WaveletBasedSupplement.READSTATE_DOCUMENT).hackConsume(
        Nindo.fromDocOp(readOp, false));
    userData.getDocument(WaveletBasedSupplement.ARCHIVING_DOCUMENT).hackConsume(
        Nindo.fromDocOp(archiveOp, false));
    userData.getDocument(WaveletBasedSupplement.SEEN_DOCUMENT).hackConsume(
        Nindo.fromDocOp(seenOp, false));

    WaveletBasedSupplement.create(userData);
  }
View Full Code Here

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

   *
   * This is a regression test for bug 2459305.
   */
  public void testCopySnapshotDoesNotCauseWrites() {
    FakeConversationView view = FakeConversationView.builder().with(schemas).build();
    Wavelet udw = view.getWaveView().createUserData();
    PrimitiveSupplement substrate = WaveletBasedSupplement.create(udw);
    ParticipantId viewer = new ParticipantId("nobody@google.com");
    SupplementedWave swave = SupplementedWaveImpl.create(substrate, view, viewer, ALWAYS);

    // Do something that is readable
    view.createRoot().addParticipant(viewer);
    swave.markAsRead();

    // Save version to detect writes
    long udwVersion = udw.getVersion();

    // Copy into pojo
    new PrimitiveSupplementImpl(substrate);

    // Verify no writes.
    assertEquals(udwVersion, udw.getVersion());
  }
View Full Code Here

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

    assertTrue(blips.contains(conversation.getRootThread().getFirstBlip().getId()));
    assertTrue(blips.contains(newBlip.getId()));
  }

  private Wavelet createMockWavelet(Conversation forConversation) {
    Wavelet mockWavelet = mock(Wavelet.class);
    when(mockWavelet.getCreationTime()).thenReturn(123L);
    ParticipantId creator = new ParticipantId("foo@test.com");
    when(mockWavelet.getCreatorId()).thenReturn(creator);
    when(mockWavelet.getWaveId()).thenReturn(WaveId.of("example.com", "123"));
    when(mockWavelet.getId()).thenReturn(WaveletId.of("example.com", "conv+root"));
    when(mockWavelet.getLastModifiedTime()).thenReturn(123L);
    when(mockWavelet.getVersion()).thenReturn(1L);
    when(mockWavelet.getDocumentIds()).thenReturn(Collections.<String>emptySet());
    return mockWavelet;
  }
View Full Code Here

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

    Blips.init();
    conversation = makeConversation();
  }

  public void testToBlipData() throws Exception {
    Wavelet wavelet = mock(Wavelet.class);
    when(wavelet.getWaveId()).thenReturn(WAVE_ID);
    when(wavelet.getId()).thenReturn(WAVELET_ID);

    ConversationBlip blip = conversation.getRootThread().getFirstBlip();
    String replyThreadId = blip.addReplyThread(3).getId();

    EventDataConverterV22 converter = new EventDataConverterV22();
View Full Code Here

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

  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.wave.Wavelet

            "key=AH0qf5woLURO3-CemfDebYFaWA9fD3PMuA\"></node>" +
        "<node key=\"attachment_url\" value=\"" + ATTACHMENT_URL + "\"></node>";
    ObservableDocument document = mock(ObservableDocument.class);
    when(document.toXmlString()).thenReturn(xmlString);

    Wavelet wavelet = mock(Wavelet.class);
    when(wavelet.getDocument("attach+" + attachmentId)).thenReturn(document);
    return wavelet;
  }
View Full Code Here

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

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

    // 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
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.