Package org.sonar.server.search

Examples of org.sonar.server.search.Result.scroll()


    Result results = index.search(new RuleQuery(), new QueryContext().setScroll(true));

    assertThat(results.getTotal()).isEqualTo(max);
    assertThat(results.getHits()).hasSize(0);

    Iterator<Rule> it = results.scroll();
    int count = 0;
    while (it.hasNext()) {
      count++;
      it.next();
    }
View Full Code Here


  @Test
  public void search_all_rules() throws Exception {
    List<Rule> rules = newArrayList(mock(Rule.class));
    Result serviceResult = mock(Result.class);
    when(serviceResult.scroll()).thenReturn(rules.iterator());

    when(ruleService.search(any(RuleQuery.class), any(QueryContext.class))).thenReturn(serviceResult);

    HashMap<String, Object> params = newHashMap();
    params.put("pageSize", "-1");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.