From 348b2f9f11c6f62d8e134007ef1b0199ead9a650 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Thu, 9 Jun 2011 10:36:41 -0700 Subject: [PATCH] test uid search w/ and w/o parens some imap servers will not work if the uid command contains parenthesis, while other imap servers will not work unless the uid command contains parethesis. we need to verify that we send both formats. bug 4526165 Change-Id: I04a31f06a0f0fa0f03777a22b23281af574cd549 --- .../email/mail/store/ImapStoreUnitTests.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java b/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java index b7ecd0fe8..9379d78d2 100644 --- a/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java +++ b/tests/src/com/android/email/mail/store/ImapStoreUnitTests.java @@ -1207,11 +1207,19 @@ public class ImapStoreUnitTests extends InstrumentationTestCase { ImapMessage message = prepareForAppendTest(mock, "OK Success"); + // First try w/o parenthesis + mock.expectLiterally( + getNextTag(false) + " UID SEARCH HEADER MESSAGE-ID ", + new String[] { + "* sEARCH 321", + getNextTag(true) + " oK success" + }); + // If that fails, then try w/ parenthesis mock.expectLiterally( getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID )", new String[] { - "* sEARCH 321", - getNextTag(true) + " oK success" + "* sEARCH 321", + getNextTag(true) + " oK success" }); mFolder.appendMessages(new Message[] {message}); @@ -1233,12 +1241,19 @@ public class ImapStoreUnitTests extends InstrumentationTestCase { ImapMessage message = prepareForAppendTest(mock, "NO No space left on the server."); assertEquals("initial uid", message.getUid()); - + // First try w/o parenthesis + mock.expectLiterally( + getNextTag(false) + " UID SEARCH HEADER MESSAGE-ID ", + new String[] { + "* sEARCH", // not found + getNextTag(true) + " oK Search completed." + }); + // If that fails, then try w/ parenthesis mock.expectLiterally( getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID )", new String[] { - "* sEARCH", // not found - getNextTag(true) + " oK Search completed." + "* sEARCH", // not found + getNextTag(true) + " oK Search completed." }); mFolder.appendMessages(new Message[] {message});