diff options
author | KOUSHIK PANUGANTI <kpanuganti@google.com> | 2019-03-15 15:46:39 -0700 |
---|---|---|
committer | Koushik Panuganti <kpanuganti@google.com> | 2019-03-15 22:49:25 +0000 |
commit | 7d11166c1a96834ae89596f8e76b5b6ee13f44cf (patch) | |
tree | 012158706020f1237894fb38bda809b5ba1102e2 /tests/src/com/android/server/telecom | |
parent | 3e9bdebbf785531c80fbff7074cddac7f1080edd (diff) | |
download | android_packages_services_Telecomm-7d11166c1a96834ae89596f8e76b5b6ee13f44cf.tar.gz android_packages_services_Telecomm-7d11166c1a96834ae89596f8e76b5b6ee13f44cf.tar.bz2 android_packages_services_Telecomm-7d11166c1a96834ae89596f8e76b5b6ee13f44cf.zip |
Migrate packages/services/Telecomm to androidx.test
See go/jetpack-test-android-migration
Test: m -j checkbuild
Change-Id: I4aae82c4b41d6dce4e863df583b2ab28f8a5cabf
Diffstat (limited to 'tests/src/com/android/server/telecom')
9 files changed, 87 insertions, 81 deletions
diff --git a/tests/src/com/android/server/telecom/tests/AnalyticsTests.java b/tests/src/com/android/server/telecom/tests/AnalyticsTests.java index 9d64f187..1fad3f75 100644 --- a/tests/src/com/android/server/telecom/tests/AnalyticsTests.java +++ b/tests/src/com/android/server/telecom/tests/AnalyticsTests.java @@ -16,10 +16,18 @@ package com.android.server.telecom.tests; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; + import android.content.Context; import android.os.Build; -import android.os.Handler; -import android.os.Looper; import android.telecom.CallAudioState; import android.telecom.Connection; import android.telecom.DisconnectCause; @@ -31,11 +39,12 @@ import android.telecom.TelecomAnalytics; import android.telecom.TelecomManager; import android.telecom.VideoCallImpl; import android.telecom.VideoProfile; -import android.support.test.filters.FlakyTest; import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; import android.util.Base64; +import androidx.test.filters.FlakyTest; + import com.android.internal.util.IndentingPrintWriter; import com.android.server.telecom.Analytics; import com.android.server.telecom.CallAudioRouteStateMachine; @@ -59,16 +68,6 @@ import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; - @RunWith(JUnit4.class) public class AnalyticsTests extends TelecomSystemTest { @Override diff --git a/tests/src/com/android/server/telecom/tests/BasicCallTests.java b/tests/src/com/android/server/telecom/tests/BasicCallTests.java index 36eea89d..95ca3f3b 100644 --- a/tests/src/com/android/server/telecom/tests/BasicCallTests.java +++ b/tests/src/com/android/server/telecom/tests/BasicCallTests.java @@ -53,10 +53,11 @@ import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; import android.telecom.VideoProfile; -import android.support.test.filters.FlakyTest; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; +import androidx.test.filters.FlakyTest; + import com.android.internal.telecom.IInCallAdapter; import com.android.internal.telephony.CallerInfo; @@ -67,6 +68,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -76,8 +78,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.TimeUnit; -import org.mockito.ArgumentCaptor; - /** * Performs various basic call tests in Telecom. */ diff --git a/tests/src/com/android/server/telecom/tests/CallExtrasTest.java b/tests/src/com/android/server/telecom/tests/CallExtrasTest.java index 3bedb75c..b97f819e 100644 --- a/tests/src/com/android/server/telecom/tests/CallExtrasTest.java +++ b/tests/src/com/android/server/telecom/tests/CallExtrasTest.java @@ -16,16 +16,22 @@ package com.android.server.telecom.tests; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import android.os.Bundle; import android.telecom.Call; import android.telecom.Conference; import android.telecom.Connection; import android.telecom.InCallService; import android.telecom.ParcelableCall; -import android.support.test.filters.FlakyTest; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; +import androidx.test.filters.FlakyTest; + import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -35,11 +41,6 @@ import org.junit.runners.JUnit4; import java.util.ArrayList; import java.util.Arrays; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - /** * Tests the {@link Connection} and {@link Call} extras functionality. */ diff --git a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java index c83c3f39..751e8fb6 100644 --- a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java +++ b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java @@ -17,6 +17,20 @@ package com.android.server.telecom.tests; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import android.content.ComponentName; import android.content.ContentProvider; import android.content.ContentValues; @@ -34,7 +48,6 @@ import android.os.UserHandle; import android.os.UserManager; import android.provider.CallLog; import android.provider.CallLog.Calls; -import android.support.test.filters.FlakyTest; import android.telecom.DisconnectCause; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; @@ -44,6 +57,8 @@ import android.telephony.PhoneNumberUtils; import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; +import androidx.test.filters.FlakyTest; + import com.android.server.telecom.Call; import com.android.server.telecom.CallLogManager; import com.android.server.telecom.CallState; @@ -52,20 +67,6 @@ import com.android.server.telecom.MissedCallNotifier; import com.android.server.telecom.PhoneAccountRegistrar; import com.android.server.telecom.TelephonyUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java b/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java index 74d07d80..e26d7e56 100644 --- a/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java +++ b/tests/src/com/android/server/telecom/tests/CallerInfoLookupHelperTest.java @@ -16,14 +16,26 @@ package com.android.server.telecom.tests; +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Matchers.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; -import android.support.test.InstrumentationRegistry; -import android.test.suitebuilder.annotation.SmallTest; import android.telecom.Logging.Session; +import android.test.suitebuilder.annotation.SmallTest; + +import androidx.test.InstrumentationRegistry; import com.android.internal.telephony.CallerInfo; import com.android.internal.telephony.CallerInfoAsyncQuery; @@ -43,17 +55,6 @@ import java.io.FileNotFoundException; import java.io.InputStream; import java.util.concurrent.CountDownLatch; -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; -import static org.mockito.Matchers.isNull; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - @RunWith(JUnit4.class) public class CallerInfoLookupHelperTest extends TelecomTestCase { @Mock Context mContext; diff --git a/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java b/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java index 81263aeb..08d9a472 100644 --- a/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java +++ b/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java @@ -16,14 +16,26 @@ package com.android.server.telecom.tests; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.eq; +import static org.mockito.Matchers.isNull; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; -import android.support.test.InstrumentationRegistry; import android.test.suitebuilder.annotation.SmallTest; +import androidx.test.InstrumentationRegistry; + import com.android.server.telecom.ContactsAsyncHelper; import org.junit.Before; @@ -35,17 +47,6 @@ import org.mockito.ArgumentCaptor; import java.io.FileNotFoundException; import java.io.InputStream; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; -import static org.mockito.Matchers.isNull; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; - @RunWith(JUnit4.class) public class ContactsAsyncHelperTest extends TelecomTestCase { private static final Uri SAMPLE_CONTACT_PHOTO_URI = Uri.parse( diff --git a/tests/src/com/android/server/telecom/tests/InCallTonePlayerTest.java b/tests/src/com/android/server/telecom/tests/InCallTonePlayerTest.java index 7cf8edb8..cb0497a1 100644 --- a/tests/src/com/android/server/telecom/tests/InCallTonePlayerTest.java +++ b/tests/src/com/android/server/telecom/tests/InCallTonePlayerTest.java @@ -26,16 +26,17 @@ import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import android.media.MediaPlayer; +import android.media.ToneGenerator; +import android.test.suitebuilder.annotation.SmallTest; + +import androidx.test.filters.FlakyTest; + import com.android.server.telecom.CallAudioManager; import com.android.server.telecom.CallAudioRoutePeripheralAdapter; import com.android.server.telecom.InCallTonePlayer; import com.android.server.telecom.TelecomSystem; -import android.media.MediaPlayer; -import android.media.ToneGenerator; -import android.support.test.filters.FlakyTest; -import android.test.suitebuilder.annotation.SmallTest; - import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java index f8acb9d2..9fdf08d0 100644 --- a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java +++ b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java @@ -16,6 +16,16 @@ package com.android.server.telecom.tests; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.when; + import android.content.ComponentName; import android.content.Context; import android.graphics.BitmapFactory; @@ -27,7 +37,6 @@ import android.os.Parcel; import android.os.Process; import android.os.UserHandle; import android.os.UserManager; -import android.support.test.InstrumentationRegistry; import android.telecom.Log; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; @@ -35,6 +44,8 @@ import android.telecom.TelecomManager; import android.test.suitebuilder.annotation.MediumTest; import android.util.Xml; +import androidx.test.InstrumentationRegistry; + import com.android.internal.telecom.IConnectionService; import com.android.internal.util.FastXmlSerializer; import com.android.server.telecom.DefaultDialerCache; @@ -62,16 +73,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.when; - @RunWith(JUnit4.class) public class PhoneAccountRegistrarTest extends TelecomTestCase { diff --git a/tests/src/com/android/server/telecom/tests/TelecomTestCase.java b/tests/src/com/android/server/telecom/tests/TelecomTestCase.java index c356cb40..637895b2 100644 --- a/tests/src/com/android/server/telecom/tests/TelecomTestCase.java +++ b/tests/src/com/android/server/telecom/tests/TelecomTestCase.java @@ -16,13 +16,14 @@ package com.android.server.telecom.tests; -import org.mockito.MockitoAnnotations; - import android.content.Context; import android.os.Handler; -import android.support.test.InstrumentationRegistry; import android.telecom.Log; +import androidx.test.InstrumentationRegistry; + +import org.mockito.MockitoAnnotations; + import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; |