DeviceTestCase

public class DeviceTestCase
extends MetricTestCase implements IDeviceTest, IRemoteTest, ITestAnnotationFilterReceiver, ITestCollector, ITestFilterReceiver

java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ com.android.tradefed.testtype.MetricTestCase
         ↳ com.android.tradefed.testtype.DeviceTestCase


IRemoteTestIDeviceTest 서비스를 제공하는 도우미 JUnit 테스트 사례입니다.

이는 테스트를 정의하는 JUnit 패턴을 따르고 Option와 같은 다른 트레이드페드 기능을 완전히 지원하는 테스트를 구현하려는 경우에 유용합니다.

요약

필드

protected mExcludeAnnotation

실행할 테스트의 제외 주석

protected mExcludeFilters

실행할 테스트 이름의 제외 필터

protected mIncludeAnnotation

실행할 테스트의 주석 포함

protected mIncludeFilters

실행할 테스트 이름의 포함 필터

공개 생성자

DeviceTestCase()
DeviceTestCase(String name)

공개 메서드

void addAllExcludeAnnotation( notAnnotations)

테스트가 표시된 경우 제외할 주석의 ERROR(/Set)를 추가합니다.

void addAllExcludeFilters( filters)

제외할 테스트의 필터 ERROR(/Set)를 추가합니다.

void addAllIncludeAnnotation( annotations)

테스트가 마커로 표시된 경우 포함할 주석의 ERROR(/Set)를 추가합니다.

void addAllIncludeFilters( filters)

포함할 테스트의 필터 ERROR(/Set)를 추가합니다.

void addExcludeAnnotation(String notAnnotation)

테스트가 표시된 경우 제외하는 주석을 추가합니다.

void addExcludeFilter(String filter)

제외할 테스트의 필터를 추가합니다.

void addIncludeAnnotation(String annotation)

테스트가 표시된 경우 포함하도록 주석을 추가합니다.

void addIncludeFilter(String filter)

포함할 테스트의 필터를 추가합니다.

void clearExcludeAnnotations()

현재 추적 중인 제외 주석을 모두 삭제합니다.

void clearExcludeFilters()

현재 추적 중인 제외 필터를 모두 삭제합니다.

void clearIncludeAnnotations()

현재 추적 중인 포함 주석을 모두 삭제합니다.

void clearIncludeFilters()

현재 추적 중인 모든 포함 필터를 삭제합니다.

int countTestCases()
ITestDevice getDevice()

테스트 대상 기기를 가져옵니다.

getExcludeAnnotations()

제외할 주석의 현재 ERROR(/Set)를 반환합니다.

getExcludeFilters()

제외 필터의 현재 ERROR(/Set)를 반환합니다.

getIncludeAnnotations()

포함할 주석의 현재 ERROR(/Set)를 반환합니다.

getIncludeFilters()

포함 필터의 현재 ERROR(/Set)를 반환합니다.

void run(TestResult result)

실행할 테스트 메서드가 null인 경우 상위 메서드를 재정의하여 모든 테스트 메서드를 실행합니다.

void run(TestInformation testInfo, ITestInvocationListener listener)

테스트를 실행하고 리스너에 결과를 보고합니다.

void setCollectTestsOnly(boolean shouldCollectTest)

테스트 수집 모드를 사용 설정 또는 사용 중지합니다.

void setDevice(ITestDevice device)

테스트 대상 기기를 삽입합니다.

필드

mExcludeAnnotation

protected  mExcludeAnnotation

실행할 테스트의 제외 주석

mExcludeFilters

protected  mExcludeFilters

실행할 테스트 이름의 제외 필터

mIncludeAnnotation

protected  mIncludeAnnotation

실행할 테스트의 주석 포함

mIncludeFilters

protected  mIncludeFilters

실행할 테스트 이름의 포함 필터

공개 생성자

DeviceTestCase

public DeviceTestCase ()

DeviceTestCase

public DeviceTestCase (String name)

매개변수
name String

공개 메서드

addAllExcludeAnnotation

public void addAllExcludeAnnotation ( notAnnotations)

테스트가 표시된 경우 제외할 주석의 ERROR(/Set)를 추가합니다.

매개변수
notAnnotations

addAllExcludeFilters

public void addAllExcludeFilters ( filters)

제외할 테스트의 필터 ERROR(/Set)를 추가합니다.

매개변수
filters

addAllIncludeAnnotation

public void addAllIncludeAnnotation ( annotations)

테스트가 마커로 표시된 경우 포함할 주석의 ERROR(/Set)를 추가합니다.

매개변수
annotations

addAllIncludeFilters

public void addAllIncludeFilters ( filters)

포함할 테스트의 필터 ERROR(/Set)를 추가합니다.

매개변수
filters

addExcludeAnnotation

public void addExcludeAnnotation (String notAnnotation)

테스트가 표시된 경우 제외하는 주석을 추가합니다.

매개변수
notAnnotation String

addExcludeFilter

public void addExcludeFilter (String filter)

제외할 테스트의 필터를 추가합니다.

매개변수
filter String

addIncludeAnnotation

public void addIncludeAnnotation (String annotation)

테스트가 표시된 경우 포함하도록 주석을 추가합니다.

매개변수
annotation String

addIncludeFilter

public void addIncludeFilter (String filter)

포함할 테스트의 필터를 추가합니다.

매개변수
filter String

clearExcludeAnnotations

public void clearExcludeAnnotations ()

현재 추적 중인 제외 주석을 모두 삭제합니다.

clearExcludeFilters

public void clearExcludeFilters ()

현재 추적 중인 제외 필터를 모두 삭제합니다.

clearIncludeAnnotations

public void clearIncludeAnnotations ()

현재 추적 중인 포함 주석을 모두 삭제합니다.

clearIncludeFilters

public void clearIncludeFilters ()

현재 추적 중인 모든 포함 필터를 삭제합니다.

countTestCases

public int countTestCases ()

반환 값
int

getDevice

public ITestDevice getDevice ()

테스트 대상 기기를 가져옵니다.

반환 값
ITestDevice ITestDevice

getExcludeAnnotations

public  getExcludeAnnotations ()

제외할 주석의 현재 ERROR(/Set)를 반환합니다.

반환 값

getExcludeFilters

public  getExcludeFilters ()

제외 필터의 현재 ERROR(/Set)를 반환합니다.

반환 값

getIncludeAnnotations

public  getIncludeAnnotations ()

포함할 주석의 현재 ERROR(/Set)를 반환합니다.

반환 값

getIncludeFilters

public  getIncludeFilters ()

포함 필터의 현재 ERROR(/Set)를 반환합니다.

반환 값

실행

public void run (TestResult result)

실행할 테스트 메서드가 null인 경우 상위 메서드를 재정의하여 모든 테스트 메서드를 실행합니다.

JUnit 프레임워크는 TestCase를 TestSuite로 래핑하여 TestCase의 모든 테스트 실행만 지원합니다. 안타깝게도 이 메커니즘을 사용하면 호출자가 자체 테스트 사례의 수명 주기를 제어할 수 없으므로 트레이드페드 구성 프레임워크가 테스트 사례에 옵션을 삽입하는 등의 작업을 할 수 없습니다.

매개변수
result TestResult

실행

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

테스트를 실행하고 리스너에 결과를 보고합니다.

매개변수
testInfo TestInformation: 테스트를 실행하는 데 유용한 정보가 포함된 TestInformation 객체입니다.

listener ITestInvocationListener: 테스트 결과의 ITestInvocationListener

생성 값
DeviceNotAvailableException

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

테스트 수집 모드를 사용 설정 또는 사용 중지합니다.

setDevice

public void setDevice (ITestDevice device)

테스트 대상 기기를 삽입합니다.

매개변수
device ITestDevice: 사용할 ITestDevice