diff options
author | Tony Mantler <nicoya@google.com> | 2014-04-15 11:50:20 -0700 |
---|---|---|
committer | Tony Mantler <nicoya@google.com> | 2014-04-15 11:50:20 -0700 |
commit | 845db9711917ad8936926fc7a1a179fade8e00d5 (patch) | |
tree | f9a95d7cd39ae327fcc50e71a5b27064257103dd /tests | |
parent | 3dd85723a1af5537e23e4b05bdc361cce9cd42be (diff) | |
download | android_packages_apps_Email-845db9711917ad8936926fc7a1a179fade8e00d5.tar.gz android_packages_apps_Email-845db9711917ad8936926fc7a1a179fade8e00d5.tar.bz2 android_packages_apps_Email-845db9711917ad8936926fc7a1a179fade8e00d5.zip |
Fix some missed class renames
Change-Id: I82c9e21049096525cc55fa57e5cc307844014832
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/email/provider/ProviderTests.java | 15 | ||||
-rw-r--r-- | tests/src/com/android/emailcommon/utility/UtilityMediumTests.java | 39 |
2 files changed, 28 insertions, 26 deletions
diff --git a/tests/src/com/android/email/provider/ProviderTests.java b/tests/src/com/android/email/provider/ProviderTests.java index 5ba761a7d..656bc97b4 100644 --- a/tests/src/com/android/email/provider/ProviderTests.java +++ b/tests/src/com/android/email/provider/ProviderTests.java @@ -512,8 +512,8 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> { // expectedAttachmentSizes array must // be kept sorted by size (ascending) for this test to work properly c = mMockContext.getContentResolver().query(Attachment.CONTENT_URI, - Attachment.CONTENT_PROJECTION, Attachment.MESSAGE_KEY + "=?", - new String[] {String.valueOf(message3Id)}, Attachment.SIZE); + Attachment.CONTENT_PROJECTION, AttachmentColumns.MESSAGE_KEY + "=?", + new String[] {String.valueOf(message3Id)}, AttachmentColumns.SIZE); int numAtts = c.getCount(); assertEquals(3, numAtts); int i = 0; @@ -564,8 +564,8 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> { // expectedAttachmentSizes array must // be kept sorted by size (ascending) for this test to work properly c = mMockContext.getContentResolver().query(Attachment.CONTENT_URI, - Attachment.CONTENT_PROJECTION, Attachment.MESSAGE_KEY + "=?", - new String[] {String.valueOf(message4Id)}, Attachment.SIZE); + Attachment.CONTENT_PROJECTION, AttachmentColumns.MESSAGE_KEY + "=?", + new String[] {String.valueOf(message4Id)}, AttachmentColumns.SIZE); int numAtts = c.getCount(); assertEquals(3, numAtts); int i = 0; @@ -1413,7 +1413,7 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> { assertEquals(6, numMessages); ContentValues cv = new ContentValues(); - cv.put(Message.SERVER_ID, "SERVER_ID"); + cv.put(MessageColumns.SERVER_ID, "SERVER_ID"); ContentResolver resolver = mMockContext.getContentResolver(); // Update two messages @@ -1598,7 +1598,7 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> { // order Uri uri = ContentUris.withAppendedId(Attachment.MESSAGE_ID_URI, 1); Cursor c = mMockContext.getContentResolver() - .query(uri, Attachment.CONTENT_PROJECTION, null, null, Attachment.SIZE); + .query(uri, Attachment.CONTENT_PROJECTION, null, null, AttachmentColumns.SIZE); assertEquals(2, c.getCount()); try { @@ -1635,7 +1635,8 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> { // (the attachments that are set for message id=2). Note order-by size // to simplify test. Cursor c = mockResolver.query( - Attachment.CONTENT_URI, Attachment.CONTENT_PROJECTION, null, null, Attachment.SIZE); + Attachment.CONTENT_URI, Attachment.CONTENT_PROJECTION, null, null, + AttachmentColumns.SIZE); assertEquals(2, c.getCount()); try { diff --git a/tests/src/com/android/emailcommon/utility/UtilityMediumTests.java b/tests/src/com/android/emailcommon/utility/UtilityMediumTests.java index 396cf10ad..0eee01e21 100644 --- a/tests/src/com/android/emailcommon/utility/UtilityMediumTests.java +++ b/tests/src/com/android/emailcommon/utility/UtilityMediumTests.java @@ -26,6 +26,7 @@ import com.android.email.provider.EmailProvider; import com.android.email.provider.ProviderTestUtils; import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.EmailContent; +import com.android.emailcommon.provider.EmailContent.AccountColumns; import com.android.emailcommon.provider.EmailContent.Attachment; import com.android.emailcommon.provider.EmailContent.Message; import com.android.emailcommon.provider.Mailbox; @@ -155,27 +156,27 @@ public class UtilityMediumTests extends ProviderTestCase2<EmailProvider> { // case 1. Account found assertEquals((Long) account2.mId, Utility.getFirstRowLong( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"X%"}, - Account.DISPLAY_NAME, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"X%"}, + AccountColumns.DISPLAY_NAME, EmailContent.ID_PROJECTION_COLUMN)); // different sort order assertEquals((Long) account3.mId, Utility.getFirstRowLong( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"X%"}, - Account.DISPLAY_NAME + " desc", + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"X%"}, + AccountColumns.DISPLAY_NAME + " desc", EmailContent.ID_PROJECTION_COLUMN)); // case 2. no row found assertEquals(null, Utility.getFirstRowLong( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, null, EmailContent.ID_PROJECTION_COLUMN)); // case 3. no row found with default value assertEquals((Long) (-1L), Utility.getFirstRowLong( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, null, EmailContent.ID_PROJECTION_COLUMN, -1L)); } @@ -188,33 +189,33 @@ public class UtilityMediumTests extends ProviderTestCase2<EmailProvider> { // case 1. Account found assertEquals((Integer)(int) account2.mId, Utility.getFirstRowInt( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"X%"}, - Account.DISPLAY_NAME, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"X%"}, + AccountColumns.DISPLAY_NAME, EmailContent.ID_PROJECTION_COLUMN)); // different sort order assertEquals((Integer)(int) account3.mId, Utility.getFirstRowInt( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"X%"}, - Account.DISPLAY_NAME + " desc", + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"X%"}, + AccountColumns.DISPLAY_NAME + " desc", EmailContent.ID_PROJECTION_COLUMN)); // case 2. no row found assertEquals(null, Utility.getFirstRowInt( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, null, EmailContent.ID_PROJECTION_COLUMN)); // case 3. no row found with default value assertEquals((Integer) (-1), Utility.getFirstRowInt( mMockContext, Account.CONTENT_URI, EmailContent.ID_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, null, EmailContent.ID_PROJECTION_COLUMN, -1)); } public void testGetFirstRowString() { - final String[] DISPLAY_NAME_PROJECTION = new String[] {Account.DISPLAY_NAME}; + final String[] DISPLAY_NAME_PROJECTION = new String[] {AccountColumns.DISPLAY_NAME}; Account account1 = ProviderTestUtils.setupAccount("1", true, mMockContext); Account account2 = ProviderTestUtils.setupAccount("X1", true, mMockContext); @@ -223,25 +224,25 @@ public class UtilityMediumTests extends ProviderTestCase2<EmailProvider> { // case 1. Account found assertEquals(account2.mDisplayName, Utility.getFirstRowString( mMockContext, Account.CONTENT_URI, DISPLAY_NAME_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"X%"}, - Account.DISPLAY_NAME, 0)); + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"X%"}, + AccountColumns.DISPLAY_NAME, 0)); // different sort order assertEquals(account3.mDisplayName, Utility.getFirstRowString( mMockContext, Account.CONTENT_URI, DISPLAY_NAME_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"X%"}, - Account.DISPLAY_NAME + " desc", 0)); + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"X%"}, + AccountColumns.DISPLAY_NAME + " desc", 0)); // case 2. no row found assertEquals(null, Utility.getFirstRowString( mMockContext, Account.CONTENT_URI, DISPLAY_NAME_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, null, 0)); // case 3. no row found with default value assertEquals("-", Utility.getFirstRowString( mMockContext, Account.CONTENT_URI, DISPLAY_NAME_PROJECTION, - Account.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, + AccountColumns.DISPLAY_NAME + " like :1", new String[] {"NO SUCH ACCOUNT"}, null, 0, "-")); } } |