/** * Tests that a wavelet with an initialised manifest is recognised as having * conversation structure. */ public void testWaveletWithManifestHasConversation() { assertTrue(WaveletBasedConversation.waveletHasConversation(target.getWavelet())); }
/** * Tests that an empty wavelet is recognised as having no conversation * structure. */ public void testNewWaveletHasNoConversation() { Wavelet wavelet = waveView.createWavelet(); assertFalse(WaveletBasedConversation.waveletHasConversation(wavelet)); }
/** * Tests that a wavelet with an initialised manifest is recognised as having * conversation structure. */ public void testWaveletWithManifestHasConversation() { assertTrue(WaveletBasedConversation.waveletHasConversation(target.getWavelet())); }
/** * Tests that an empty wavelet is recognised as having no conversation * structure. */ public void testNewWaveletHasNoConversation() { Wavelet wavelet = waveView.createWavelet(); assertFalse(WaveletBasedConversation.waveletHasConversation(wavelet)); }
/** * Returns the root conversation from the given wavelet. Or null if there is * none. * * @param wavelet the wavelet to get the conversation from. */ private ObservableConversation getRootConversation(ObservableWavelet wavelet) { if (!WaveletBasedConversation.waveletHasConversation(wavelet)) { // No conversation present, bail. return null; } ObservableConversation conversation = conversationUtil.buildConversation(wavelet).getRoot(); if (conversation.getRootThread().getFirstBlip() == null) { // No root blip is present, this will cause Robot API code // to fail when resolving the context of events. This might be fixed later // on by making changes to the ContextResolver. return null; } return conversation; } }
/** * Builds an {@link ObservableConversationView} for the given wavelet. Note * that this can be expensive since the conversation is not garbage collected * until the wavelet is. * * @param wavelet The wavelet to return the conversation for, must be a valid * conversation wavelet. * @throws IllegalArgumentException if the wavelet is not a valid conversation * wavelet. */ public ObservableConversationView buildConversation(ObservableWavelet wavelet) { Preconditions.checkArgument(IdUtil.isConversationalId(wavelet.getId()), "Expected conversational wavelet, got " + wavelet.getId()); Preconditions.checkArgument(WaveletBasedConversation.waveletHasConversation(wavelet), "Conversation can't be build on a wavelet " + wavelet.getId() + " without conversation structure"); ReadOnlyWaveView wv = new ReadOnlyWaveView(wavelet.getWaveId()); wv.addWavelet(wavelet); return WaveBasedConversationView.create(wv, idGenerator); }
/** * Tests that makeWaveletConversational does so. */ public void testHackMakeWaveletConversationalMakesConversation() { Wavelet wavelet = waveView.createWavelet(); WaveletBasedConversation.makeWaveletConversational(wavelet); assertTrue(WaveletBasedConversation.waveletHasConversation(wavelet)); }
/** * Tests that makeWaveletConversational does so. */ public void testHackMakeWaveletConversationalMakesConversation() { Wavelet wavelet = waveView.createWavelet(); WaveletBasedConversation.makeWaveletConversational(wavelet); assertTrue(WaveletBasedConversation.waveletHasConversation(wavelet)); }
if (convWavelet != null) { OpBasedWavelet wavelet = OpBasedWavelet.createReadOnly(convWavelet); if (WaveletBasedConversation.waveletHasConversation(wavelet)) { conversations = conversationUtil.buildConversation(wavelet); supplement = buildSupplement(participant, conversations, udw);