Examples of HashedVersion


Examples of org.waveprotocol.wave.model.version.HashedVersion

   * the channel to attempt to send that message on reconnection.
   */
  private void reconnectChannel(long connectVersion, byte[] connectSignature,
      long currentVersion, byte[] currentSignature, WaveletDelta expectRetransmission)
      throws ChannelException {
    final HashedVersion connectHashedVersion = HashedVersion.of(connectVersion, connectSignature);
    final HashedVersion currentHashedVersion = HashedVersion.of(currentVersion, currentSignature);

    // Simulate failure elsewhere.
    operationChannel.reset();

    // Check reconnect versions provided by the channel include the
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    connectChannel(initialVersion, SIG1);

    sendAndCheckRandomOp(operationChannel, initialVersion, SIG1);
    listener.clear();

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

    // Listener should receive a version update op.
    listener.checkOpsReceived(1);
    WaveletOperation op = operationChannel.receive();
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    checkExpectationsSatisfied();
  }

  public void testSendToInaccessibleChanneFails() throws ChannelException {
    final HashedVersion connectSig = HashedVersion.unsigned(0);
    deltaChannel = new MockWaveletDeltaChannel();
    cc = new ConcurrencyControl(ccLogger, connectSig);
    operationChannel = new OperationChannelImpl(opLogger, deltaChannel, cc,
        Accessibility.READ_ONLY);
    operationChannel.setListener(listener);
    operationChannel.onConnection(connectSig, connectSig);

    try {
      sendAndCheckRandomOp(operationChannel, connectSig.getVersion(), connectSig.getHistoryHash());
      fail("Expected a channel exception");
    } catch (ChannelException expected) {
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    // Simulate failure
    operationChannel.reset();

    // Server presents unknown reconnect version
    final HashedVersion reconnectVersion = HashedVersion.of(66, SIG2);

    try {
      operationChannel.onConnection(reconnectVersion, reconnectVersion);
      fail("Should have thrown ChannelException");
    } catch (ChannelException expected) {
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    ViewChannel.Listener viewListener = viewChannel.takeListener();
    muxListener.verifyNoMoreInteractions();
    viewListener.onConnected();

    ObservableWaveletData snapshotUpdate = createSnapshot(WAVELET_ID_1, 1, SIG1);
    HashedVersion committed = HashedVersion.unsigned(0);

    viewListener.onSnapshot(WAVELET_ID_1, snapshotUpdate, committed, null);
    OperationChannel ch = muxListener.verifyOperationChannelCreated(snapshotUpdate,
        Accessibility.READ_WRITE);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    ViewChannel.Listener viewListener = viewChannel.takeListener();
    muxListener.verifyNoMoreInteractions();
    viewListener.onConnected();

    ObservableWaveletData snapshotUpdate = createSnapshot(WAVELET_ID_1, 1, SIG1);
    HashedVersion committed = HashedVersion.unsigned(0);

    viewListener.onSnapshot(WAVELET_ID_1, snapshotUpdate, committed, null);
    OperationChannel ch =
        muxListener.verifyOperationChannelCreated(snapshotUpdate, Accessibility.READ_WRITE);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

        chInfo.initialVersion, serverOps, finalSignature);
    viewChannel.checkExpectationsSatisified();
    muxListener.verifyNoMoreInteractions();

    // Now receive a snapshot and it should clobber the existing channel
    HashedVersion committed = HashedVersion.of(1000000L, SIG3);
    ObservableWaveletData update = createSnapshot(WAVELET_ID_1, committed.getVersion(),
        committed.getHistoryHash());
    checkSendClobberingSnapshot(viewListener, ch.channel, update, committed);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    view.checkExpectationsSatisified();
    checkAckDelta(view, ch.channel, ch.listener, 1, 1, SIG1);

    // Drop the empty snapshot sent by the server.
    ObservableWaveletData snapshot = createSnapshot(WAVELET_ID_1, 0, NOSIG);
    HashedVersion committed = HashedVersion.unsigned(0);
    viewListener.onSnapshot(snapshot.getWaveletId(), snapshot, committed, null);
    muxListener.verifyNoMoreInteractions();

    // Now CC should have sent the first client delta so it's acked.
    view.checkExpectationsSatisified();
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    return history.get(version);
  }

  @Override
  public boolean hasSignature(HashedVersion signatureInformation) {
    HashedVersion found = signatures.get(signatureInformation.getVersion());
    if (found == null) {
      return false;
    }
    return found.equals(signatureInformation);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    muxListener.verifyNoMoreInteractions();
  }

  private static ObservableWaveletData createSnapshot(WaveletId waveletId, final long version,
      final byte[] signature) {
    final HashedVersion hv = HashedVersion.of(version, signature);
    return DATA_FACTORY.create(new EmptyWaveletSnapshot(WAVE_ID, waveletId, USER_ID, hv,
        1273307837000L));
  }
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.