use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestSearchHeaders method testSearchNonTopLevelHeaders.
@Test
public void testSearchNonTopLevelHeaders() throws ServiceException {
ZSearchParams params = new ZSearchParams("\"header search test\" #Content-Transfer-Encoding:8bit");
params.setTypes("message");
ZSearchResult result = mbox.search(params);
boolean found = false;
for (ZSearchHit hit : result.getHits()) {
if (found == false && hit.getId().equals(id)) {
found = true;
}
}
assertTrue(found);
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearchConvRedisplay.
private void doSearchConvRedisplay() {
ZSearchResult sr = mConvSearchResult;
if (sr == null)
return;
dumpConvSearch(mConvSearchResult, verboseOpt());
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestDataSource method testPop3.
@Test
public void testPop3() throws Exception {
Account pop3acct = TestUtil.getAccount(TEST_USER_NAME);
ZMailbox pop3mbox = TestUtil.getZMailbox(TEST_USER_NAME);
ZMailbox mbox = TestUtil.getZMailbox(USER_NAME);
String pop3DSFolder = NAME_PREFIX + " testPop3 source";
String pop3DSFolderId = createFolderForDataSource(mbox, pop3DSFolder);
String dsId = createPop3DataSource(mbox, pop3acct.getName(), pop3DSFolderId);
String subj = NAME_PREFIX + " testtrashpop3";
addMessage(pop3mbox, subj, "test");
refreshPop3DatasourceData(mbox, dsId);
ZSearchParams params = new ZSearchParams(String.format("subject:\"%s\"", subj));
params.setTypes("MESSAGE");
ZSearchResult result = mbox.search(params);
ZSearchHit hit = result.getHits().get(0);
String id = hit.getId();
try {
mbox.trashMessage(id);
} catch (SoapFaultException sfe) {
fail("SoapFaultException caught when deleting item from Pop3 datasource folder - " + sfe.getMessage());
}
params = new ZSearchParams("in:Trash");
params.setTypes("MESSAGE");
result = mbox.search(params);
List<ZSearchHit> hits = result.getHits();
assertEquals(1, hits.size());
assertEquals(id, hits.get(0).getId());
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestMinusOperator method testExcludeRecipient.
@Test
public void testExcludeRecipient() throws ServiceException {
ZSearchResult search1 = mbox.search(new ZSearchParams("in:sent to:" + REMOTE_USER_NAME));
Assert.assertEquals(search1.getHits().size(), 1);
ZSearchResult search2 = mbox.search(new ZSearchParams("in:sent -to:" + REMOTE_USER_NAME));
Assert.assertEquals(search2.getHits().size(), 0);
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestSearchJunkTrash method testTrash.
@Test
public void testTrash() throws ServiceException {
ZSearchParams params = new ZSearchParams(String.format("(in:trash) (inid:%s OR is:local)", folder.getId()));
ZSearchResult results = mbox.search(params);
Assert.assertEquals(1, results.getHits().size());
}
Aggregations