Search in sources :

Example 21 with ZSearchResult

use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.

the class TestDraftCount method checkMessageCount.

private void checkMessageCount(String query, int expected) throws Exception {
    ZSearchParams params = new ZSearchParams(query);
    params.setTypes("message");
    params.setOffset(0);
    params.setSortBy(SearchSortBy.rcptAsc);
    ZSearchResult results = mbox.search(params);
    assertEquals(expected, results.getHits().size());
    params.setSortBy(SearchSortBy.rcptDesc);
    results = mbox.search(params);
    assertEquals(expected, results.getHits().size());
}
Also used : ZSearchResult(com.zimbra.client.ZSearchResult) ZSearchParams(com.zimbra.client.ZSearchParams)

Aggregations

ZSearchResult (com.zimbra.client.ZSearchResult)21 ZSearchParams (com.zimbra.client.ZSearchParams)19 Test (org.junit.Test)14 ZSearchHit (com.zimbra.client.ZSearchHit)9 ZMailbox (com.zimbra.client.ZMailbox)3 ArrayList (java.util.ArrayList)2 ZMessageHit (com.zimbra.client.ZMessageHit)1 SoapFaultException (com.zimbra.common.soap.SoapFaultException)1 Account (com.zimbra.cs.account.Account)1 Mailbox (com.zimbra.cs.mailbox.Mailbox)1