TradefedSandbox

public class TradefedSandbox
extends Object implements ISandbox

java.lang.Object
   ↳ com.android.tradefed.sandbox.TradefedSandbox


Trade Federation 호출을 실행할 수 있는 샌드박스 컨테이너입니다. TODO: 옵션을 샌드박스에 전달하도록 허용합니다.

요약

필드

public static final String EXTRA_TARGET_LAB

public static final String GENERAL_TESTS_ZIP

public static final String SANDBOX_ENABLED

공개 생성자

TradefedSandbox()

공개 메서드

String createClasspath(File workingDir)

ISandbox.getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[])에서 반환된 환경 및 작업 디렉터리를 기반으로 클래스 경로를 만듭니다.

IConfiguration createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)

기본 실행에서 연결 해제된 특수 모드: 구성이 상위 요소에 없는 것처럼 보이면 씬 런처로 대체됩니다. 여기서 현재 알려진 정보로 샌드박스를 설정하고 작업 디렉터리를 채워 버전이 지정된 디렉터리에 구성을 완전히 만듭니다.

File getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
static matchSandboxExtraBuildTargetByConfigName(String configName)

테스트 구성 이름을 사용하여 샌드박스의 추가 빌드 타겟에서 추가 빌드 타겟을 일치시킵니다.

Exception prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)

샌드박스가 제대로 실행될 수 있도록 환경을 준비합니다.

CommandResult run(TestInformation info, IConfiguration config, ITestLogger logger)

설정된 환경으로 샌드박스를 실행합니다.

void tearDown()

변경되었을 수 있는 상태, 파일 또는 환경을 정리합니다.

보호된 메서드

File dumpGlobalConfig(IConfiguration config, exclusionPatterns)

일부 객체에서 필터링된 전역 구성을 덤프합니다.

String getJava()
Exception prepareConfiguration(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)

하위 프로세스에 전달되고 컨테이너 실행을 유도하는 IConfiguration를 준비합니다.

File prepareContext(IInvocationContext context, IConfiguration config)

IInvocationContext를 준비하고 직렬화합니다.

필드

EXTRA_TARGET_LAB

public static final String EXTRA_TARGET_LAB

GENERAL_TESTS_ZIP

public static final String GENERAL_TESTS_ZIP

SANDBOX_ENABLED

public static final String SANDBOX_ENABLED

공개 생성자

TradefedSandbox

public TradefedSandbox ()

공개 메서드

createClasspath

public String createClasspath (File workingDir)

ISandbox.getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[])에서 반환된 환경 및 작업 디렉터리를 기반으로 클래스 경로를 만듭니다.

매개변수
workingDir File: 샌드박스의 현재 작업 디렉터리입니다.

반환 값
String 사용할 클래스 경로입니다.

생성 값
ConfigurationException

createThinLauncherConfig

public IConfiguration createThinLauncherConfig (String[] args, 
                IKeyStoreClient keyStoreClient, 
                IRunUtil runUtil, 
                File globalConfig)

기본 실행에서 연결 해제된 특수 모드: 구성이 상위 요소에 없는 것으로 보이면 씬 런처로 대체됩니다. 여기서 현재 알려진 정보로 샌드박스를 설정하고 작업 디렉터리를 채워 버전이 지정된 디렉터리에 구성을 완전히 만듭니다.

매개변수
args String: 원래 명령줄 인수입니다.

keyStoreClient IKeyStoreClient: 구성을 만드는 데 사용할 현재 키 저장소 클라이언트입니다.

runUtil IRunUtil: 호스트 명령어를 실행할 현재 IRunUtil입니다.

globalConfig File: TF의 하위 프로세스를 실행하는 데 사용할 전역 구성입니다.

반환 값
IConfiguration NON_VERSIONED 객체의 TF 구성 XML을 가리키는 파일입니다. 씬 런처 구성을 만들 수 없는 경우 null을 반환합니다.

getTradefedSandboxEnvironment

public File getTradefedSandboxEnvironment (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                ITestLogger logger, 
                String[] args)

매개변수
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

반환 값
File

matchSandboxExtraBuildTargetByConfigName

public static  matchSandboxExtraBuildTargetByConfigName (String configName)

테스트 구성 이름을 사용하여 샌드박스의 추가 빌드 타겟에서 추가 빌드 타겟을 일치시킵니다.

매개변수
configName String

반환 값

prepareEnvironment

public Exception prepareEnvironment (IInvocationContext context, 
                IConfiguration config, 
                ITestInvocationListener listener)

샌드박스가 제대로 실행될 수 있도록 환경을 준비합니다.

매개변수
context IInvocationContext: 현재 호출 IInvocationContext입니다.

config IConfiguration: 실행할 명령어의 IConfiguration입니다.

listener ITestInvocationListener: 최종 결과를 파이프해야 하는 현재 호출 ITestInvocationListener입니다.

반환 값
Exception 실패가 포함된 Exception 또는 성공한 경우 Null입니다.

실행

public CommandResult run (TestInformation info, 
                IConfiguration config, 
                ITestLogger logger)

설정된 환경으로 샌드박스를 실행합니다.

매개변수
info TestInformation: 호출을 설명하는 TestInformation

config IConfiguration: 실행할 명령어의 IConfiguration입니다.

logger ITestLogger: 파일을 로깅할 수 있는 ITestLogger입니다.

반환 값
CommandResult 샌드박스 실행 및 로그의 상태가 포함된 CommandResult

tearDown

public void tearDown ()

변경되었을 수 있는 상태, 파일 또는 환경을 정리합니다.

보호된 메서드

dumpGlobalConfig

protected File dumpGlobalConfig (IConfiguration config, 
                 exclusionPatterns)

일부 객체에서 필터링된 전역 구성을 덤프합니다.

매개변수
config IConfiguration

exclusionPatterns

반환 값
File

생성 값
ConfigurationException

getJava

protected String getJava ()

반환 값
String

prepareConfiguration

protected Exception prepareConfiguration (IInvocationContext context, 
                IConfiguration config, 
                ITestInvocationListener listener)

하위 프로세스에 전달되고 컨테이너 실행을 유도하는 IConfiguration를 준비합니다.

매개변수
context IInvocationContext: 현재 IInvocationContext입니다.

config IConfiguration: 준비할 IConfiguration입니다.

listener ITestInvocationListener: 현재 호출 ITestInvocationListener입니다.

반환 값
Exception 문제가 발생하면 Exception이고, 그렇지 않으면 null입니다.

prepareContext

protected File prepareContext (IInvocationContext context, 
                IConfiguration config)

IInvocationContext를 준비하고 직렬화합니다.

매개변수
context IInvocationContext: 준비할 IInvocationContext입니다.

config IConfiguration: 샌드박스의 IConfiguration입니다.

반환 값
File 직렬화된 IInvocationContext입니다.

생성 값
IOException