public void onFailed(CorruptionDetail detail) { // Attempt to close the mux *during* the failure callback. mux.close(); }
public void onFailed(CorruptionDetail detail) { // Attempt to close the mux *during* the failure callback. mux.close(); }
/** * Create a wave, send Op which is unacked and expect unsaved data. */ public void testCreatingWave() throws ChannelException { // Connect to the server mux.open(muxListener, IdFilters.ALL_IDS); muxListener.verifyNoMoreInteractions(); OperationChannel channel = createOperationChannel(WAVELET_ID_1, USER_NAME); channel.send(createAddParticipantOp()); // Expect the delta channel to not be ready, so we expect an open call, but // no success on open and no submit call going through. assertEquals(1, waveViewService.opens.size()); assertEquals(0, waveViewService.submits.size()); muxListener.verifyNoMoreInteractions(); // We do expect unsaved data. assertUnsavedDataInfo(1, 1, 0, 0, 0); // Now bail out of the connection with an op pending, should close. mux.close(); assertEquals(1, fakeUnsavedDataListener.closeCalls); }
/** * Create a wave, send Op which is unacked and expect unsaved data. */ public void testCreatingWave() throws ChannelException { // Connect to the server mux.open(muxListener, IdFilters.ALL_IDS); muxListener.verifyNoMoreInteractions(); OperationChannel channel = createOperationChannel(WAVELET_ID_1, USER_NAME); channel.send(createAddParticipantOp()); // Expect the delta channel to not be ready, so we expect an open call, but // no success on open and no submit call going through. assertEquals(1, waveViewService.opens.size()); assertEquals(0, waveViewService.submits.size()); muxListener.verifyNoMoreInteractions(); // We do expect unsaved data. assertUnsavedDataInfo(1, 1, 0, 0, 0); // Now bail out of the connection with an op pending, should close. mux.close(); assertEquals(1, fakeUnsavedDataListener.closeCalls); }
public void testMuxCloseClosesAllUnsavedDataUpdaters() { mux.open(muxListener, IdFilters.ALL_IDS); MockOperationChannelListener listener1 = new MockOperationChannelListener(); MockOperationChannelListener listener2 = new MockOperationChannelListener(); OperationChannel ch1 = createOperationChannel(WAVELET_ID_1, USER_NAME); OperationChannel ch2 = createOperationChannel(WAVELET_ID_2, USER_NAME); ch1.setListener(listener1); ch2.setListener(listener2); mux.close(); assertEquals(2, fakeUnsavedDataListener.closeCalls); }
public void testMuxCloseClosesAllUnsavedDataUpdaters() { mux.open(muxListener, IdFilters.ALL_IDS); MockOperationChannelListener listener1 = new MockOperationChannelListener(); MockOperationChannelListener listener2 = new MockOperationChannelListener(); OperationChannel ch1 = createOperationChannel(WAVELET_ID_1, USER_NAME); OperationChannel ch2 = createOperationChannel(WAVELET_ID_2, USER_NAME); ch1.setListener(listener1); ch2.setListener(listener2); mux.close(); assertEquals(2, fakeUnsavedDataListener.closeCalls); }
public void testMuxCloseClosesViewAndChannels() throws ChannelException { final ConnectionInfo chInfo1 = new ConnectionInfo(WAVELET_ID_1, 1, SIG1); final ConnectionInfo chInfo2 = new ConnectionInfo(WAVELET_ID_2, 20, SIG2); MockViewChannel view = openMux(); ViewChannel.Listener viewListener = view.takeListener(); viewListener.onConnected(); // Receive initial snapshots. ConnectedChannel ch1 = connectChannelSnapshot(viewListener, chInfo1); ConnectedChannel ch2 = connectChannelSnapshot(viewListener, chInfo2); triggerAndCheckOpenFinished(viewListener); view.expectClose(); mux.close(); // Receive lagging delta from view channel, expect nothing. final List<TransformedWaveletDelta> update = createServerDeltaList(1, 1, SIG4); viewListener.onUpdate(chInfo1.waveletId, update, null, null); ch1.listener.checkOpsReceived(0); view.checkExpectationsSatisified(); muxListener.verifyNoMoreInteractions(); }
public void testMuxCloseClosesViewAndChannels() throws ChannelException { final ConnectionInfo chInfo1 = new ConnectionInfo(WAVELET_ID_1, 1, SIG1); final ConnectionInfo chInfo2 = new ConnectionInfo(WAVELET_ID_2, 20, SIG2); MockViewChannel view = openMux(); ViewChannel.Listener viewListener = view.takeListener(); viewListener.onConnected(); // Receive initial snapshots. ConnectedChannel ch1 = connectChannelSnapshot(viewListener, chInfo1); ConnectedChannel ch2 = connectChannelSnapshot(viewListener, chInfo2); triggerAndCheckOpenFinished(viewListener); view.expectClose(); mux.close(); // Receive lagging delta from view channel, expect nothing. final List<TransformedWaveletDelta> update = createServerDeltaList(1, 1, SIG4); viewListener.onUpdate(chInfo1.waveletId, update, null, null); ch1.listener.checkOpsReceived(0); view.checkExpectationsSatisified(); muxListener.verifyNoMoreInteractions(); }
mux.close(); assertEquals(1, waveViewService.closes.size()); waveViewService.lastClose().callback.onSuccess();
mux.close(); assertEquals(1, waveViewService.closes.size()); waveViewService.lastClose().callback.onSuccess();
mux.close(); assertEquals(1, waveViewService.closes.size()); waveViewService.lastClose().callback.onSuccess();
mux.close(); assertEquals(1, waveViewService.closes.size()); waveViewService.lastClose().callback.onSuccess();