FileDocCategorySizeDatePackage
CameraUtilsRuntimeExceptionTest.javaAPI DocAndroid 5.1 API2784Thu Mar 12 22:22:30 GMT 2015com.android.mediaframeworktest.unit

CameraUtilsRuntimeExceptionTest

public class CameraUtilsRuntimeExceptionTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtestCameraRuntimeException1()

        try {
            CameraRuntimeException runtimeExc = new CameraRuntimeException(12345);
            throw runtimeExc.asChecked();
        } catch (CameraAccessException e) {
            assertEquals(12345, e.getReason());
            assertNull(e.getMessage());
            assertNull(e.getCause());
        }
    
public voidtestCameraRuntimeException2()

        try {
            CameraRuntimeException runtimeExc = new CameraRuntimeException(12345, "Hello");
            throw runtimeExc.asChecked();
        } catch (CameraAccessException e) {
            assertEquals(12345, e.getReason());
            assertEquals("Hello", e.getMessage());
            assertNull(e.getCause());
        }
    
public voidtestCameraRuntimeException3()

        Throwable cause = new IllegalStateException("For great justice");
        try {
            CameraRuntimeException runtimeExc = new CameraRuntimeException(12345, cause);
            throw runtimeExc.asChecked();
        } catch (CameraAccessException e) {
            assertEquals(12345, e.getReason());
            assertNull(e.getMessage());
            assertEquals(cause, e.getCause());
        }
    
public voidtestCameraRuntimeException4()

        Throwable cause = new IllegalStateException("For great justice");
        try {
            CameraRuntimeException runtimeExc = new CameraRuntimeException(12345, "Hello", cause);
            throw runtimeExc.asChecked();
        } catch (CameraAccessException e) {
            assertEquals(12345, e.getReason());
            assertEquals("Hello", e.getMessage());
            assertEquals(cause, e.getCause());
        }