Search in sources :

Example 1 with ImapDataSourceNameOrId

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());
}
Also used : DeleteDataSourceRequest(com.zimbra.soap.mail.message.DeleteDataSourceRequest) Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) JSONElement(com.zimbra.common.soap.Element.JSONElement) JAXBElement(javax.xml.bind.JAXBElement) Pop3DataSourceNameOrId(com.zimbra.soap.mail.type.Pop3DataSourceNameOrId) ImapDataSourceNameOrId(com.zimbra.soap.mail.type.ImapDataSourceNameOrId) Test(org.junit.Test)

Example 2 with ImapDataSourceNameOrId

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();
}
Also used : DataSourceNameOrId(com.zimbra.soap.mail.type.DataSourceNameOrId) Pop3DataSourceNameOrId(com.zimbra.soap.mail.type.Pop3DataSourceNameOrId) ImapDataSourceNameOrId(com.zimbra.soap.mail.type.ImapDataSourceNameOrId) ImportDataRequest(com.zimbra.soap.mail.message.ImportDataRequest) ImapDataSourceNameOrId(com.zimbra.soap.mail.type.ImapDataSourceNameOrId) LinkedList(java.util.LinkedList)

Example 3 with ImapDataSourceNameOrId

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);
}
Also used : DataSourceNameOrId(com.zimbra.soap.mail.type.DataSourceNameOrId) ImapDataSourceNameOrId(com.zimbra.soap.mail.type.ImapDataSourceNameOrId) ImportDataRequest(com.zimbra.soap.mail.message.ImportDataRequest) ImapDataSourceNameOrId(com.zimbra.soap.mail.type.ImapDataSourceNameOrId) LinkedList(java.util.LinkedList)

Aggregations

ImapDataSourceNameOrId (com.zimbra.soap.mail.type.ImapDataSourceNameOrId)3 ImportDataRequest (com.zimbra.soap.mail.message.ImportDataRequest)2 DataSourceNameOrId (com.zimbra.soap.mail.type.DataSourceNameOrId)2 Pop3DataSourceNameOrId (com.zimbra.soap.mail.type.Pop3DataSourceNameOrId)2 LinkedList (java.util.LinkedList)2 Element (com.zimbra.common.soap.Element)1 JSONElement (com.zimbra.common.soap.Element.JSONElement)1 XMLElement (com.zimbra.common.soap.Element.XMLElement)1 DeleteDataSourceRequest (com.zimbra.soap.mail.message.DeleteDataSourceRequest)1 JAXBElement (javax.xml.bind.JAXBElement)1 Test (org.junit.Test)1