public class

AndroidRunnerParams

extends java.lang.Object

 java.lang.Object

↳androidx.test.internal.util.AndroidRunnerParams

Gradle dependencies

compile group: 'androidx.test', name: 'runner', version: '1.5.0-alpha03'

  • groupId: androidx.test
  • artifactId: runner
  • version: 1.5.0-alpha03

Artifact androidx.test:runner:1.5.0-alpha03 it located at Google repository (https://maven.google.com/)

Androidx artifact mapping:

androidx.test:runner com.android.support.test:runner

Overview

Helper class to store frequently passed test parameters between the different classes

Summary

Constructors
publicAndroidRunnerParams(Instrumentation instrumentation, Bundle bundle, boolean skipExecution, long perTestTimeout, boolean ignoreSuiteMethods)

publicAndroidRunnerParams(Instrumentation instrumentation, Bundle bundle, long perTestTimeout, boolean ignoreSuiteMethods)

Methods
public BundlegetBundle()

public InstrumentationgetInstrumentation()

public longgetPerTestTimeout()

public booleanisIgnoreSuiteMethods()

public booleanisSkipExecution()

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public AndroidRunnerParams(Instrumentation instrumentation, Bundle bundle, boolean skipExecution, long perTestTimeout, boolean ignoreSuiteMethods)

Deprecated: Use AndroidRunnerParams.AndroidRunnerParams(Instrumentation, Bundle, long, boolean) instead.

Parameters:

instrumentation: the to inject into any tests that require it
bundle: the of command line args to inject into any tests that require it
skipExecution: whether or not to skip actual test execution
perTestTimeout: milliseconds timeout value applied to each test where 0 means no timeout
ignoreSuiteMethods: whether or not JUnit3 suite() methods should be executed.

public AndroidRunnerParams(Instrumentation instrumentation, Bundle bundle, long perTestTimeout, boolean ignoreSuiteMethods)

Parameters:

instrumentation: the to inject into any tests that require it
bundle: the of command line args to inject into any tests that require it
perTestTimeout: milliseconds timeout value applied to each test where 0 means no timeout
ignoreSuiteMethods: whether or not JUnit3 suite() methods should be executed.

Methods

public Instrumentation getInstrumentation()

public Bundle getBundle()

public boolean isSkipExecution()

Deprecated: implementations no longer need to support skipping execution of tests.

public long getPerTestTimeout()

public boolean isIgnoreSuiteMethods()

Source

/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.test.internal.util;

import android.app.Instrumentation;
import android.os.Bundle;

/** Helper class to store frequently passed test parameters between the different classes */
public class AndroidRunnerParams {
  private final Instrumentation instrumentation;
  private final Bundle bundle;
  private final boolean skipExecution;
  private final long perTestTimeout;
  private final boolean ignoreSuiteMethods;

  /**
   * @param instrumentation the {@link Instrumentation} to inject into any tests that require it
   * @param bundle the {@link Bundle} of command line args to inject into any tests that require it
   * @param skipExecution whether or not to skip actual test execution
   * @param perTestTimeout milliseconds timeout value applied to each test where 0 means no timeout
   * @param ignoreSuiteMethods whether or not JUnit3 suite() methods should be executed.
   * @deprecated Use {@link #AndroidRunnerParams(Instrumentation, Bundle, long, boolean)} instead.
   */
  @Deprecated
  public AndroidRunnerParams(
      Instrumentation instrumentation,
      Bundle bundle,
      boolean skipExecution,
      long perTestTimeout,
      boolean ignoreSuiteMethods) {
    this.instrumentation = instrumentation;
    this.bundle = bundle;
    this.skipExecution = skipExecution;
    this.perTestTimeout = perTestTimeout;
    this.ignoreSuiteMethods = ignoreSuiteMethods;
  }

  /**
   * @param instrumentation the {@link Instrumentation} to inject into any tests that require it
   * @param bundle the {@link Bundle} of command line args to inject into any tests that require it
   * @param perTestTimeout milliseconds timeout value applied to each test where 0 means no timeout
   * @param ignoreSuiteMethods whether or not JUnit3 suite() methods should be executed.
   */
  public AndroidRunnerParams(
      Instrumentation instrumentation,
      Bundle bundle,
      long perTestTimeout,
      boolean ignoreSuiteMethods) {
    this.instrumentation = instrumentation;
    this.bundle = bundle;
    this.skipExecution = false;
    this.perTestTimeout = perTestTimeout;
    this.ignoreSuiteMethods = ignoreSuiteMethods;
  }

  public Instrumentation getInstrumentation() {
    return instrumentation;
  }

  public Bundle getBundle() {
    return bundle;
  }

  /**
   * @deprecated {@link org.junit.runner.Runner} implementations no longer need to support skipping
   *     execution of tests.
   */
  @Deprecated
  public boolean isSkipExecution() {
    return skipExecution;
  }

  public long getPerTestTimeout() {
    return perTestTimeout;
  }

  public boolean isIgnoreSuiteMethods() {
    return ignoreSuiteMethods;
  }
}