/** * Returns the id of the wavelet that owns this blip. * * @return the wavelet id. */ public WaveletId getWaveletId() { return wavelet.getWaveletId(); }
/** * Generates a temporary blip id. * * @param wavelet the wavelet to seed the temporary id. * @return a temporary blip id. */ private static String generateTempBlipId(Wavelet wavelet) { return String.format(TEMP_BLIP_ID_FORMAT, ApiIdSerializer.instance().serialiseWaveletId(wavelet.getWaveletId()), ID_GENERATOR.nextInt()); }
/** * Deletes the specified blip. * * @param wavelet the wavelet that owns the blip. * @param blipId the id of the blip that will be deleted. */ public void deleteBlip(Wavelet wavelet, String blipId) { appendOperation(OperationType.BLIP_DELETE, wavelet.getWaveId(), wavelet.getWaveletId(), blipId); }
/** * Creates and appends a new operation to the operation queue. * * @param opType the type of the operation. * @param wavelet the wavelet to apply the operation to. * @param parameters the parameters that should be added as a property of * the operation. * @return an instance of {@link OperationRequest} that represents the queued * operation. */ OperationRequest appendOperation(OperationType opType, Wavelet wavelet, Parameter... parameters) { return appendOperation(opType, wavelet.getWaveId(), wavelet.getWaveletId(), null, parameters); }
@Override protected void setUp() throws Exception { wavelet = mock(Wavelet.class); when(wavelet.getWaveId()).thenReturn(WaveId.of("example.com", "wave1")); when(wavelet.getWaveletId()).thenReturn(WaveletId.of("example.com", "wavelet1")); when(wavelet.getThread(anyString())).thenReturn(new BlipThread("rootThread", -1, Lists.<String>newArrayList(), new HashMap<String, Blip>())); }
@Override protected void setUp() throws Exception { wavelet = mock(Wavelet.class); when(wavelet.getWaveId()).thenReturn(WaveId.of("example.com", "wave1")); when(wavelet.getWaveletId()).thenReturn(WaveletId.of("example.com", "wavelet1")); when(wavelet.getThread(anyString())).thenReturn(new BlipThread("rootThread", -1, Lists.<String>newArrayList(), new HashMap<String, Blip>())); }
@Override protected void setUp() throws Exception { wavelet = mock(Wavelet.class); when(wavelet.getOperationQueue()).thenReturn(new OperationQueue()); when(wavelet.getWaveId()).thenReturn(WaveId.of("example.com", "wave1")); when(wavelet.getWaveletId()).thenReturn(WaveletId.of("example.com", "wavelet1")); }
@Override protected void setUp() throws Exception { wavelet = mock(Wavelet.class); when(wavelet.getBlips()).thenReturn(blips); when(wavelet.getOperationQueue()).thenReturn(new OperationQueue()); when(wavelet.getWaveId()).thenReturn(WaveId.of("example.com", "wave1")); when(wavelet.getWaveletId()).thenReturn(WaveletId.of("example.com", "wavelet1")); when(wavelet.getThread(anyString())).thenReturn(new BlipThread("rootThread", -1, Lists.newArrayList(ROOT_BLIP_ID, CHILD_BLIP_ID), blips)); }
@Override protected void setUp() throws Exception { wavelet = mock(Wavelet.class); when(wavelet.getOperationQueue()).thenReturn(new OperationQueue()); when(wavelet.getWaveId()).thenReturn(WaveId.of("example.com", "wave1")); when(wavelet.getWaveletId()).thenReturn(WaveletId.of("example.com", "wavelet1")); }
@Override protected void setUp() throws Exception { wavelet = mock(Wavelet.class); when(wavelet.getBlips()).thenReturn(blips); when(wavelet.getOperationQueue()).thenReturn(new OperationQueue()); when(wavelet.getWaveId()).thenReturn(WaveId.of("example.com", "wave1")); when(wavelet.getWaveletId()).thenReturn(WaveletId.of("example.com", "wavelet1")); when(wavelet.getThread(anyString())).thenReturn(new BlipThread("rootThread", -1, Lists.newArrayList(ROOT_BLIP_ID, CHILD_BLIP_ID), blips)); }
blipData.setWaveletId(ApiIdSerializer.instance().serialiseWaveletId(wavelet.getWaveletId())); blipData.setParentBlipId(parentBlipId); blipData.setThreadId(thread.getId());
assertEquals(expectedWavelet.getWaveletId(), actualWavelet.getWaveletId()); assertEquals(expectedWavelet.getRootBlip().getBlipId(), actualWavelet.getRootBlip().getBlipId());
assertEquals(expectedWavelet.getWaveletId(), actualWavelet.getWaveletId()); assertEquals(expectedWavelet.getRootBlip().getBlipId(), actualWavelet.getRootBlip().getBlipId());