congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AndroidExecutionException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.arquillian.droidium.container.api.AndroidExecutionException
constructor

Best Java code snippets using org.arquillian.droidium.container.api.AndroidExecutionException.<init> (Showing top 20 results out of 315)

origin: org.arquillian.container/arquillian-droidium-container-impl

@Override
public String getProperty(String name) throws IOException, AndroidExecutionException {
  try {
    return delegate.getPropertyCacheOrSync(name);
  } catch (TimeoutException e) {
    throw new AndroidExecutionException("Unable to get property '" + name + "' value in given timeout", e);
  } catch (AdbCommandRejectedException e) {
    throw new AndroidExecutionException("Unable to get property '" + name + "' value, command was rejected", e);
  } catch (ShellCommandUnresponsiveException e) {
    throw new AndroidExecutionException("Unable to get property '" + name + "' value, shell is not responsive", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

@Override
public void createPortForwarding(int localPort, int remotePort) throws AndroidExecutionException {
  try {
    delegate.createForward(localPort, remotePort);
  } catch (TimeoutException e) {
    throw new AndroidExecutionException("Unable to forward port (" + localPort + " to " + remotePort
      + ") within given timeout", e);
  } catch (AdbCommandRejectedException e) {
    throw new AndroidExecutionException("Unable to forward port (" + localPort + " to " + remotePort
      + "), command was rejected", e);
  } catch (IOException e) {
    throw new AndroidExecutionException("Unable to forward port (" + localPort + " to " + remotePort + ").", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

@Override
public void removePortForwarding(int localPort, int remotePort) throws AndroidExecutionException {
  try {
    delegate.removeForward(localPort, remotePort);
  } catch (TimeoutException e) {
    throw new AndroidExecutionException("Unable to remove port forwarding (" + localPort + " to " + remotePort
      + ") within given timeout", e);
  } catch (AdbCommandRejectedException e) {
    throw new AndroidExecutionException("Unable to remove port forwarding (" + localPort + " to " + remotePort
      + "), command was rejected", e);
  } catch (IOException e) {
    throw new AndroidExecutionException("Unable to remove port forwarding (" + localPort + " to " + remotePort
      + ").", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container

@Override
public void createPortForwarding(int localPort, int remotePort) throws AndroidExecutionException {
  try {
    delegate.createForward(localPort, remotePort);
  } catch (TimeoutException e) {
    throw new AndroidExecutionException("Unable to forward port (" + localPort + " to " + remotePort
      + ") within given timeout", e);
  } catch (AdbCommandRejectedException e) {
    throw new AndroidExecutionException("Unable to forward port (" + localPort + " to " + remotePort
      + "), command was rejected", e);
  } catch (IOException e) {
    throw new AndroidExecutionException("Unable to forward port (" + localPort + " to " + remotePort + ").", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container

@Override
public String getProperty(String name) throws IOException, AndroidExecutionException {
  try {
    return delegate.getSystemProperty(name).get();
  } catch (ExecutionException e) {
    throw new AndroidExecutionException("Unable to get property '" + name + "' value, not responsive", e);
  } catch (InterruptedException e) {
    throw new AndroidExecutionException("Unable to get property '" + name + "' value, not responsive", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container

@Override
public void uninstallPackage(String packageName) throws AndroidExecutionException {
  try {
    delegate.uninstallPackage(packageName);
  } catch (InstallException e) {
    throw new AndroidExecutionException("Unable to uninstall APK named " + packageName, e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

@Override
public void uninstallPackage(String packageName) throws AndroidExecutionException {
  try {
    delegate.uninstallPackage(packageName);
  } catch (InstallException e) {
    throw new AndroidExecutionException("Unable to uninstall APK named " + packageName, e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

private int createSDCard(final Process sdCardProcess, final ProcessExecutor executor) throws AndroidExecutionException {
  try {
    int created = executor.submit(new Callable<Integer>() {
      @Override
      public Integer call() throws Exception {
        return sdCardProcess.waitFor();
      }
    }).get();
    return created;
  } catch (Exception ex) {
    throw new AndroidExecutionException(ex);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

private int deleteAVD(final Process android, final ProcessExecutor executor) throws AndroidExecutionException {
  try {
    int deleted = executor.submit(new Callable<Integer>() {
      @Override
      public Integer call() throws Exception {
        return android.waitFor();
      }
    }).get();
    return deleted;
  } catch (Exception ex) {
    throw new AndroidExecutionException(ex);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

@Override
public void installPackage(File packageFilePath, boolean reinstall, String... extraArgs) throws AndroidExecutionException {
  Validate.isReadable(packageFilePath.getAbsoluteFile(), "File " + packageFilePath.getAbsoluteFile()
    + " must represent a readable APK file");
  try {
    String retval = delegate.installPackage(packageFilePath.getAbsolutePath(), reinstall, extraArgs);
    if (retval != null) {
      throw new AndroidExecutionException("Unable to install APK from " + packageFilePath.getAbsolutePath()
        + ". Command failed with status code: " + retval);
    }
  } catch (InstallException e) {
    throw new AndroidExecutionException("Unable to install APK from " + packageFilePath.getAbsolutePath(), e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container

@Override
public void installPackage(File packageFilePath, boolean reinstall, String... extraArgs) throws AndroidExecutionException {
  if (!Validate.isReadable(packageFilePath.getAbsoluteFile())) {
    throw new IllegalArgumentException("File " + packageFilePath.getAbsoluteFile() + " must represent a readable APK file");
  }
  try {
    delegate.installPackage(packageFilePath.getAbsolutePath(), reinstall, extraArgs);
  } catch (InstallException e) {
    throw new AndroidExecutionException("Unable to install APK from " + packageFilePath.getAbsolutePath(), e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container

private AndroidDevice getVirtualDeviceByConsolePort(String consolePort) throws AndroidExecutionException {
  Validate.notNullOrEmpty(consolePort, "Console port to get emulator of is a null object or an empty string.");
  List<AndroidDevice> devices = androidBridge.get().getEmulators();
  if (devices == null || devices.size() == 0) {
    throw new AndroidExecutionException("There are no emulators on the Android bridge.");
  }
  for (AndroidDevice device : devices) {
    String deviceConsolePort = device.getConsolePort();
    if (deviceConsolePort != null && deviceConsolePort.equals(consolePort)) {
      logger.log(Level.INFO, "Connecting to virtual device running on console port {0}.", consolePort);
      return device;
    }
  }
  throw new AndroidExecutionException("Unable to get Android emulator running on the console port " + consolePort);
}
origin: org.arquillian.container/arquillian-droidium-container-impl

private AndroidDevice getVirtualDeviceByAvdName(String avdName) throws AndroidExecutionException {
  Validate.notNullOrEmpty(avdName, "AVD name to get emulator of is a null object or an empty string");
  List<AndroidDevice> devices = androidBridge.get().getEmulators();
  if (devices == null || devices.size() == 0) {
    throw new AndroidExecutionException("There are no emulators on the Android bridge.");
  }
  for (AndroidDevice device : devices) {
    String deviceAvdName = device.getAvdName();
    if (deviceAvdName != null && deviceAvdName.equals(avdName)) {
      return device;
    }
  }
  throw new AndroidExecutionException("No running emulator of AVD name " + avdName + ".");
}
origin: org.arquillian.container/arquillian-droidium-container-impl

private AndroidDevice getVirtualDeviceByConsolePort(String consolePort) throws AndroidExecutionException {
  Validate.notNullOrEmpty(consolePort, "Console port to get emulator of is a null object or an empty string.");
  List<AndroidDevice> devices = androidBridge.get().getEmulators();
  if (devices == null || devices.size() == 0) {
    throw new AndroidExecutionException("There are no emulators on the Android bridge.");
  }
  for (AndroidDevice device : devices) {
    String deviceConsolePort = device.getConsolePort();
    if (deviceConsolePort != null && deviceConsolePort.equals(consolePort)) {
      return device;
    }
  }
  throw new AndroidExecutionException("Unable to get Android emulator running on the console port " + consolePort);
}
origin: org.arquillian.container/arquillian-droidium-container-impl

private AndroidDevice getPhysicalDevice() throws AndroidExecutionException {
  String serialId = configuration.get().getSerialId();
  List<AndroidDevice> devices = androidBridge.get().getDevices();
  if (devices == null || devices.size() == 0) {
    throw new AndroidExecutionException("There are no devices on the Android bridge.");
  }
  for (AndroidDevice device : devices) {
    if (!device.isEmulator() && serialId.equals(device.getSerialNumber())) {
      logger.info("Detected physical device with serial ID " + serialId + ".");
      return device;
    }
  }
  throw new AndroidExecutionException("Unable to get device with serial ID " + serialId + ".");
}
origin: org.arquillian.container/arquillian-droidium-container

private AndroidDevice getPhysicalDevice() throws AndroidExecutionException {
  String serialId = configuration.get().getSerialId();
  List<AndroidDevice> devices = androidBridge.get().getDevices();
  if (devices == null || devices.size() == 0) {
    throw new AndroidExecutionException("There are no physical devices on the Android bridge.");
  }
  for (AndroidDevice device : devices) {
    if (!device.isEmulator() && serialId.equals(device.getSerialNumber())) {
      logger.log(Level.INFO, "Connecting to physical device with serial ID {0}", serialId);
      return device;
    }
  }
  throw new AndroidExecutionException("Unable to get device with serial ID " + serialId + ".");
}
origin: org.arquillian.container/arquillian-droidium-container

@Override
public boolean isPackageInstalled(String packageName) throws AndroidExecutionException {
  try {
    String command = "pm list packages -f";
    PackageInstalledMonkey monkey = new PackageInstalledMonkey(packageName);
    executeShellCommand(command, monkey);
    return monkey.isInstalled();
  } catch (Exception e) {
    throw new AndroidExecutionException("Unable to decide if package " + packageName + " is installed or nor", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

@Override
public boolean isPackageInstalled(String packageName) throws AndroidExecutionException {
  try {
    String command = "pm list packages -f";
    PackageInstalledMonkey monkey = new PackageInstalledMonkey(packageName);
    executeShellCommand(command, monkey);
    return monkey.isInstalled();
  } catch (Exception e) {
    throw new AndroidExecutionException("Unable to decide if package " + packageName + " is installed or nor", e);
  }
}
origin: org.arquillian.container/arquillian-droidium-container-impl

private Process constructDeleteProcess(ProcessExecutor executor, AndroidSDK androidSDK, String avdName)
  throws AndroidExecutionException {
  Command command = new Command();
  command.add(androidSDK.getAndroidPath()).add("delete").add("avd").add("-n").add(avdName);
  try {
    return executor.spawn(command.getAsList());
  } catch (InterruptedException e) {
    throw new AndroidExecutionException(e, "Unable to delete AVD {0}.", avdName);
  } catch (ExecutionException e) {
    throw new AndroidExecutionException(e, "Unable to delete AVD {0}.", avdName);
  }
}
origin: org.arquillian.container/arquillian-droidium-container

private List<String> getAndroidListAVDOutput(boolean compact) {
  try {
    CommandBuilder cb = new CommandBuilder(androidSDK.get().getAndroidPath())
      .parameter("list")
      .parameter("avd");
    if (compact) {
      cb.parameter("-c");
    }
    Command command = cb.build();
    return Spacelift.task(CommandTool.class)
      .addEnvironment(androidSDK.get().getPlatformConfiguration().getAndroidSystemEnvironmentProperties())
      .command(command).execute().await().output();
  } catch (ExecutionException ex) {
    throw new AndroidExecutionException(ex, "Unable to get list of AVDs");
  }
}
org.arquillian.droidium.container.apiAndroidExecutionException<init>

Popular methods of AndroidExecutionException

  • getMessage

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now