Package com.google.wave.api.SearchResult

Examples of com.google.wave.api.SearchResult.Digest


  }

  public void testSearchWrapsSearchProvidersResult() throws InvalidRequestException {
    String title = "title";
    SearchResult.Digest digest =
        new Digest(title, "", WAVE_ID.serialise(), ImmutableList.of(PARTICIPANT.getAddress(),
            OTHER_PARTICIPANT.getAddress()), -1L, -1L, 1, 1);
    String query = "in:inbox";
    SearchResult searchResult = new SearchResult(query);
    searchResult.addDigest(digest);
    when(searchProvider.search(USER, query, 0, 10)).thenReturn(searchResult);
View Full Code Here


      new TestingWaveletData(WAVE_ID, CONVERSATION_WAVELET_ID, PARTICIPANT, false);
    final Collection<WaveViewData> providerResults = Arrays.asList(data.copyViewData());

    String query = "in:inbox";
    SearchResult.Digest digest =
        new Digest("", "", WAVE_ID.serialise(), ImmutableList.of(PARTICIPANT.getAddress()), -1L,
            -1L, 1, 1);
    SearchResult searchResult = new SearchResult(query);
    searchResult.addDigest(digest);
    when(searchProvider.search(USER, query, 0, 10)).thenReturn(searchResult);
    service.execute(operation, context, USER);
View Full Code Here

        SearchResult results = (SearchResult) resultsObj;

        assertEquals(query, results.getQuery());
        assertEquals(1, results.getNumResults());

        Digest digest = results.getDigests().get(0);
        assertEquals(title, digest.getTitle());
        assertEquals(ApiIdSerializer.instance().serialiseWaveId(waveId), digest.getWaveId());

        Builder<ParticipantId> participantIds = ImmutableSet.builder();
        for (String name : digest.getParticipants()) {
          participantIds.add(ParticipantId.ofUnsafe(name));
        }
        assertEquals(participants, participantIds.build());

        assertEquals(unreadCount, digest.getUnreadCount());
        assertEquals(blipCount, digest.getBlipCount());
        return true;
      }

      @Override
      public void describeTo(Description description) {
View Full Code Here

    ObservableConversationView conversation = conversationUtil.buildConversation(wavelet);

    SupplementedWave supplement = mock(SupplementedWave.class);
    when(supplement.isUnread(any(ConversationBlip.class))).thenReturn(true);

    Digest digest = digester.generateDigest(conversation, supplement, observableWaveletData);

    assertEquals("", digest.getTitle());
    assertEquals(digest.getBlipCount(), 0);
  }
View Full Code Here

    ObservableConversationView conversation = conversationUtil.buildConversation(wavelet);

    SupplementedWave supplement = mock(SupplementedWave.class);
    when(supplement.isUnread(any(ConversationBlip.class))).thenReturn(true);

    Digest digest = digester.generateDigest(conversation, supplement, observableWaveletData);

    assertEquals(title, digest.getTitle());
    assertEquals(1, digest.getBlipCount());
  }
View Full Code Here

    ObservableWavelet wavelet = OpBasedWavelet.createReadOnly(observableWaveletData);
    ObservableConversationView conversation = conversationUtil.buildConversation(wavelet);

    SupplementedWave supplement = mock(SupplementedWave.class);
    when(supplement.isUnread(any(ConversationBlip.class))).thenReturn(true, true, false);
    Digest digest = digester.generateDigest(conversation, supplement, observableWaveletData);

    assertEquals(3, digest.getBlipCount());
    assertEquals(2, digest.getUnreadCount());
  }
View Full Code Here

    return result;
  }

  public Digest build(ParticipantId participant, WaveViewData wave) {

    Digest digest;

    // Note: the indexing infrastructure only supports single-conversation
    // waves, and requires raw wavelet access for snippeting.
    ObservableWaveletData root = null;
    ObservableWaveletData other = null;
View Full Code Here

        unreadCount++;
      }
      lastModified = Math.max(blip.getLastModifiedTime(), lastModified);
      blipCount++;
    }
    return new Digest(title, snippet, waveId, participants, lastModified,
        rawWaveletData.getCreationTime(), unreadCount, blipCount);
  }
View Full Code Here

  /** @return a digest for an empty wave. */
  private Digest emptyDigest(WaveViewData wave) {
    String title = ModernIdSerialiser.INSTANCE.serialiseWaveId(wave.getWaveId());
    String id = ApiIdSerializer.instance().serialiseWaveId(wave.getWaveId());
    return new Digest(title, "(empty)", id, Collections.<String> emptyList(), -1L, -1L, 0, 0);
  }
View Full Code Here

        } else {
          break;
        }
      }
    }
    return new Digest(title, "(unknown)", id, participants, lmt, created, 0, docs);
  }
View Full Code Here

TOP

Related Classes of com.google.wave.api.SearchResult.Digest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.