use of com.zimbra.soap.mail.type.ImapDataSourceNameOrId in project zm-mailbox by Zimbra.
the class JaxbToElementTest method DeleteDataSourceRequestTest.
/*
* Currently, DeleteDataSourceRequest does not have a setter for all datasource children. Making sure that
* it works. Actually believe that JAXB ignores setters for lists and adds by using the getter to get the
* list and adding to that.
*/
@Test
public void DeleteDataSourceRequestTest() throws Exception {
DeleteDataSourceRequest req = new DeleteDataSourceRequest();
Pop3DataSourceNameOrId pop = new Pop3DataSourceNameOrId();
pop.setName("pop3name");
ImapDataSourceNameOrId imap = new ImapDataSourceNameOrId();
imap.setName("imap4name");
req.addDataSource(pop);
req.addDataSource(imap);
Element elem = JaxbUtil.jaxbToElement(req, XMLElement.mFactory);
Assert.assertNotNull("DataSourceRequest elem", elem);
Element imapE = elem.getElement(MailConstants.E_DS_IMAP);
Assert.assertNotNull("imap elem", imapE);
Element popE = elem.getElement(MailConstants.E_DS_POP3);
Assert.assertNotNull("imap elem", popE);
req = JaxbUtil.elementToJaxb(elem, DeleteDataSourceRequest.class);
Assert.assertNotNull("JAXB DeleteDataSourceRequest", req);
Assert.assertEquals("Number of datasources in JAXB", 2, req.getDataSources().size());
}
use of com.zimbra.soap.mail.type.ImapDataSourceNameOrId in project zm-mailbox by Zimbra.
the class TestPurgeDataSource method refreshImapData.
private void refreshImapData() throws ServiceException, InterruptedException {
ImportDataRequest req = new ImportDataRequest();
DataSourceNameOrId imapDs1 = new ImapDataSourceNameOrId();
imapDs1.setId(imapDsId1);
DataSourceNameOrId imapDs2 = new ImapDataSourceNameOrId();
imapDs2.setId(imapDsId2);
List<DataSourceNameOrId> dsList = new LinkedList<DataSourceNameOrId>();
dsList.add(imapDs1);
dsList.add(imapDs2);
req.setDataSources(dsList);
mbox.invokeJaxb(req);
waitUntilImportsFinish();
}
use of com.zimbra.soap.mail.type.ImapDataSourceNameOrId in project zm-mailbox by Zimbra.
the class TestTrashImapMessage method refreshImapData.
private void refreshImapData() throws ServiceException, InterruptedException {
ImportDataRequest req = new ImportDataRequest();
DataSourceNameOrId imapDs1 = new ImapDataSourceNameOrId();
imapDs1.setId(imapDsId1);
List<DataSourceNameOrId> dsList = new LinkedList<DataSourceNameOrId>();
dsList.add(imapDs1);
req.setDataSources(dsList);
mbox.invokeJaxb(req);
TestDataSource.waitUntilImportsFinish(mbox);
}
Aggregations