Examples of OpBasedWavelet


Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

    userWaveletData =
        new WaveletDataImpl(WaveletId.of("example.com", "user+foo@example.com"), author,
            1234567890, 0, HashedVersion.unsigned(0), 0,
          waveId, BasicFactories.observablePluggableMutableDocumentFactory());
   
    OpBasedWavelet wavelet =
      new OpBasedWavelet(waveId, waveletData, new BasicWaveletOperationContextFactory(author),
          ParticipationHelper.DEFAULT,
          SilentOperationSink.Executor.<WaveletOperation, WaveletData>build(waveletData),
          SilentOperationSink.VOID);
    ReadOnlyWaveView waveView = new ReadOnlyWaveView(waveId);
    waveView.addWavelet(wavelet);
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

  public void testGetWaveletName() {
    assertEquals(wavelet.getWaveletName(), WAVELET_NAME);
  }

  public void testGetOpBasedWaveletReturnsSame() {
    OpBasedWavelet waveletAlex = wavelet.getOpBasedWavelet(ALEX);
    assertSame(waveletAlex, wavelet.getOpBasedWavelet(ALEX));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

    assertSame(waveletAlex, wavelet.getOpBasedWavelet(ALEX));
  }

  public void testGetDeltas() {
    // Alex adds a participant to the wavelet
    OpBasedWavelet waveletAlex = wavelet.getOpBasedWavelet(ALEX);
    waveletAlex.addParticipant(TRIXIE);

    // Bob doesn't perform any operations but we do retrieve his wavelet
    wavelet.getOpBasedWavelet(BOB);

    List<WaveletDelta> deltas = wavelet.getDeltas();
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

        delta.iterator().next());
  }

  public void testDeltasAreReturnedInOrder() {
    // Alex adds a participant to the wavelet
    OpBasedWavelet waveletAlex = wavelet.getOpBasedWavelet(ALEX);
    waveletAlex.addParticipant(TRIXIE);

    // Bob adds a new document to the wavelet
    OpBasedWavelet waveletBob = wavelet.getOpBasedWavelet(BOB);
    waveletBob.getDocument("r+randomDocument").insertText(0, "/nHello");

    List<WaveletDelta> deltas = wavelet.getDeltas();
    assertTrue(deltas.size() == 2);

    assertEquals("Expected Alex to be first", ALEX, deltas.get(0).getAuthor());
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

    assertFalse("Unbound contexts should return false", operationContext.isBound());
  }

  public void testPutNonTemporaryWavelet() throws Exception {
    OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT);
    operationContext.putWavelet(WAVE_ID, WAVELET_ID, wavelet);
    assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

    operationContext.putWavelet(WAVE_ID, WAVELET_ID, wavelet);
    assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT));
  }

  public void testPutTemporaryWavelet() throws Exception {
    OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT);
    WaveId tempWaveId = WaveId.of("example.com", OperationContextImpl.TEMP_ID_MARKER + "random");
    WaveletId tempWaveletId = WaveletId.of("example.com", "conv+root");
    operationContext.putWavelet(tempWaveId, tempWaveletId, wavelet);
    assertEquals(
        opBasedWavelet, operationContext.openWavelet(tempWaveId, tempWaveletId, PARTICIPANT));
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

  /**
   * Tests opening a wavelet that has to be retrieved using the
   * {@link WaveletProvider}.
   */
  public void testOpenWaveletFromWaveletProvider() throws Exception {
    OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT);
    assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

        lastLineLocation, inlineReplyThread.getLocation());
  }

  public void testInsertInlineBlip() throws Exception {
    OperationContextImpl context = helper.getContext();
    OpBasedWavelet wavelet = context.openWavelet(WAVE_ID, WAVELET_ID, ALEX);
    ObservableConversation conversation =
        context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    int insertAtApiLocation = 2;
    ApiView apiView =
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

    SilentOperationSink<WaveletOperation> executor =
        SilentOperationSink.Executor.<WaveletOperation, WaveletData> build(waveletData);
    output = new CapturingOperationSink<WaveletOperation>();
    wavelet =
        new OpBasedWavelet(waveletData.getWaveId(), waveletData, CONTEXT_FACTORY,
            ParticipationHelper.DEFAULT, executor, output);

    // Make a conversation and clear the sink
    WaveletBasedConversation.makeWaveletConversational(wavelet);
    conversationUtil.buildConversation(wavelet).getRoot().getRootThread().appendBlip();
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.opbased.OpBasedWavelet

   * @param data data object for the wavelet
   * @return mutable operation-backed wavelet.
   */
  public OpBasedWavelet operationalize(ObservableWaveletData data) {
    LiveTarget<ObservableWaveletData, WaveletOperation> target = createSinks(data);
    return new OpBasedWavelet(waveId,
        data,
        opContextFactory,
        ParticipationHelper.DEFAULT,
        target.getExecutorSink(),
        target.getOutputSink());
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.