Examples of WaveletOperation


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

    // We are making an delta which applies to version 1, however the robot only
    // knows about version 0.
    ParticipantId bob = ParticipantId.of("bob@exmaple.com");
    HashedVersion v2 = HashedVersion.unsigned(2);
    WaveletOperation addBob = new AddParticipant(new WaveletOperationContext(ALEX, 0L, 1, v2), bob);
    addBob.apply(waveletData);
    waveletData.setHashedVersion(v2);
    waveletData.setVersion(2);

    TransformedWaveletDelta delta = new TransformedWaveletDelta(ALEX, v2,
        0L, Collections.singletonList(addBob));
View Full Code Here

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

   */
  public void testSucksWhileNoFlushNeeded() {
    // Set expectations.
    WaveletOperation[] ops = makeOps(3);
    for (int i = 0; i < 3; ++i) {
      WaveletOperation op = ops[0];
      channel.expectPeek(op);
      sink.expectFlush(op, true);
      // The sucker peeks again after flush in case the op has changed.
      channel.expectPeek(op);
      channel.expectReceive(op);
View Full Code Here

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

   * Tests that the sucker stops sucking if a flush is required, and
   * resumes when the flush is done.
   */
  public void testFlushPausesSucking() {
    // Set expectations.
    WaveletOperation op = makeOp();
    channel.expectPeek(op);
    sink.expectFlush(op, false);

    // Go!
    sucker.onOperationReceived();
View Full Code Here

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

   * Tests that the sucker doesn't touch the operation channel after being
   * shut down while consuming ops.
   */
  public void testStopsSuckingAfterShutdown() {
    // Set expectations.
    WaveletOperation op = makeOp();
    channel.expectPeek(op);
    sink.expectFlush(op, true);

    channel.expectPeek(op);
    channel.expectReceive(op);
View Full Code Here

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

    HashedVersion signature = HashedVersion.of(43, SIG2);
    operationChannel.onAck(1, signature);

    // Listener should receive a version update op.
    listener.checkOpsReceived(1);
    WaveletOperation op = operationChannel.receive();
    WaveletOperationContext context = op.getContext();
    assertEquals(1, context.getVersionIncrement());
    assertEquals(signature, context.getHashedVersion());
  }
View Full Code Here

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

    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

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

    ConnectedChannel ch = expectConnectedChannel(knownSnapshot, Accessibility.READ_WRITE);
    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.
View Full Code Here

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

    // Receive openFinished in the absence of a reconnection delta for the
    // inaccessible wavelet, expect bliss.
    viewListener.onOpenFinished();

    // Check sending ops to the disconnected wavelet fails.
    WaveletOperation op = createOp();
    try {
      ch2.channel.send(op);
      fail("Expected a channel exception");
    } catch (ChannelException expected) {
    }
View Full Code Here

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

   * be submitted to the view.
   */
  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.WaveletOperation

  /**
   * Gets the operations from concurrency control.
   */
  public void receiveServerOperations() {
    WaveletOperation op;
    while ((op = cc.receive()) != null) {
      onServerOperation(op);
    }
  }
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.