Loading tests/telephonytests/src/com/android/internal/telephony/Sms7BitEncodingTranslatorTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -16,25 +16,40 @@ package com.android.internal.telephony; import android.os.IBinder; import android.os.ServiceManager; import android.telephony.SmsManager; import android.telephony.TelephonyManager; import android.test.suitebuilder.annotation.SmallTest; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import java.io.UnsupportedEncodingException; import java.util.HashMap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; public class Sms7BitEncodingTranslatorTest extends TelephonyTest { @Mock HashMap<String, IBinder> mServiceCache; @Mock IBinder mBinder; @Before public void setUp() throws Exception { logd("+Setup!"); super.setUp(getClass().getSimpleName()); doReturn(mBinder).when(mServiceCache).get(anyString()); replaceInstance(ServiceManager.class, "sCache", null, mServiceCache); logd("-Setup!"); } Loading Loading @@ -80,6 +95,7 @@ public class Sms7BitEncodingTranslatorTest extends TelephonyTest { public void testCdmaTranslate() { TelephonyManager telephonyManager = TelephonyManager.from(mContext); doReturn(PhoneConstants.PHONE_TYPE_CDMA).when(telephonyManager).getCurrentPhoneType(); String s = null; Loading tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -255,6 +255,8 @@ public abstract class TelephonyTest { "mCdmaSubscriptionSourceChangedRegistrants", mCdmaSSM, mRegistrantList); replaceInstance(SimulatedCommandsVerifier.class, "sInstance", null, mSimulatedCommandsVerifier); replaceInstance(Singleton.class, "mInstance", mIActivityManagerSingleton, mIActivityManager); mSimulatedCommands = new SimulatedCommands(); mContextFixture = new ContextFixture(); Loading Loading @@ -325,7 +327,6 @@ public abstract class TelephonyTest { doReturn(true).when(mImsManagerInstances).containsKey(anyInt()); doReturn(mPhone).when(mInboundSmsHandler).getPhone(); doReturn(mTelephonyEventLog).when(mTelephonyEventLogInstances).get(anyInt()); doReturn(mIActivityManager).when(mIActivityManagerSingleton).get(); doReturn(mImsCallProfile).when(mImsCall).getCallProfile(); setReady(false); Loading Loading
tests/telephonytests/src/com/android/internal/telephony/Sms7BitEncodingTranslatorTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -16,25 +16,40 @@ package com.android.internal.telephony; import android.os.IBinder; import android.os.ServiceManager; import android.telephony.SmsManager; import android.telephony.TelephonyManager; import android.test.suitebuilder.annotation.SmallTest; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import java.io.UnsupportedEncodingException; import java.util.HashMap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; public class Sms7BitEncodingTranslatorTest extends TelephonyTest { @Mock HashMap<String, IBinder> mServiceCache; @Mock IBinder mBinder; @Before public void setUp() throws Exception { logd("+Setup!"); super.setUp(getClass().getSimpleName()); doReturn(mBinder).when(mServiceCache).get(anyString()); replaceInstance(ServiceManager.class, "sCache", null, mServiceCache); logd("-Setup!"); } Loading Loading @@ -80,6 +95,7 @@ public class Sms7BitEncodingTranslatorTest extends TelephonyTest { public void testCdmaTranslate() { TelephonyManager telephonyManager = TelephonyManager.from(mContext); doReturn(PhoneConstants.PHONE_TYPE_CDMA).when(telephonyManager).getCurrentPhoneType(); String s = null; Loading
tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -255,6 +255,8 @@ public abstract class TelephonyTest { "mCdmaSubscriptionSourceChangedRegistrants", mCdmaSSM, mRegistrantList); replaceInstance(SimulatedCommandsVerifier.class, "sInstance", null, mSimulatedCommandsVerifier); replaceInstance(Singleton.class, "mInstance", mIActivityManagerSingleton, mIActivityManager); mSimulatedCommands = new SimulatedCommands(); mContextFixture = new ContextFixture(); Loading Loading @@ -325,7 +327,6 @@ public abstract class TelephonyTest { doReturn(true).when(mImsManagerInstances).containsKey(anyInt()); doReturn(mPhone).when(mInboundSmsHandler).getPhone(); doReturn(mTelephonyEventLog).when(mTelephonyEventLogInstances).get(anyInt()); doReturn(mIActivityManager).when(mIActivityManagerSingleton).get(); doReturn(mImsCallProfile).when(mImsCall).getCallProfile(); setReady(false); Loading