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:
parent
7984aa60a0
commit
348b2f9f11
@ -1207,11 +1207,19 @@ public class ImapStoreUnitTests extends InstrumentationTestCase {
|
|||||||
|
|
||||||
ImapMessage message = prepareForAppendTest(mock, "OK Success");
|
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(
|
mock.expectLiterally(
|
||||||
getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID <message.id@test.com>)",
|
getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID <message.id@test.com>)",
|
||||||
new String[] {
|
new String[] {
|
||||||
"* sEARCH 321",
|
"* sEARCH 321",
|
||||||
getNextTag(true) + " oK success"
|
getNextTag(true) + " oK success"
|
||||||
});
|
});
|
||||||
|
|
||||||
mFolder.appendMessages(new Message[] {message});
|
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.");
|
ImapMessage message = prepareForAppendTest(mock, "NO No space left on the server.");
|
||||||
assertEquals("initial uid", message.getUid());
|
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(
|
mock.expectLiterally(
|
||||||
getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID <message.id@test.com>)",
|
getNextTag(false) + " UID SEARCH (HEADER MESSAGE-ID <message.id@test.com>)",
|
||||||
new String[] {
|
new String[] {
|
||||||
"* sEARCH", // not found
|
"* sEARCH", // not found
|
||||||
getNextTag(true) + " oK Search completed."
|
getNextTag(true) + " oK Search completed."
|
||||||
});
|
});
|
||||||
|
|
||||||
mFolder.appendMessages(new Message[] {message});
|
mFolder.appendMessages(new Message[] {message});
|
||||||
|
Loading…
Reference in New Issue
Block a user