// Path: tests/com/thoughtworks/calabash/android/IT/AllActionsIT.java
// public static final String EMULATOR = "emulator-5554";


import com.thoughtworks.calabash.android.*;
import org.apache.commons.io.FileUtils;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.*;
import org.junit.rules.ExpectedException;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static com.thoughtworks.calabash.android.IT.AllActionsIT.EMULATOR;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
    }

    @Test
    public void shouldThrowExceptionIfSerialIsGivenWhenNotStarted() throws CalabashException {
        String serial = "emulator-x";
        expectedException.expect(CalabashException.class);
        expectedException.expectMessage(String.format("%s not found in the device list, installation failed", serial));

        configuration.setSerial(serial);
        AndroidRunner androidRunner = new AndroidRunner(tempAndroidApkPath.getAbsolutePath(), configuration);
        androidRunner.setup();
        androidRunner.start();
    }

    @Test
    public void shouldInstallAppOnDeviceWithName() throws CalabashException {
        configuration.setDeviceName("device");
        configuration.setShouldReinstallApp(true);
        AndroidRunner androidRunner = new AndroidRunner(tempAndroidApkPath.getAbsolutePath(), configuration);

        androidRunner.setup();
        AndroidApplication application = androidRunner.start();

        assertTrue(TestUtils.isAppInstalled(packageName, application.getInstalledOnSerial()));
        assertTrue(TestUtils.isMainActivity(application, "MyActivity"));
    }

    @Test
    public void shouldInstallApplicationIfSerialIsProvided() throws CalabashException {
        //note: emulator should be launched with serial 'EMULATOR
// Path: tests/com/thoughtworks/calabash/android/IT/AllActionsIT.java
// public static final String EMULATOR = "emulator-5554";


// Path: tests/com/thoughtworks/calabash/android/IT/AndroidRunnerIT.java
import com.thoughtworks.calabash.android.*;
import org.apache.commons.io.FileUtils;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.*;
import org.junit.rules.ExpectedException;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static com.thoughtworks.calabash.android.IT.AllActionsIT.EMULATOR;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

    }

    @Test
    public void shouldThrowExceptionIfSerialIsGivenWhenNotStarted() throws CalabashException {
        String serial = "emulator-x";
        expectedException.expect(CalabashException.class);
        expectedException.expectMessage(String.format("%s not found in the device list, installation failed", serial));

        configuration.setSerial(serial);
        AndroidRunner androidRunner = new AndroidRunner(tempAndroidApkPath.getAbsolutePath(), configuration);
        androidRunner.setup();
        androidRunner.start();
    }

    @Test
    public void shouldInstallAppOnDeviceWithName() throws CalabashException {
        configuration.setDeviceName("device");
        configuration.setShouldReinstallApp(true);
        AndroidRunner androidRunner = new AndroidRunner(tempAndroidApkPath.getAbsolutePath(), configuration);

        androidRunner.setup();
        AndroidApplication application = androidRunner.start();

        assertTrue(TestUtils.isAppInstalled(packageName, application.getInstalledOnSerial()));
        assertTrue(TestUtils.isMainActivity(application, "MyActivity"));
    }

    @Test
    public void shouldInstallApplicationIfSerialIsProvided() throws CalabashException {
        //note: emulator should be launched with serial 'EMULATOR
        String serial = EMULATOR;