JUnitToInvocationResultForwarder

public class JUnitToInvocationResultForwarder
extends Object implements TestListener

java.lang.Object
   ↳ com.android.tradefed.result.JUnitToInvocationResultForwarder


Một lớp theo dõi các sự kiện TestListener và chuyển tiếp các sự kiện đó đến ITestInvocationListener.

Tóm tắt

Hàm khởi tạo công khai

JUnitToInvocationResultForwarder(ITestInvocationListener invocationListener)
JUnitToInvocationResultForwarder( invocationListeners)

Phương thức công khai

void addError(Test test, Throwable t)

void addFailure(Test test, AssertionFailedError t)

void endTest(Test test, metrics)

Lệnh gọi lại từ các bài kiểm thử JUnit3 có thể chuyển tiếp các chỉ số.

void endTest(Test test)

void startTest(Test test)

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

Lệnh gọi lại từ trình chuyển tiếp JUnit3 để lấy nhật ký từ một kiểm thử.

Hàm khởi tạo công khai

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder (ITestInvocationListener invocationListener)

Tham số
invocationListener ITestInvocationListener

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder ( invocationListeners)

Tham số
invocationListeners

Phương thức công khai

addError

public void addError (Test test, 
                Throwable t)

Tham số
test Test

t Throwable

addFailure

public void addFailure (Test test, 
                AssertionFailedError t)

Tham số
test Test

t AssertionFailedError

endTest

public void endTest (Test test, 
                 metrics)

Lệnh gọi lại từ các bài kiểm thử JUnit3 có thể chuyển tiếp các chỉ số.

Tham số
test Test: Test vừa chạy xong.

metrics : Các chỉ số ở định dạng Bản đồ sẽ được truyền đến lệnh gọi lại kết quả.

endTest

public void endTest (Test test)

Tham số
test Test

startTest

public void startTest (Test test)

Tham số
test Test

testLog

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

Lệnh gọi lại từ trình chuyển tiếp JUnit3 để lấy nhật ký từ một kiểm thử.

Tham số
dataName String: Tên mô tả Chuỗi của dữ liệu. Ví dụ: "device_logcat". Lưu ý dataName có thể không phải là duy nhất cho mỗi lệnh gọi. Tức là trình triển khai phải có khả năng xử lý nhiều lệnh gọi có cùng dataName

dataType LogDataType: LogDataType của dữ liệu

dataStream InputStreamSource: InputStreamSource của dữ liệu. Người triển khai nên gọi createInputStream để bắt đầu đọc dữ liệu và đảm bảo đóng InputStream thu được khi hoàn tất. Phương thức gọi phải đảm bảo nguồn dữ liệu vẫn có và có thể truy cập được cho đến khi phương thức testLog hoàn tất.