FileDocCategorySizeDatePackage
MediaRecorderPrepareStateUnitTest.javaAPI DocAndroid 1.5 API2553Wed May 06 22:42:00 BST 2009com.android.mediaframeworktest.unit

MediaRecorderPrepareStateUnitTest

public class MediaRecorderPrepareStateUnitTest extends android.test.AndroidTestCase implements MediaRecorderMethodUnderTest
Unit test class to test the set of valid and invalid states that MediaRecorder.prepare() method can be called.

Fields Summary
private MediaRecorderStateUnitTestTemplate
mTestTemplate
Constructors Summary
Methods Summary
public voidcheckStateErrors(MediaRecorderStateErrors stateErrors)
1. It is valid to call prepare() in the following states: {DataSourceConfigured}. 2. It is invalid to call prepare() in the following states: {Prepared, Initial, Initialized, Recording, Error}

param
stateErrors the MediaRecorderStateErrors to check against.

    
                                                      
        
        // Valid states.
        assertTrue(!stateErrors.errorInDataSourceConfiguredState);
        
        // Invalid states.
        assertTrue(stateErrors.errorInPreparedState);
        assertTrue(stateErrors.errorInRecordingState);
        assertTrue(stateErrors.errorInInitialState);
        assertTrue(stateErrors.errorInInitialStateAfterReset);
        assertTrue(stateErrors.errorInInitialStateAfterStop);
        assertTrue(stateErrors.errorInInitializedState);
        assertTrue(stateErrors.errorInErrorState);
    
public voidinvokeMethodUnderTest(android.media.MediaRecorder recorder)

        try {
            recorder.prepare();
        } catch (IOException exception) {
            throw new RuntimeException();
        }
    
public voidtestPrepare()

        mTestTemplate.runTestOnMethod(this);
    
public java.lang.StringtoString()

        return "prepare()";