Merge "Fix failing unit tests" into froyo

This commit is contained in:
Makoto Onuki 2010-04-22 09:51:21 -07:00 committed by Android (Google) Code Review
commit 6cfa8001a8

View File

@ -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));
}
}