diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-09-13 17:27:42 -0700 |
---|---|---|
committer | Chiao Cheng <chiaocheng@google.com> | 2013-09-14 13:27:02 -0700 |
commit | fb0a934ad90f1855787563eb80f2c8fff7f640ac (patch) | |
tree | 1d8dc5e98e56ecc7f6dec0ce6dcfe388a6c797a2 /tests | |
parent | b34d7c3923031453f7e34805bed32d0667d7dde7 (diff) |
Follow up on build break to fix unit tests.
Change-Id: I82b7fa50601f6dad60038fd1b9c5f0aad2f374f5
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java | 10 | ||||
-rw-r--r-- | tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java | 5 | ||||
-rw-r--r-- | tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java (renamed from tests/src/com/android/dialer/calllog/TestPhoneNumberHelper.java) | 17 |
3 files changed, 17 insertions, 15 deletions
diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index 05c59a77f..6a9817f26 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -26,8 +26,7 @@ import android.view.View; import android.widget.TextView; import com.android.dialer.calllog.CallTypeHelper; -import com.android.dialer.calllog.PhoneNumberHelper; -import com.android.dialer.calllog.TestPhoneNumberHelper; +import com.android.dialer.calllog.TestPhoneNumberUtilsWrapper; import com.android.dialer.util.LocaleTestUtils; import java.util.GregorianCalendar; @@ -58,7 +57,6 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { /** The views to fill. */ private PhoneCallDetailsViews mViews; private TextView mNameView; - private PhoneNumberHelper mPhoneNumberHelper; private LocaleTestUtils mLocaleTestUtils; @Override @@ -67,8 +65,9 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { Context context = getContext(); Resources resources = context.getResources(); CallTypeHelper callTypeHelper = new CallTypeHelper(resources); - mPhoneNumberHelper = new TestPhoneNumberHelper(resources, TEST_VOICEMAIL_NUMBER); - mHelper = new PhoneCallDetailsHelper(resources, callTypeHelper, mPhoneNumberHelper); + final TestPhoneNumberUtilsWrapper phoneUtils = new TestPhoneNumberUtilsWrapper( + TEST_VOICEMAIL_NUMBER); + mHelper = new PhoneCallDetailsHelper(resources, callTypeHelper, phoneUtils); mHelper.setCurrentTimeForTest( new GregorianCalendar(2011, 5, 4, 13, 0, 0).getTimeInMillis()); mViews = PhoneCallDetailsViews.createForTest(context); @@ -83,7 +82,6 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { mNameView = null; mViews = null; mHelper = null; - mPhoneNumberHelper = null; super.tearDown(); } diff --git a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java index 1b793bc65..bb940edca 100644 --- a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java @@ -57,9 +57,10 @@ public class CallLogListItemHelperTest extends AndroidTestCase { Context context = getContext(); Resources resources = context.getResources(); CallTypeHelper callTypeHelper = new CallTypeHelper(resources); - mPhoneNumberHelper = new TestPhoneNumberHelper(resources, TEST_VOICEMAIL_NUMBER); + final TestPhoneNumberUtilsWrapper phoneUtils = new TestPhoneNumberUtilsWrapper( + TEST_VOICEMAIL_NUMBER); PhoneCallDetailsHelper phoneCallDetailsHelper = new PhoneCallDetailsHelper( - resources, callTypeHelper, mPhoneNumberHelper); + resources, callTypeHelper, phoneUtils); mHelper = new CallLogListItemHelper(phoneCallDetailsHelper, mPhoneNumberHelper, resources); mViews = CallLogListItemViews.createForTest(context); } diff --git a/tests/src/com/android/dialer/calllog/TestPhoneNumberHelper.java b/tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java index 2671a7151..0dbd91479 100644 --- a/tests/src/com/android/dialer/calllog/TestPhoneNumberHelper.java +++ b/tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 The Android Open Source Project + * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License */ package com.android.dialer.calllog; @@ -19,15 +19,18 @@ package com.android.dialer.calllog; import android.content.res.Resources; /** - * Modified version of {@link PhoneNumberHelper} to be used in tests that allows injecting the - * voicemail number. + * Modified version of {@link com.android.dialer.calllog.PhoneNumberHelper} to be used in tests + * that allows injecting the voicemail number. */ -public final class TestPhoneNumberHelper extends PhoneNumberHelper { +public final class TestPhoneNumberUtilsWrapper extends PhoneNumberUtilsWrapper { private CharSequence mVoicemailNumber; - public TestPhoneNumberHelper(Resources resources, CharSequence voicemailNumber) { - super(resources); + public TestPhoneNumberUtilsWrapper(CharSequence voicemailNumber) { mVoicemailNumber = voicemailNumber; } + @Override + public boolean isVoicemailNumber(CharSequence number) { + return mVoicemailNumber.equals(number); + } } |