am 6cfa8001: Merge "Fix failing unit tests" into froyo

Merge commit '6cfa8001a8f352fa2a51925c7552f772796d9cd1' into froyo-plus-aosp

* commit '6cfa8001a8f352fa2a51925c7552f772796d9cd1':
  Fix failing unit tests
This commit is contained in:
Makoto Onuki 2010-04-22 09:53:58 -07:00 committed by Android Git Automerger
commit 2ca8d7347d

View File

@ -144,30 +144,35 @@ public class ImapResponseParserUnitTests extends AndroidTestCase {
ImapList list1 = parser.new ImapList(); ImapList list1 = parser.new ImapList();
list1.add("foo"); list1.add("foo");
list1.add("bar"); list1.add("bar");
list1.add(20); list1.add("20");
list1.add(is); list1.add(is);
list1.add(new Date()); list1.add("01-Jan-2009 11:20:39 -0800");
ImapList list2 = parser.new ImapList(); ImapList list2 = parser.new ImapList();
list2.add(list1); list2.add(list1);
// Test getString(), getStringOrNull(), getList(), getListOrNull, getNumber() // Test getString(), getStringOrNull(), getList(), getListOrNull, getNumber()
// getLiteral(), and getDate() // getLiteral(), and getDate()
assertEquals("foo", list1.getString(0)); assertEquals("foo", list1.getString(0));
assertEquals("foo", list1.getStringOrNull(0)); assertEquals("foo", list1.getStringOrNull(0));
assertNull(list1.getListOrNull(0));
assertEquals("bar", list1.getString(1)); assertEquals("bar", list1.getString(1));
assertEquals("bar", list1.getStringOrNull(1)); assertEquals("bar", list1.getStringOrNull(1));
assertNull(list1.getStringOrNull(2)); assertNull(list1.getListOrNull(1));
assertNull(list1.getStringOrNull(3));
assertNull(list1.getStringOrNull(4)); assertEquals("20", list1.getString(2));
assertNull(list1.getListOrNull(2)); assertEquals("20", list1.getStringOrNull(2));
assertNull(list1.getListOrNull(3));
assertNull(list1.getListOrNull(4));
assertEquals(20, list1.getNumber(2)); assertEquals(20, list1.getNumber(2));
assertNull(list1.getStringOrNull(20));
assertNull(list1.getStringOrNull(3));
assertNotNull(list1.getLiteral(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 // Test getList() and getListOrNull() with list value
assertEquals(list1, list2.getList(0)); assertEquals(list1, list2.getList(0));
assertEquals(list1, list2.getListOrNull(0)); assertEquals(list1, list2.getListOrNull(0));
assertNull(list2.getListOrNull(20)); assertNull(list2.getListOrNull(20));
assertNull(list2.getStringOrNull(20));
} }
} }