Để phù hợp với mô hình phát triển ổn định của nhánh chính và đảm bảo tính ổn định của nền tảng cho hệ sinh thái, chúng tôi sẽ xuất bản mã nguồn lên AOSP vào quý 2 và quý 4 năm 2026. Để tạo và đóng góp cho AOSP, hãy sử dụng android-latest-release. Nhánh tệp kê khai android-latest-release sẽ luôn tham chiếu đến bản phát hành gần đây nhất được chuyển đến AOSP. Để biết thêm thông tin, hãy xem bài viết Các thay đổi đối với AOSP.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
GranularRetriableTestWrapper
public
class
GranularRetriableTestWrapper
extends Object
implements
IRemoteTest,
ITestCollector
| java.lang.Object
|
| ↳ |
com.android.tradefed.testtype.suite.GranularRetriableTestWrapper
|
Một lớp trình bao bọc hoạt động trên IRemoteTest để phân tách IRemoteTest ở cấp trường hợp kiểm thử.
IRemoteTest có thể chứa nhiều trường hợp kiểm thử. Trước đây, các trường hợp kiểm thử này được coi là một tổng thể: Khi IRemoteTest chạy, tất cả các trường hợp kiểm thử sẽ chạy. Một số IRemoteTest (Những IRemoteTest triển khai ITestFilterReceiver) có thể chấp nhận danh sách cho phép gồm các trường hợp kiểm thử và chỉ chạy những trường hợp kiểm thử đó. Lớp này tận dụng tính năng hiện có và cung cấp một cách linh hoạt hơn để chạy bộ kiểm thử.
- Một trường hợp kiểm thử có thể được thử lại nhiều lần (trong cùng một lần chạy IRemoteTest) để giảm tỷ lệ thất bại không phải do lỗi kiểm thử.
- Các trường hợp kiểm thử được thử lại sẽ được thu thập linh động từ các lỗi chạy trước đó.
Lưu ý:
- Điều kiện tiên quyết để chạy một nhóm nhỏ các trường hợp kiểm thử là loại kiểm thử phải triển khai giao diện
ITestFilterReceiver.
- X là số lần thử lại tối đa tuỳ chỉnh.
Tóm tắt
Hàm khởi tạo công khai |
GranularRetriableTestWrapper(IRemoteTest test, ITestInvocationListener mainListener, int maxRunLimit)
|
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit)
|
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit, boolean useModuleResultsForwarder, boolean removeModuleBuffering, boolean collectKernelLog, int targetPreparerRetryCount)
|
Hàm khởi tạo công khai
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test,
ITestInvocationListener mainListener,
int maxRunLimit)
| Tham số |
test |
IRemoteTest |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test,
ModuleDefinition module,
ITestInvocationListener mainListener,
int maxRunLimit)
| Tham số |
test |
IRemoteTest |
module |
ModuleDefinition |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test,
ModuleDefinition module,
ITestInvocationListener mainListener,
int maxRunLimit,
boolean useModuleResultsForwarder,
boolean removeModuleBuffering,
boolean collectKernelLog,
int targetPreparerRetryCount)
| Tham số |
test |
IRemoteTest |
module |
ModuleDefinition |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
useModuleResultsForwarder |
boolean |
removeModuleBuffering |
boolean |
collectKernelLog |
boolean |
targetPreparerRetryCount |
int |
Phương thức công khai
getExpectedTestsCount
public final int getExpectedTestsCount ()
Tính số lượng trường hợp kiểm thử trong IRemoteTest. Giá trị này phân biệt các trường hợp kiểm thử giống nhau được lên lịch lại nhiều lần.
getFinalTestRunResults
public final List<TestRunResult> getFinalTestRunResults ()
Nhận TestRunResults đã hợp nhất từ mỗi lần chạy IRemoteTest.
getResultListener
public ModuleListener getResultListener ()
Trả về trình nghe chứa tất cả kết quả.
getRetryCount
public int getRetryCount ()
setCollectTestsOnly
public void setCollectTestsOnly (boolean shouldCollectTest)
Bật hoặc tắt chế độ thu thập dữ liệu thử nghiệm
setDefaultLogCollectors
public void setDefaultLogCollectors (List<IMetricCollector> collectors)
setMarkTestsSkipped
public void setMarkTestsSkipped (boolean skipTestCases)
Đặt ModuleDefinition RunStrategy làm thuộc tính GranularRetriableTestWrapper.
| Tham số |
skipTestCases |
boolean: liệu có nên bỏ qua các trường hợp kiểm thử hay không. |
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2026-06-22 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2026-06-22 UTC."],[],[]]