ConnectedChannel ch = createOperationChannel(WAVELET_ID_1, USER_ID);
ConnectedChannel ch = createOperationChannel(WAVELET_ID_1, USER_ID);
public void testNewWaveletSuppressesSnapshot() throws ChannelException { MockViewChannel view = openMux(); ViewChannel.Listener viewListener = view.takeListener(); viewListener.onConnected(); triggerAndCheckOpenFinished(viewListener); ConnectedChannel ch = createOperationChannel(WAVELET_ID_1, USER_ID); // Send and ack first op. checkSendDelta(view, ch.channel, HashedVersion.unsigned(0), WAVELET_ID_1); 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(); checkReceiveAndSend(viewListener, view, ch, WAVELET_ID_1, 1); view.checkExpectationsSatisified(); muxListener.verifyNoMoreInteractions(); }
public void testNewWaveletSuppressesSnapshot() throws ChannelException { MockViewChannel view = openMux(); ViewChannel.Listener viewListener = view.takeListener(); viewListener.onConnected(); triggerAndCheckOpenFinished(viewListener); ConnectedChannel ch = createOperationChannel(WAVELET_ID_1, USER_ID); // Send and ack first op. checkSendDelta(view, ch.channel, HashedVersion.unsigned(0), WAVELET_ID_1); 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(); checkReceiveAndSend(viewListener, view, ch, WAVELET_ID_1, 1); view.checkExpectationsSatisified(); muxListener.verifyNoMoreInteractions(); }