/** * Check that a container succeeds when adding non-existent participants and removing existing * participants. */ private void assertSuccessfulApplyWaveletOperations(WaveletContainerImpl with) throws Exception { WaveServerTestUtil.applyDeltaToWavelet(with, addParticipantDelta(with), 0L); assertEquals(with.accessSnapshot().getParticipants(), participants); WaveServerTestUtil.applyDeltaToWavelet(with, removeParticipantDelta(with), 0L); assertEquals(with.accessSnapshot().getParticipants(), Collections.emptySet()); }
/** * Check that a container succeeds when adding non-existent participants and removing existing * participants. */ private void assertSuccessfulApplyWaveletOperations(WaveletContainerImpl with) throws Exception { WaveServerTestUtil.applyDeltaToWavelet(with, addParticipantDelta(with), 0L); assertEquals(with.accessSnapshot().getParticipants(), participants); WaveServerTestUtil.applyDeltaToWavelet(with, removeParticipantDelta(with), 0L); assertEquals(with.accessSnapshot().getParticipants(), Collections.emptySet()); }
/** * Check that a container fails when removing non-existent participants and adding duplicate * participants, and that the partipant list is preserved correctly. */ private void assertFailedWaveletOperations(WaveletContainerImpl with) throws Exception { try { WaveServerTestUtil.applyDeltaToWavelet(with, removeParticipantDelta(with), 0L); fail("Should fail"); } catch (OperationException e) { // Correct } assertNull(localWavelet.accessSnapshot()); WaveServerTestUtil.applyDeltaToWavelet(with, addParticipantDelta(with), 0L); try { WaveServerTestUtil.applyDeltaToWavelet(with, addParticipantDelta(with), 0L); fail("Should fail"); } catch (OperationException e) { // Correct } assertEquals(with.accessSnapshot().getParticipants(), participants); try { WaveServerTestUtil.applyDeltaToWavelet(with, doubleRemoveParticipantDelta(with), 0L); fail("Should fail"); } catch (OperationException e) { // Correct } assertEquals(with.accessSnapshot().getParticipants(), participants); }
/** * Check that a container fails when removing non-existent participants and adding duplicate * participants, and that the partipant list is preserved correctly. */ private void assertFailedWaveletOperations(WaveletContainerImpl with) throws Exception { try { WaveServerTestUtil.applyDeltaToWavelet(with, removeParticipantDelta(with), 0L); fail("Should fail"); } catch (OperationException e) { // Correct } assertNull(localWavelet.accessSnapshot()); WaveServerTestUtil.applyDeltaToWavelet(with, addParticipantDelta(with), 0L); try { WaveServerTestUtil.applyDeltaToWavelet(with, addParticipantDelta(with), 0L); fail("Should fail"); } catch (OperationException e) { // Correct } assertEquals(with.accessSnapshot().getParticipants(), participants); try { WaveServerTestUtil.applyDeltaToWavelet(with, doubleRemoveParticipantDelta(with), 0L); fail("Should fail"); } catch (OperationException e) { // Correct } assertEquals(with.accessSnapshot().getParticipants(), participants); }