Search in sources :

Example 1 with ZMessage

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

the class TestJaxb method testAcceptSeriesDeclineInstance.

/**
     * Bug 94018.  Accepting series, then declining single instance leads to inconsistent display of attendee
     * status for organizer copy for the declined instance.
     * Test steps:
     * 1.  Invite 2 users to a daily meeting.
     * 2.  User 1 replies, accepting the daily meeting.
     * 3.  User 1 replies again, declining one of the instances in the daily meeting.
     * 4.  User 2 replies tentatively accepting the daily meeting.
     *
     * At the end of this, check that an exception has been created.  Check that that exception registers
     * the decline from user 1 AND the tentative acceptance from user2 that arrived later.
     */
@Test
public void testAcceptSeriesDeclineInstance() throws Exception {
    TestUtil.createAccount(ORGANIZER);
    TestUtil.createAccount(ATTENDEE1);
    TestUtil.createAccount(ATTENDEE2);
    String subject = NAME_PREFIX + " Daily";
    ZMailbox organizerBox = TestUtil.getZMailbox(ORGANIZER);
    ZMailbox attendeeBox = TestUtil.getZMailbox(ATTENDEE1);
    ZMailbox attendee2Box = TestUtil.getZMailbox(ATTENDEE2);
    String organizerEmail = organizerBox.getName();
    // Create and send the daily meeting
    InviteComponent inviteComp = new InviteComponent();
    inviteComp.addAttendee(CalendarAttendee.createForAddressDisplaynameRolePartstatRsvp(attendeeBox.getName(), getCN(attendeeBox), "REQ", "NE", true));
    inviteComp.addAttendee(CalendarAttendee.createForAddressDisplaynameRolePartstatRsvp(attendee2Box.getName(), getCN(attendee2Box), "REQ", "NE", true));
    inviteComp.setStatus("CONF");
    inviteComp.setFreeBusy("B");
    inviteComp.setCalClass("PUB");
    inviteComp.setTransparency("O");
    inviteComp.setIsDraft(false);
    inviteComp.setIsAllDay(false);
    inviteComp.setDtStart(DtTimeInfo.createForDatetimeAndZone("20161008T130000", "Europe/London"));
    inviteComp.setDtEnd(DtTimeInfo.createForDatetimeAndZone("20161008T140000", "Europe/London"));
    inviteComp.setName(subject);
    inviteComp.setLocation("room 101");
    inviteComp.setOrganizer(CalOrganizer.createForAddress(organizerEmail));
    inviteComp.setRecurrence(RecurrenceInfo.create(AddRecurrenceInfo.create(SimpleRepeatingRule.createFromFrequencyAndInterval("DAI", IntervalRule.create(1)))));
    InvitationInfo invite = new InvitationInfo();
    invite.setInviteComponent(inviteComp);
    EmailAddrInfo attendeeAddr = EmailAddrInfo.createForAddressPersonalAndAddressType(attendeeBox.getName(), getCN(attendeeBox), "t");
    EmailAddrInfo attendeeAddr2 = EmailAddrInfo.createForAddressPersonalAndAddressType(attendee2Box.getName(), getCN(attendee2Box), "t");
    MimePartInfo mimePart = MimePartInfo.createForContentType("multipart/alternative");
    mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/plain", "invite body"));
    mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/html", "<html><body><p><b>invite</b> body</p></body></html>"));
    Msg msg = new Msg();
    msg.setFolderId("10");
    msg.setInvite(invite);
    msg.addEmailAddress(attendeeAddr);
    msg.addEmailAddress(attendeeAddr2);
    msg.setSubject(subject);
    msg.setMimePart(mimePart);
    CreateAppointmentRequest createSeriesRequest = CreateAppointmentRequest.create(msg);
    CreateAppointmentResponse caResp = organizerBox.invokeJaxb(createSeriesRequest);
    Assert.assertNotNull("JAXB CreateAppointmentResponse object", caResp);
    Assert.assertNotNull("JAXB CreateAppointmentResponse calItemId", caResp.getCalItemId());
    Assert.assertNotNull("JAXB CreateAppointmentResponse invId", caResp.getCalInvId());
    Assert.assertNotNull("JAXB CreateAppointmentResponse modified sequence ms", caResp.getModifiedSequence());
    Assert.assertNotNull("JAXB CreateAppointmentResponse rev", caResp.getRevision());
    ZMessage seriesInviteMsg = TestUtil.waitForMessage(attendeeBox, subject);
    Assert.assertNotNull("ZMessage for series invite", seriesInviteMsg);
    ZInvite seriesInvite = seriesInviteMsg.getInvite();
    Assert.assertNotNull("ZInvite for series invite", seriesInvite);
    // User 1 accepts the daily meeting
    ZMessage seriesAcceptMsg = sendInviteReplyToSeries(attendeeBox, organizerBox, seriesInviteMsg.getId(), subject, "ACCEPT");
    Assert.assertNotNull("ZMessage for series accept", seriesAcceptMsg);
    // User 1 declines one instance of the daily meeting
    SendInviteReplyRequest sirReq = new SendInviteReplyRequest(seriesInviteMsg.getId(), 0, /* componentNum */
    "DECLINE");
    sirReq.setIdentityId(attendeeBox.getAccountInfo(false).getId());
    sirReq.setExceptionId(DtTimeInfo.createForDatetimeAndZone("20161011T130000", "Europe/London"));
    sirReq.setUpdateOrganizer(true);
    attendeeAddr.setAddressType("f");
    mimePart = MimePartInfo.createForContentType("multipart/alternative");
    mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/plain", "I won't attend on Tuesday, October 11, 2016."));
    mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/html", "<html><body><p><b>I won't attend  on Tuesday, October 11, 2016</b></p></body></html>"));
    msg = new Msg();
    msg.setReplyType("r");
    msg.setIdentityId(attendeeBox.getAccountInfo(false).getId());
    EmailAddrInfo orgAddr = EmailAddrInfo.createForAddressPersonalAndAddressType(organizerBox.getName(), organizerBox.getName(), "t");
    msg.addEmailAddress(orgAddr);
    msg.addEmailAddress(attendeeAddr);
    String declineSubject = "Decline: " + subject;
    msg.setSubject(declineSubject);
    msg.setMimePart(mimePart);
    sirReq.setMsg(msg);
    SendInviteReplyResponse sirResp = attendeeBox.invokeJaxb(sirReq);
    Assert.assertNotNull("JAXB SendInviteReplyResponse object", sirResp);
    ZMessage instanceDeclineMsg = TestUtil.waitForMessage(organizerBox, String.format("subject:\"%s\"", declineSubject));
    Assert.assertNotNull("ZMessage for series accept", instanceDeclineMsg);
    seriesInviteMsg = TestUtil.waitForMessage(attendee2Box, subject);
    Assert.assertNotNull("ZMessage for series invite", seriesInviteMsg);
    seriesInvite = seriesInviteMsg.getInvite();
    Assert.assertNotNull("ZInvite for series invite", seriesInvite);
    // User 2 tentatively accepts the daily meeting
    ZMessage seriesTentativeMsg = sendInviteReplyToSeries(attendee2Box, organizerBox, seriesInviteMsg.getId(), subject, "TENTATIVE");
    Assert.assertNotNull("ZMessage for series tentative", seriesTentativeMsg);
    // Search for the organizer's calendar entry
    SearchRequest sReq = new SearchRequest();
    sReq.setSearchTypes(ZSearchParams.TYPE_APPOINTMENT);
    sReq.setCalItemExpandStart(ymdStringToDate("2016-10-09"));
    sReq.setCalItemExpandEnd(ymdStringToDate("2016-10-14"));
    sReq.setQuery((String.format("in:Calendar and subject:%s", subject)));
    SearchResponse sResp = organizerBox.invokeJaxb(sReq);
    List<SearchHit> hits = sResp.getSearchHits();
    Assert.assertNotNull("Organizer calendar Search hits at end", hits);
    Assert.assertEquals("Num Organizer calendar hits at end", 1, hits.size());
    SearchHit orgCalHit = hits.get(0);
    Assert.assertTrue(orgCalHit instanceof AppointmentHitInfo);
    AppointmentHitInfo orgApptHit = (AppointmentHitInfo) orgCalHit;
    String seriesInviteId = orgApptHit.getInvId();
    Assert.assertNotNull("Organizer Calendar at end - series invite id", seriesInviteId);
    List<InstanceDataInfo> instances = orgApptHit.getInstances();
    Assert.assertNotNull("Organizer Calendar at end - instances in expansion", instances);
    Assert.assertEquals("Organizer Calendar at end - number of instances in expansion", 5, instances.size());
    // The third entry in the list should be for the exception
    String exceptionInviteId = instances.get(2).getInvId();
    Assert.assertNotNull("Organizer Calendar at end - exception invite id", exceptionInviteId);
    String exceptionRidZ = instances.get(2).getRecurIdZ();
    Assert.assertNotNull("Organizer Calendar at end - exception invite RecurIdZ", exceptionRidZ);
    // Do a GetMsg for the exception in the Organizer's calendar
    MsgSpec gmeMsgSpec = new MsgSpec(exceptionInviteId);
    gmeMsgSpec.setRecurIdZ(exceptionRidZ);
    GetMsgRequest gmeReq = new GetMsgRequest(gmeMsgSpec);
    GetMsgResponse gmeResp = organizerBox.invokeJaxb(gmeReq);
    List<InviteComponentWithGroupInfo> eInviteComps = gmeResp.getMsg().getInvite().getInviteComponents();
    Assert.assertEquals("Organizer Calendar at end - number of components in exception", 1, eInviteComps.size());
    List<CalendarAttendeeWithGroupInfo> eAttendees = eInviteComps.get(0).getAttendees();
    Assert.assertEquals("Organizer Calendar at end - number of attendees in exception", 2, eAttendees.size());
    for (CalendarAttendeeWithGroupInfo eAttendee : eAttendees) {
        String addr = eAttendee.getAddress();
        String ptst = eAttendee.getPartStat();
        if (addr.equals(attendeeBox.getName())) {
            Assert.assertEquals("exception attendee1 partstat", "DE", ptst);
        } else if (addr.equals(attendee2Box.getName())) {
            Assert.assertEquals("exception attendee2 partstat", "TE", ptst);
        } else {
            Assert.fail(String.format("Unexpected attendee in exception [%s]", addr));
        }
    }
    // Do a GetMsg for the series in the Organizer's calendar
    MsgSpec gmsMsgSpec = new MsgSpec(seriesInviteId);
    GetMsgRequest gmsReq = new GetMsgRequest(gmsMsgSpec);
    GetMsgResponse gmsResp = organizerBox.invokeJaxb(gmsReq);
    List<InviteComponentWithGroupInfo> sInviteComps = gmsResp.getMsg().getInvite().getInviteComponents();
    Assert.assertEquals("Organizer Calendar at end - number of components in series", 1, sInviteComps.size());
    List<CalendarAttendeeWithGroupInfo> sAttendees = sInviteComps.get(0).getAttendees();
    Assert.assertEquals("Organizer Calendar at end - number of attendees in exception", 2, sAttendees.size());
    for (CalendarAttendeeWithGroupInfo sAttendee : sAttendees) {
        String addr = sAttendee.getAddress();
        String ptst = sAttendee.getPartStat();
        if (addr.equals(attendeeBox.getName())) {
            Assert.assertEquals("exception attendee1 partstat", "AC", ptst);
        } else if (addr.equals(attendee2Box.getName())) {
            Assert.assertEquals("exception attendee2 partstat", "TE", ptst);
        } else {
            Assert.fail(String.format("Unexpected attendee in exception [%s]", addr));
        }
    }
}
Also used : ZMessage(com.zimbra.client.ZMessage) SearchRequest(com.zimbra.soap.mail.message.SearchRequest) CreateAppointmentRequest(com.zimbra.soap.mail.message.CreateAppointmentRequest) ZInvite(com.zimbra.client.ZInvite) SearchHit(com.zimbra.soap.type.SearchHit) InvitationInfo(com.zimbra.soap.mail.type.InvitationInfo) CreateAppointmentResponse(com.zimbra.soap.mail.message.CreateAppointmentResponse) SendInviteReplyRequest(com.zimbra.soap.mail.message.SendInviteReplyRequest) CalendarAttendeeWithGroupInfo(com.zimbra.soap.mail.type.CalendarAttendeeWithGroupInfo) ZMailbox(com.zimbra.client.ZMailbox) EmailAddrInfo(com.zimbra.soap.mail.type.EmailAddrInfo) GetMsgResponse(com.zimbra.soap.mail.message.GetMsgResponse) MimePartInfo(com.zimbra.soap.mail.type.MimePartInfo) InstanceDataInfo(com.zimbra.soap.mail.type.InstanceDataInfo) InviteComponentWithGroupInfo(com.zimbra.soap.mail.type.InviteComponentWithGroupInfo) Msg(com.zimbra.soap.mail.type.Msg) SendInviteReplyResponse(com.zimbra.soap.mail.message.SendInviteReplyResponse) GetMsgRequest(com.zimbra.soap.mail.message.GetMsgRequest) MsgSpec(com.zimbra.soap.mail.type.MsgSpec) AppointmentHitInfo(com.zimbra.soap.mail.type.AppointmentHitInfo) InviteComponent(com.zimbra.soap.mail.type.InviteComponent) SearchResponse(com.zimbra.soap.mail.message.SearchResponse) Test(org.junit.Test)

Example 2 with ZMessage

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

the class TestJaxb method acceptInvite.

private ZMessage acceptInvite(ZMailbox attendeeBox, ZMailbox organizerBox, ZMessage inviteMsg, String subject) throws Exception {
    SendInviteReplyRequest sirReq = new SendInviteReplyRequest(inviteMsg.getId(), 0, /* componentNum */
    "ACCEPT");
    sirReq.setIdentityId(attendeeBox.getAccountInfo(false).getId());
    // ZWC 8.6 and earlier used to set this to false.  Now sets it to true.
    sirReq.setUpdateOrganizer(true);
    MimePartInfo mimePart = MimePartInfo.createForContentType("multipart/alternative");
    mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/plain", "Accepting"));
    mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/html", "<html><body><p><b>Accepting</b></p></body></html>"));
    Msg msg = new Msg();
    msg.setReplyType("r");
    msg.setIdentityId(attendeeBox.getAccountInfo(false).getId());
    EmailAddrInfo orgAddr = EmailAddrInfo.createForAddressPersonalAndAddressType(organizerBox.getName(), organizerBox.getName(), "t");
    EmailAddrInfo attendeeAddr = EmailAddrInfo.createForAddressPersonalAndAddressType(attendeeBox.getName(), getCN(attendeeBox), "f");
    msg.addEmailAddress(orgAddr);
    msg.addEmailAddress(attendeeAddr);
    String acceptSubject = "Accept: " + subject;
    msg.setSubject(acceptSubject);
    msg.setMimePart(mimePart);
    sirReq.setMsg(msg);
    SendInviteReplyResponse sirResp = attendeeBox.invokeJaxb(sirReq);
    Assert.assertNotNull("JAXB SendInviteReplyResponse object", sirResp);
    ZMessage inboxMsg = TestUtil.waitForMessage(organizerBox, String.format("subject:\"%s\"", acceptSubject));
    Assert.assertNotNull("ZMessage for accept", inboxMsg);
    return inboxMsg;
}
Also used : SendInviteReplyRequest(com.zimbra.soap.mail.message.SendInviteReplyRequest) Msg(com.zimbra.soap.mail.type.Msg) ZMessage(com.zimbra.client.ZMessage) SendInviteReplyResponse(com.zimbra.soap.mail.message.SendInviteReplyResponse) EmailAddrInfo(com.zimbra.soap.mail.type.EmailAddrInfo) MimePartInfo(com.zimbra.soap.mail.type.MimePartInfo)

Example 3 with ZMessage

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

the class TestCalDav method testAppleCaldavProxyFunctions.

/**
 * http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk/doc/Extensions/caldav-proxy.txt
 * This is an Apple standard implemented by Apple Mac OSX at least up to Yosemite and offers a fairly simple
 * sharing model for calendars.  The model is simpler than Zimbra's native model and there are mismatches,
 * for instance Zimbra requires the proposed delegate to accept shares.
 */
@Test
public void testAppleCaldavProxyFunctions() throws ServiceException, IOException {
    Account sharer = dav3;
    Account sharee1 = dav1;
    Account sharee2 = dav2;
    ZMailbox mboxSharer = TestUtil.getZMailbox(sharer.getName());
    ZMailbox mboxSharee1 = TestUtil.getZMailbox(sharee1.getName());
    ZMailbox mboxSharee2 = TestUtil.getZMailbox(sharee2.getName());
    setZimbraPrefAppleIcalDelegationEnabled(mboxSharer, true);
    setZimbraPrefAppleIcalDelegationEnabled(mboxSharee1, true);
    setZimbraPrefAppleIcalDelegationEnabled(mboxSharee2, true);
    // Test PROPPATCH to "calendar-proxy-read" URL
    setGroupMemberSet(TestCalDav.getCalendarProxyReadUrl(sharer), sharer, sharee2);
    // Test PROPPATCH to "calendar-proxy-write" URL
    setGroupMemberSet(TestCalDav.getCalendarProxyWriteUrl(sharer), sharer, sharee1);
    // verify that adding new members to groups triggered notification messages
    List<ZMessage> msgs = TestUtil.waitForMessages(mboxSharee1, "in:inbox subject:\"Share Created: Calendar shared by \"", 1, 10000);
    assertNotNull(String.format("Notification msgs for %s", sharee1.getName()), msgs);
    assertEquals(String.format("num msgs for %s", sharee1.getName()), 1, msgs.size());
    msgs = TestUtil.waitForMessages(mboxSharee2, "in:inbox subject:\"Share Created: Calendar shared by \"", 1, 10000);
    assertNotNull(String.format("Notification msgs for %s", sharee2.getName()), msgs);
    assertEquals(String.format("num msgs for %s", sharee2.getName()), 1, msgs.size());
    // Simulate acceptance of the shares (would normally need to be done in ZWC
    createCalendarMountPoint(mboxSharee1, sharer);
    createCalendarMountPoint(mboxSharee2, sharer);
    Document doc = delegateForExpandProperty(sharee1);
    XPath xpath = XPathFactory.newInstance().newXPath();
    xpath.setNamespaceContext(TestCalDav.NamespaceContextForXPath.forCalDAV());
    XPathExpression xPathExpr;
    try {
        String xpathS = "/D:multistatus/D:response/D:href/text()";
        xPathExpr = xpath.compile(xpathS);
        NodeList result = (NodeList) xPathExpr.evaluate(doc, XPathConstants.NODESET);
        assertEquals(String.format("num XPath nodes for %s for %s", xpathS, sharee1.getName()), 1, result.getLength());
        String text = (String) xPathExpr.evaluate(doc, XPathConstants.STRING);
        assertEquals("HREF for account owner", UrlNamespace.getPrincipalUrl(sharee1).replaceAll("@", "%40"), text);
        xpathS = "/D:multistatus/D:response/D:propstat/D:prop/CS:calendar-proxy-write-for/D:response/D:href/text()";
        xPathExpr = xpath.compile(xpathS);
        result = (NodeList) xPathExpr.evaluate(doc, XPathConstants.NODESET);
        assertEquals(String.format("num XPath nodes for %s for %s", xpathS, sharee1.getName()), 1, result.getLength());
        text = (String) xPathExpr.evaluate(doc, XPathConstants.STRING);
        assertEquals("HREF for sharer", UrlNamespace.getPrincipalUrl(sharer).replaceAll("@", "%40"), text);
    } catch (XPathExpressionException e1) {
        ZimbraLog.test.debug("xpath problem", e1);
    }
    // Check that proxy write has sharee1 in it
    doc = groupMemberSetExpandProperty(sharer, sharee1, true);
    // Check that proxy read has sharee2 in it
    doc = groupMemberSetExpandProperty(sharer, sharee2, false);
    String davBaseName = "notAllowed@There";
    String url = String.format("%s%s", getFolderUrl(sharee1, "Shared Calendar"), davBaseName);
    HttpMethodExecutor exe;
    if (DebugConfig.enableDAVclientCanChooseResourceBaseName) {
        exe = doIcalPut(url, sharee1, simpleEvent(sharer), HttpStatus.SC_CREATED);
        // rest of test deals with how redirecting to new name works - not needed here
        return;
    } else {
        exe = doIcalPut(url, sharee1, simpleEvent(sharer), HttpStatus.SC_MOVED_TEMPORARILY);
    }
    String location = exe.getNonNullHeaderValue("Location", "When creating in shared calendar");
    url = String.format("%s%s", getFolderUrl(sharee1, "Shared Calendar"), location.substring(location.lastIndexOf('/') + 1));
    doIcalPut(url, sharee1, simpleEvent(sharer), HttpStatus.SC_CREATED);
}
Also used : ZMessage(com.zimbra.client.ZMessage) XPath(javax.xml.xpath.XPath) XPathExpression(javax.xml.xpath.XPathExpression) Account(com.zimbra.cs.account.Account) ZMailbox(com.zimbra.client.ZMailbox) XPathExpressionException(javax.xml.xpath.XPathExpressionException) NodeList(org.w3c.dom.NodeList) Document(org.w3c.dom.Document) Test(org.junit.Test)

Example 4 with ZMessage

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

the class TestLmtp method testDiskStreamingEmptyFolder.

/**
 * Another test for bug 25484.  Delivers a message to user1 and user2, then confirms that
 * user1 can still read the message after user2 empties the folder that contains the message.
 */
@Test
public void testDiskStreamingEmptyFolder() throws Exception {
    TestUtil.createAccount(USER2_NAME);
    TestUtil.setServerAttr(Provisioning.A_zimbraMailDiskStreamingThreshold, "0");
    String[] recipients = { TestUtil.getAddress(USER_NAME), TestUtil.getAddress(USER2_NAME) };
    String subject = NAME_PREFIX + " testDiskStreamingMultipleRecipients";
    ZMailbox mbox1 = TestUtil.getZMailbox(USER_NAME);
    ZMailbox mbox2 = TestUtil.getZMailbox(USER2_NAME);
    TestUtil.addMessageLmtp(subject, recipients, TestUtil.getAddress(USER_NAME));
    TestUtil.waitForMessage(mbox1, "in:inbox subject:\"" + subject + "\"");
    ZMessage msg2 = TestUtil.waitForMessage(mbox2, "in:inbox subject:\"" + subject + "\"");
    // Test bug 25484.  Have user2 move the message to a folder, empty the folder,
    // and then have user1 read the message.
    ZFolder folder2 = TestUtil.createFolder(mbox2, "/" + NAME_PREFIX + " testDiskStreamingEmptyFolder");
    mbox2.moveMessage(msg2.getId(), folder2.getId());
    // Mark message as read, since unread messages result in uncache
    // getting called explicitly in Folder.propagateDeletion().
    mbox2.markItemRead(msg2.getId(), true, null);
    mbox2.emptyFolder(folder2.getId());
    mbox1 = TestUtil.getZMailbox(USER_NAME);
    TestUtil.waitForMessage(mbox1, "in:inbox subject:\"" + subject + "\"");
}
Also used : ZMessage(com.zimbra.client.ZMessage) ZMailbox(com.zimbra.client.ZMailbox) ZFolder(com.zimbra.client.ZFolder) Test(org.junit.Test)

Example 5 with ZMessage

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

the class TestLmtp method testDiskStreamingMultipleRecipients.

/**
 * Confirms that mail can successfully be delivered to multiple users when streaming to disk.
 */
@Test
public void testDiskStreamingMultipleRecipients() throws Exception {
    TestUtil.createAccount(USER2_NAME);
    TestUtil.setServerAttr(Provisioning.A_zimbraMailDiskStreamingThreshold, "0");
    String[] recipients = { TestUtil.getAddress(USER_NAME), TestUtil.getAddress(USER2_NAME) };
    String subject = NAME_PREFIX + " testDiskStreamingMultipleRecipients";
    ZMailbox mbox1 = TestUtil.getZMailbox(USER_NAME);
    ZMailbox mbox2 = TestUtil.getZMailbox(USER2_NAME);
    TestUtil.addMessageLmtp(subject, recipients, TestUtil.getAddress(USER_NAME));
    TestUtil.waitForMessage(mbox1, "in:inbox subject:\"" + subject + "\"");
    ZMessage msg2 = TestUtil.waitForMessage(mbox2, "in:inbox subject:\"" + subject + "\"");
    // Test bug 25484.  Make sure that user1 can still read the message after user2
    // deletes it.
    mbox2.deleteMessage(msg2.getId());
    mbox1 = TestUtil.getZMailbox(USER_NAME);
    TestUtil.waitForMessage(mbox1, "in:inbox subject:\"" + subject + "\"");
}
Also used : ZMessage(com.zimbra.client.ZMessage) ZMailbox(com.zimbra.client.ZMailbox) Test(org.junit.Test)

Aggregations

ZMessage (com.zimbra.client.ZMessage)118 Test (org.junit.Test)80 ZMailbox (com.zimbra.client.ZMailbox)75 ArrayList (java.util.ArrayList)44 ZFilterRule (com.zimbra.client.ZFilterRule)29 ZFilterAction (com.zimbra.client.ZFilterAction)28 ZFilterCondition (com.zimbra.client.ZFilterCondition)28 ZFilterRules (com.zimbra.client.ZFilterRules)28 ZOutgoingMessage (com.zimbra.client.ZMailbox.ZOutgoingMessage)16 ZHeaderCondition (com.zimbra.client.ZFilterCondition.ZHeaderCondition)12 ZFolder (com.zimbra.client.ZFolder)12 ZEmailAddress (com.zimbra.client.ZEmailAddress)11 ZTagAction (com.zimbra.client.ZFilterAction.ZTagAction)10 ServiceException (com.zimbra.common.service.ServiceException)10 Mailbox (com.zimbra.cs.mailbox.Mailbox)10 ZMarkAction (com.zimbra.client.ZFilterAction.ZMarkAction)8 Message (com.zimbra.cs.mailbox.Message)8 Date (java.util.Date)8 MessagePart (com.zimbra.client.ZMailbox.ZOutgoingMessage.MessagePart)7 ZTag (com.zimbra.client.ZTag)7