Examples of WaveletDelta


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

    wavelet.getOpBasedWavelet(BOB);

    List<WaveletDelta> deltas = wavelet.getDeltas();
    assertTrue("Only one participant has performed operations", deltas.size() == 1);

    WaveletDelta delta = deltas.get(0);

    HashedVersion version = delta.getTargetVersion();
    assertEquals(
        "Delta should apply to the version given on construction", hashedVersionZero, version);

    assertEquals(ALEX, delta.getAuthor());

    assertTrue(delta.size() == 1);

    AddParticipant addParticipantOp = new AddParticipant(null, TRIXIE);
    assertEquals("Expected operation that adds Trixie to the wavelet", addParticipantOp,
        delta.iterator().next());
  }
View Full Code Here

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

  /**
   * Builds a "transformed" delta from client ops (no transformation happens).
   */
  private TransformedWaveletDelta makeDeltaFromCapturedOps(ParticipantId author,
      List<WaveletOperation> ops, HashedVersion endVersion, long timestamp) {
    WaveletDelta clientDelta =
        new WaveletDelta(author, HashedVersion.unsigned(endVersion.getVersion() - ops.size()), ops);
    return TransformedWaveletDelta.cloneOperations(endVersion, timestamp, clientDelta);
  }
View Full Code Here

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

  private void terminateOpenRpcWithFailure(String status) {
    waveViewService.lastOpen().callback.onFailure(status);
  }

  private static WaveletDelta emptyDelta() {
    return new WaveletDelta(null, null, Arrays.<WaveletOperation> asList());
  }
View Full Code Here

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

      }

      if (injectV0Delta) {
        // Inject a single NoOp from a null connection, this ensures that all
        // clients submit AFTER version 0.
        WaveletDelta initialDelta = new WaveletDelta(NOBODY_UTIL.getAuthor(),
            genSignature(0), Arrays.asList(NOBODY_UTIL.noOp()));
        serverMock.receive(null, initialDelta);
        serverProcessDeltas();
      }
    }
View Full Code Here

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

    operationChannel.onConnection(connectHashedVersion, currentHashedVersion);
  }

  private WaveletDelta sendAndCheckRandomOp(OperationChannelImpl opChannel,
      long currentVersion, byte[] signature) throws ChannelException {
    WaveletDelta delta = UTIL.makeDelta(HashedVersion.of(currentVersion, signature), 0L, 1);

    deltaChannel.expectSend(delta);
    opChannel.send(new WaveletOperation[] {delta.get(0)});
    return delta;
  }
View Full Code Here

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

  public void testReconnectWithPendingAckNotRecievedByServer() throws Exception {
    final int initialVersion = 42;
    final byte[] ackSignature = SIG2;
    connectChannel(initialVersion, SIG1);

    WaveletDelta delta = sendAndCheckRandomOp(operationChannel, 42, SIG1);

    // The server's version is still 42 when it responds. Expect a retransmission.
    reconnectChannel(initialVersion, SIG1, initialVersion, SIG1, delta);

    // Now ack.
View Full Code Here

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

  public void testReconnectWithPendingAckAndNewDeltaSentByServer() throws Exception {
    final int initialVersion = 42;
    final byte[] initialSignature = SIG1;
    connectChannel(initialVersion, initialSignature);

    WaveletDelta delta = sendAndCheckRandomOp(operationChannel, 42, SIG1);

    // Reconnect at the version before that delta, but with a later
    // current version including it.
    final long afterVersion = 44;
    final byte[] afterSignature = SIG3;
View Full Code Here

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

    assertNotNull(operationChannel.receive());
    listener.clear();

    // Push another delta to the channel, but don't expect a delta channel
    // send yet.
    WaveletDelta delta3 = UTIL.makeDelta(HashedVersion.of(45, SIG5), 0L, 1);
    operationChannel.send(new WaveletOperation[] { delta3.get(0) });
    listener.checkOpsReceived(0);

    // Ack the first op, and expect a send for the pending op3.
    deltaChannel.expectSend(delta3);
    operationChannel.onAck(1, HashedVersion.of(45, SIG5));
View Full Code Here

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

    byte[] signature43 = SIG2;
    byte[] signature44 = SIG3;
    sendAndCheckRandomOp(operationChannel, 42, SIG1);
    operationChannel.onAck(1, HashedVersion.of(43, signature43));
    // Send another op and expect an Ack.
    WaveletDelta delta2 = sendAndCheckRandomOp(operationChannel, 43, signature43);
    operationChannel.onAck(1, HashedVersion.of(44, signature44));
    // send commit for first Ack.
    operationChannel.onCommit(43);

    // Check that we reconnect, the server went down and has a LCV of 43.
View Full Code Here

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

    ConnectedChannel ch = connectChannelSnapshot(viewListener, chInfo);
    triggerAndCheckOpenFinished(viewListener);

    // Send an operation and check view submission
    WaveletOperation op = createOp();
    WaveletDelta delta = createDelta(chInfo.initialHashedVersion, op);
    viewChannel.expectSubmitDelta(WAVELET_ID_1, delta);
    ch.channel.send(op);
    viewChannel.checkExpectationsSatisified();
    muxListener.verifyNoMoreInteractions();
  }
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.