private ConnectedChannel expectConnectedChannel(ObservableWaveletData knownSnapshot, Accessibility accessibility) { OperationChannel channel = muxListener.verifyOperationChannelCreated(knownSnapshot, accessibility); MockOperationChannelListener listener = new MockOperationChannelListener(); channel.setListener(listener); return new ConnectedChannel(channel, listener); }
private ConnectedChannel expectConnectedChannel(ObservableWaveletData knownSnapshot, Accessibility accessibility) { OperationChannel channel = muxListener.verifyOperationChannelCreated(knownSnapshot, accessibility); MockOperationChannelListener listener = new MockOperationChannelListener(); channel.setListener(listener); return new ConnectedChannel(channel, listener); }
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); }
private ConnectedChannel connectChannelSnapshot(ViewChannel.Listener viewListener, ObservableWaveletData snapshot, HashedVersion committed) throws ChannelException { viewListener.onSnapshot(snapshot.getWaveletId(), snapshot, committed, null); OperationChannel channel = muxListener.verifyOperationChannelCreated(snapshot, Accessibility.READ_WRITE); MockOperationChannelListener listener = new MockOperationChannelListener(); channel.setListener(listener); return new ConnectedChannel(channel, listener); }
private ConnectedChannel createOperationChannel(WaveletId waveletId, ParticipantId address) { mux.createOperationChannel(waveletId, address); OperationChannel channel = muxListener.verifyOperationChannelCreated(createSnapshot( WAVELET_ID_1, 0, NOSIG), Accessibility.READ_WRITE); MockOperationChannelListener channelListener = new MockOperationChannelListener(); channel.setListener(channelListener); return new ConnectedChannel(channel, channelListener); }
private ConnectedChannel createOperationChannel(WaveletId waveletId, ParticipantId address) { mux.createOperationChannel(waveletId, address); OperationChannel channel = muxListener.verifyOperationChannelCreated(createSnapshot( WAVELET_ID_1, 0, NOSIG), Accessibility.READ_WRITE); MockOperationChannelListener channelListener = new MockOperationChannelListener(); channel.setListener(channelListener); return new ConnectedChannel(channel, channelListener); }
private ConnectedChannel connectChannelSnapshot(ViewChannel.Listener viewListener, ObservableWaveletData snapshot, HashedVersion committed) throws ChannelException { viewListener.onSnapshot(snapshot.getWaveletId(), snapshot, committed, null); OperationChannel channel = muxListener.verifyOperationChannelCreated(snapshot, Accessibility.READ_WRITE); MockOperationChannelListener listener = new MockOperationChannelListener(); channel.setListener(listener); return new ConnectedChannel(channel, listener); }