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
This commit is contained in:
Todd Kennedy 2011-06-09 10:36:41 -07:00
parent 7984aa60a0
commit 348b2f9f11
1 changed files with 20 additions and 5 deletions

View File

@ -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 <message.id@test.com>",
new String[] {
"* sEARCH 321",
getNextTag(true) + " oK success"
});
// If that fails, then try w/ parenthesis
mock.expectLiterally(
getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID <message.id@test.com>)",
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 <message.id@test.com>",
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 <message.id@test.com>)",
new String[] {
"* sEARCH", // not found
getNextTag(true) + " oK Search completed."
"* sEARCH", // not found
getNextTag(true) + " oK Search completed."
});
mFolder.appendMessages(new Message[] {message});