Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
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.
DeviceJUnit4ClassRunner
public
class
DeviceJUnit4ClassRunner
extends BlockJUnit4ClassRunner
implements
IAbiReceiver,
ISetOptionReceiver,
ITestInformationReceiver
java.lang.Object
|
↳ |
org.junit.runner.Runner
|
|
↳ |
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
|
|
|
↳ |
org.junit.runners.BlockJUnit4ClassRunner
|
|
|
|
↳ |
com.android.tradefed.testtype.DeviceJUnit4ClassRunner
|
Trình chạy kiểm thử JUnit4 cũng hỗ trợ IDeviceTest
. Bạn nên chỉ định trên JUnit4
Kiểm thử bằng chú thích RunWith.
Tóm tắt
Hàm khởi tạo công khai
DeviceJUnit4ClassRunner
public DeviceJUnit4ClassRunner (Class<?> klass)
Phương thức công khai
getAbi
public IAbi getAbi ()
chạy
public void run (RunNotifier notifier)
Tham số |
notifier |
RunNotifier |
setAbi
public void setAbi (IAbi abi)
public void setTestInformation (TestInformation testInformation)
Tham số |
testInformation |
TestInformation |
Phương thức được bảo vệ
createTest
protected Object createTest ()
Chúng ta ghi đè createTest để thiết lập thiết bị.
runChild
protected void runChild (FrameworkMethod method,
RunNotifier notifier)
Tham số |
method |
FrameworkMethod |
notifier |
RunNotifier |
withAfterClasses
protected Statement withAfterClasses (Statement statement)
Tham số |
statement |
Statement |
withBeforeClasses
protected Statement withBeforeClasses (Statement statement)
Tham số |
statement |
Statement |
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: 2025-03-26 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: 2025-03-26 UTC."],[],[]]