FileDocCategorySizeDatePackage
BluetoothRebootStressTest.javaAPI DocAndroid 5.1 API3043Thu Mar 12 22:22:12 GMT 2015android.bluetooth

BluetoothRebootStressTest

public class BluetoothRebootStressTest extends android.test.InstrumentationTestCase
Instrumentation test case for stress test involving rebooting the device.

This test case tests that bluetooth is enabled after a device reboot. Because the device will reboot, the instrumentation must be driven by a script on the host side.

Fields Summary
private static final String
TAG
private static final String
OUTPUT_FILE
private BluetoothTestUtils
mTestUtils
Constructors Summary
Methods Summary
protected voidsetUp()


    
         
        super.setUp();

        Context context = getInstrumentation().getTargetContext();
        mTestUtils = new BluetoothTestUtils(context, TAG, OUTPUT_FILE);
    
protected voidtearDown()

        super.tearDown();

        mTestUtils.close();
    
public voidtestMiddleNoToggle()
Test method used in the middle iterations of the test to check if bluetooth is on. Does not toggle bluetooth after the check. Assumes that bluetooth has been turned on by {@code #testStart()}

        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

        assertTrue(adapter.isEnabled());
    
public voidtestMiddleToggle()
Test method used in the middle iterations of the test to check if bluetooth is on. Toggles bluetooth after the check. Assumes that bluetooth has been turned on by {@code #testStart()}

        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

        assertTrue(adapter.isEnabled());

        mTestUtils.disable(adapter);
        mTestUtils.enable(adapter);
    
public voidtestStart()
Test method used to start the test by turning bluetooth on.

        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
        mTestUtils.enable(adapter);
    
public voidtestStop()
Test method used in the stop the test by turning bluetooth off. Assumes that bluetooth has been turned on by {@code #testStart()}

        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

        assertTrue(adapter.isEnabled());

        mTestUtils.disable(adapter);