summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Blank <mblank@google.com>2012-09-13 16:53:49 -0700
committerMarc Blank <mblank@google.com>2012-09-13 17:15:17 -0700
commitde8a66404acd36544e3559404f6542473224aa4a (patch)
tree50136b577699026e2260d83530681824eee567a5 /tests
parent88ab988516f207b5c75fdd2d26e28dc7917e66b3 (diff)
downloadpackages_apps_Contacts-de8a66404acd36544e3559404f6542473224aa4a.tar.gz
packages_apps_Contacts-de8a66404acd36544e3559404f6542473224aa4a.tar.bz2
packages_apps_Contacts-de8a66404acd36544e3559404f6542473224aa4a.zip
Allow both AOSP and Google account types for Exchange
* Contacts app had hard-coded the single account type; why do we have to hard-code these names? Bug: 7162923 Change-Id: I7ea201fc961e7abc4e44aa138b8cc002fbb6ed33
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/contacts/RawContactModifierTests.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/src/com/android/contacts/RawContactModifierTests.java b/tests/src/com/android/contacts/RawContactModifierTests.java
index 9254a7e75..8046ed6e7 100644
--- a/tests/src/com/android/contacts/RawContactModifierTests.java
+++ b/tests/src/com/android/contacts/RawContactModifierTests.java
@@ -77,6 +77,8 @@ public class RawContactModifierTests extends AndroidTestCase {
private static final String TEST_ACCOUNT_NAME = "unittest@example.com";
private static final String TEST_ACCOUNT_TYPE = "com.example.unittest";
+ private static final String EXCHANGE_ACCT_TYPE = "com.android.exchange";
+
@Override
public void setUp() {
mContext = getContext();
@@ -770,7 +772,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateWithDisplayNameFromGoogleToExchange1() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(StructuredName.CONTENT_ITEM_TYPE);
ContactsMockContext context = new ContactsMockContext(getContext());
@@ -806,7 +808,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateWithDisplayNameFromGoogleToExchange2() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(StructuredName.CONTENT_ITEM_TYPE);
ContactsMockContext context = new ContactsMockContext(getContext());
@@ -846,7 +848,7 @@ public class RawContactModifierTests extends AndroidTestCase {
}
public void testMigrateWithStructuredNameFromExchangeToGoogle() {
- AccountType oldAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType oldAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
AccountType newAccountType = new GoogleAccountType(getContext(), "");
DataKind kind = newAccountType.getKindForMimetype(StructuredName.CONTENT_ITEM_TYPE);
@@ -891,7 +893,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigratePostalFromGoogleToExchange() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(StructuredPostal.CONTENT_ITEM_TYPE);
RawContactDelta oldState = new RawContactDelta();
@@ -913,7 +915,7 @@ public class RawContactModifierTests extends AndroidTestCase {
}
public void testMigratePostalFromExchangeToGoogle() {
- AccountType oldAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType oldAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
AccountType newAccountType = new GoogleAccountType(getContext(), "");
DataKind kind = newAccountType.getKindForMimetype(StructuredPostal.CONTENT_ITEM_TYPE);
@@ -948,11 +950,11 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateEventFromGoogleToExchange1() {
testMigrateEventCommon(new GoogleAccountType(getContext(), ""),
- new ExchangeAccountType(getContext(), ""));
+ new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE));
}
public void testMigrateEventFromExchangeToGoogle() {
- testMigrateEventCommon(new ExchangeAccountType(getContext(), ""),
+ testMigrateEventCommon(new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE),
new GoogleAccountType(getContext(), ""));
}
@@ -980,7 +982,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateEventFromGoogleToExchange2() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(Event.CONTENT_ITEM_TYPE);
RawContactDelta oldState = new RawContactDelta();
@@ -1012,7 +1014,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateEmailFromGoogleToExchange() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(Email.CONTENT_ITEM_TYPE);
RawContactDelta oldState = new RawContactDelta();
@@ -1062,7 +1064,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateImFromGoogleToExchange() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(Im.CONTENT_ITEM_TYPE);
RawContactDelta oldState = new RawContactDelta();
@@ -1129,7 +1131,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigratePhoneFromGoogleToExchange() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(Phone.CONTENT_ITEM_TYPE);
// Create 5 numbers.
@@ -1207,7 +1209,7 @@ public class RawContactModifierTests extends AndroidTestCase {
public void testMigrateOrganizationFromGoogleToExchange() {
AccountType oldAccountType = new GoogleAccountType(getContext(), "");
- AccountType newAccountType = new ExchangeAccountType(getContext(), "");
+ AccountType newAccountType = new ExchangeAccountType(getContext(), "", EXCHANGE_ACCT_TYPE);
DataKind kind = newAccountType.getKindForMimetype(Organization.CONTENT_ITEM_TYPE);
RawContactDelta oldState = new RawContactDelta();