12f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu/* 22f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * Copyright (C) 2016 The Android Open Source Project 32f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * 42f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * Licensed under the Apache License, Version 2.0 (the "License"); 52f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * you may not use this file except in compliance with the License. 62f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * You may obtain a copy of the License at 72f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * 82f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * http://www.apache.org/licenses/LICENSE-2.0 92f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * 102f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * Unless required by applicable law or agreed to in writing, software 112f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * distributed under the License is distributed on an "AS IS" BASIS, 122f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 132f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * See the License for the specific language governing permissions and 142f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu * limitations under the License. 152f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu */ 162f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxupackage com.android.internal.telephony; 172f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu 182f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxuimport android.test.suitebuilder.annotation.SmallTest; 192f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxuimport org.junit.After; 202f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxuimport org.junit.Test; 212f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxuimport static org.junit.Assert.assertEquals; 222f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu 232f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxupublic class CallStateExceptionTest { 242f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu private CallStateException mCallStateException; 252f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu 262f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu @After 272f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu public void tearDown() throws Exception { 282f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu mCallStateException = null; 292f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu } 302f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu 312f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu @Test 322f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu @SmallTest 332f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu public void testCallStateExceptionDefault() { 342f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu mCallStateException = new CallStateException("sanity test"); 35703e603fecd2a07e232afe1e2b277fd0a786237bfionaxu assertEquals("sanity test", mCallStateException.getMessage()); 36703e603fecd2a07e232afe1e2b277fd0a786237bfionaxu assertEquals(mCallStateException.ERROR_INVALID, mCallStateException.getError()); 372f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu } 382f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu 392f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu @Test 402f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu @SmallTest 412f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu public void testCallStateExceptionWithErrCode() { 422f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu mCallStateException = new CallStateException(mCallStateException.ERROR_DISCONNECTED, 432f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu "sanity test with err code"); 44703e603fecd2a07e232afe1e2b277fd0a786237bfionaxu assertEquals("sanity test with err code", mCallStateException.getMessage()); 45703e603fecd2a07e232afe1e2b277fd0a786237bfionaxu assertEquals(mCallStateException.ERROR_DISCONNECTED, mCallStateException.getError()); 462f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu } 472f2dba9413a3f14da0bcf45031986eb78f007dd8fionaxu} 48