Merge commit '2ca8d7347db3975746ad87347de57fd5800bf5d4' into kraken * commit '2ca8d7347db3975746ad87347de57fd5800bf5d4': Fix failing unit tests
This commit is contained in:
commit
3844bbcaaf
@ -144,30 +144,35 @@ public class ImapResponseParserUnitTests extends AndroidTestCase {
|
||||
ImapList list1 = parser.new ImapList();
|
||||
list1.add("foo");
|
||||
list1.add("bar");
|
||||
list1.add(20);
|
||||
list1.add("20");
|
||||
list1.add(is);
|
||||
list1.add(new Date());
|
||||
list1.add("01-Jan-2009 11:20:39 -0800");
|
||||
ImapList list2 = parser.new ImapList();
|
||||
list2.add(list1);
|
||||
// Test getString(), getStringOrNull(), getList(), getListOrNull, getNumber()
|
||||
// getLiteral(), and getDate()
|
||||
assertEquals("foo", list1.getString(0));
|
||||
assertEquals("foo", list1.getStringOrNull(0));
|
||||
assertNull(list1.getListOrNull(0));
|
||||
|
||||
assertEquals("bar", list1.getString(1));
|
||||
assertEquals("bar", list1.getStringOrNull(1));
|
||||
assertNull(list1.getStringOrNull(2));
|
||||
assertNull(list1.getStringOrNull(3));
|
||||
assertNull(list1.getStringOrNull(4));
|
||||
assertNull(list1.getListOrNull(2));
|
||||
assertNull(list1.getListOrNull(3));
|
||||
assertNull(list1.getListOrNull(4));
|
||||
assertNull(list1.getListOrNull(1));
|
||||
|
||||
assertEquals("20", list1.getString(2));
|
||||
assertEquals("20", list1.getStringOrNull(2));
|
||||
assertEquals(20, list1.getNumber(2));
|
||||
assertNull(list1.getStringOrNull(20));
|
||||
|
||||
assertNull(list1.getStringOrNull(3));
|
||||
assertNotNull(list1.getLiteral(3));
|
||||
assertNotNull(list1.getDate(4));
|
||||
|
||||
// getDate() is removed by proguard. (aparently it's not used.)
|
||||
// assertNotNull(list1.getDate(4));
|
||||
|
||||
// Test getList() and getListOrNull() with list value
|
||||
assertEquals(list1, list2.getList(0));
|
||||
assertEquals(list1, list2.getListOrNull(0));
|
||||
assertNull(list2.getListOrNull(20));
|
||||
assertNull(list2.getStringOrNull(20));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user