Fix some missed class renames
Change-Id: I82c9e21049096525cc55fa57e5cc307844014832
This commit is contained in:
parent
3dd85723a1
commit
845db97119
tests/src/com/android
@ -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 {
|
||||
|
@ -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, "-"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user