Examples of WaveletDelta


Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

    checkOpenFinished();

    // Attempt to send a client op. Submission should be held until the view
    // connects and the channel receives the empty reconnection delta.
    WaveletOperation clientOp = createOp();
    WaveletDelta delta = createDelta(HashedVersion.of(knownVersion, knownSig), clientOp);
    ch.channel.send(clientOp);
    ch.listener.checkOpsReceived(0);

    // Connect the underlying view.
    ViewChannel.Listener viewListener = view.takeListener();
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

      triggerAndCheckOpenFinished(viewListener);
    }

    ConnectedChannel ch = createOperationChannel(WAVELET_ID_1, USER_ID);

    WaveletDelta clientDelta = null;
    if (when.compareTo(NewWaveletDisconnectWhen.AFTER_SEND_DELTA) >= 0) {
      clientDelta = checkSendDelta(view, ch.channel, chInfo.initialHashedVersion, chInfo.waveletId);
    }

    if (when.compareTo(NewWaveletDisconnectWhen.AFTER_ACK_DELTA) >= 0) {
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

    // Receive initial snapshots.
    ConnectedChannel ch = connectChannelSnapshot(viewListener, chInfo1);
    triggerAndCheckOpenFinished(viewListener);

    // Send but don't ack delta.
    WaveletDelta delta =
        checkSendDelta(view, ch.channel, chInfo1.initialHashedVersion, WAVELET_ID_1);

    // No schedule yet
    assertNull(scheduler.command);
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

    // Receive initial snapshots.
    ConnectedChannel ch = connectChannelSnapshot(viewListener, chInfo1);
    triggerAndCheckOpenFinished(viewListener);

    // Send but don't ack delta.
    WaveletDelta delta =
        checkSendDelta(view, ch.channel, chInfo1.initialHashedVersion, WAVELET_ID_1);

    // Reconnect channel.
    MockViewChannel view2 = failViewAndExpectReconnection(viewListener, view,
        "View failed with outstanding submit", createKnownVersions(WAVELET_ID_1, 1, SIG1));
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

    // Receive initial snapshots.
    ConnectedChannel ch = connectChannelSnapshot(viewListener, chInfo1);
    triggerAndCheckOpenFinished(viewListener);

    // Send but don't ack delta.
    WaveletDelta delta =
        checkSendDelta(view, ch.channel, chInfo1.initialHashedVersion, WAVELET_ID_1);

    // Fail the submission, expecting reconnection.
    MockViewChannel view2 = failViewAndExpectReconnection(viewListener, view,
        "View failed with outstanding submit", createKnownVersions(WAVELET_ID_1, 1, SIG1));
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

  private static NoOp createOp() {
    return testUtil.noOp();
  }

  private static WaveletDelta createDelta(HashedVersion targetVersion, WaveletOperation... ops) {
    return new WaveletDelta(USER_ID, targetVersion, Arrays.asList(ops));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

   */
  private static WaveletDelta checkSendDelta(MockViewChannel viewChannel,
      OperationChannel opChannel, HashedVersion initialVersion, WaveletId expectedWaveletId)
      throws ChannelException {
    WaveletOperation op = createOp();
    WaveletDelta delta = createDelta(initialVersion, op);
    viewChannel.expectSubmitDelta(expectedWaveletId, delta);
    opChannel.send(op);
    return delta;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

      ServerConnectionMock connection = cache.connection;

      int initialClientOpsSize = cache.delta.size();

      // Assume that they are working only on 1 wave.
      WaveletDelta transformedClientDelta = ccCore.onClientDelta(cache.delta);
      HashedVersion endVersion = generateSignature(transformedClientDelta);
      TransformedWaveletDelta serverDelta =
          TransformedWaveletDelta.cloneOperations(endVersion, 0L, transformedClientDelta);

      // Update the version of the wave
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

   * delivered.
   */
  public void testSubmitDelta() throws ChannelException {
    final long currentVersion = 57;
    final int ops1 = 7;
    final WaveletDelta delta1 = buildDelta(currentVersion, ops1);
    final byte[] signature1 = sig(1);
    final WaveletDelta delta2 = buildDelta(currentVersion + ops1, 2);
    final int opsCommitted = 3;
    final String errorMsg2 = "SERVER_ERROR";

    checkedConnectChannel(currentVersion);

View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletDelta

   * Tests that a delta submitted after a reset has sequence number 1.
   */
  public void testSubmitAfterResetRestartsSequence() throws ChannelException {
    final long currentVersion = 57;
    final int ops1 = 7;
    final WaveletDelta delta1 = buildDelta(currentVersion, ops1);
    final byte[] signature1 = sig(1);
    final WaveletDelta delta2 = buildDelta(currentVersion + ops1, 2);

    checkedConnectChannel(currentVersion);

    // Send delta1.
    submitDeltaOnConnectedChannel(delta1);
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.