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

MediaRecorderSetOutputFormatStateUnitTest

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

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

param
stateErrors the MediaRecorderStateErrors to check against.

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

        recorder.setOutputFormat(MediaRecorderStateUnitTestTemplate.OUTPUT_FORMAT);
    
public voidtestSetOutputFormat()

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

        return "setOutputFormat()";