GenericLogcatEventParser

public class GenericLogcatEventParser
extends Object

java.lang.Object
com.android.tradefed.util.GenericLogcatEventParser<LogcatEventType>


Analisa a entrada logcat para eventos.

Essa classe interpreta as mensagens do logcat e pode informar o ouvinte sobre eventos de maneira de bloqueio e pesquisa.

Resumo

Classes aninhadas

class GenericLogcatEventParser.LogcatEvent

Estrutura para manter um evento logcat com o tipo de evento e acionar a mensagem logcat

Construtores públicos

GenericLogcatEventParser ( ITestDevice device)

Instancia um novo LogcatEventParser

Métodos públicos

void close ()

Pare de ouvir logcat.

void parseEvents (String[] lines)

Analise as linhas logcat e adicione quaisquer eventos capturados (que foram registrados com registerEventTrigger(String, String, LogcatEventType) ) à fila de eventos.

GenericLogcatEventParser.LogcatEvent pollForEvent ()

Pesquisa a fila de eventos.

void registerEventTrigger (String tag, String msg, LogcatEventType response)

Registre um evento de determinado logcat tag e mensagem com a resposta desejada.

void registerEventTrigger (Log.LogLevel logLevel, String tag, String msg, LogcatEventType response)

Registre um evento de determinado nível de logcat, tag e mensagem com a resposta desejada.

void start ()

Comece a ouvir logcat e analisar eventos.

GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)

Bloqueia até receber um evento.

Construtores públicos

GenericLogcatEventParser

public GenericLogcatEventParser (ITestDevice device)

Instancia um novo LogcatEventParser

Parâmetros
device ITestDevice : para ler logcat de

Métodos públicos

fechar

public void close ()

Pare de ouvir logcat.

parseEvents

public void parseEvents (String[] lines)

Analise as linhas logcat e adicione quaisquer eventos capturados (que foram registrados com registerEventTrigger(String, String, LogcatEventType) ) à fila de eventos.

Parâmetros
lines String

pollForEvent

public GenericLogcatEventParser.LogcatEvent pollForEvent ()

Pesquisa a fila de eventos. Retorna imediatamente.

devoluções
GenericLogcatEventParser.LogcatEvent O evento ou null se nenhum evento correspondente for encontrado

registerEventTrigger

public void registerEventTrigger (String tag, 
                String msg, 
                LogcatEventType response)

Registre um evento de determinado logcat tag e mensagem com a resposta desejada. A mensagem pode ser parcial.

Parâmetros
tag String

msg String

response LogcatEventType

registerEventTrigger

public void registerEventTrigger (Log.LogLevel logLevel, 
                String tag, 
                String msg, 
                LogcatEventType response)

Registre um evento de determinado nível de logcat, tag e mensagem com a resposta desejada. A mensagem pode ser parcial.

Parâmetros
logLevel Log.LogLevel

tag String

msg String

response LogcatEventType

começar

public void start ()

Comece a ouvir logcat e analisar eventos.

waitForEvent

public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)

Bloqueia até receber um evento.

Parâmetros
timeoutMs long : Tempo de espera em milissegundos

devoluções
GenericLogcatEventParser.LogcatEvent O evento ou null se o tempo limite for atingido