BaseHostJUnit4Test

public abstract class BaseHostJUnit4Test
extends Object implements IAbiReceiver , ITestInformationReceiver

java.lang.Object
com.android.tradefed.testtype.junit4.BaseHostJUnit4Test


คลาสการทดสอบพื้นฐานสำหรับการรันการทดสอบสไตล์โฮสต์ JUnit4 คลาสนี้ให้การสนับสนุนในการติดตั้ง รัน และล้างการทดสอบเครื่องมือวัดจากฝั่งโฮสต์ คลาสนี้เข้ากันได้กับอุปกรณ์หลายเครื่อง ควรเป็นแหล่งที่มาของความจริงเพียงแหล่งเดียวในการรันการทดสอบเครื่องมือจากฝั่งโฮสต์เพื่อหลีกเลี่ยงยูทิลิตี้และคลาสพื้นฐานที่ซ้ำกัน

สรุป

ผู้รับเหมาก่อสร้างสาธารณะ

BaseHostJUnit4Test ()

วิธีการสาธารณะ

final void autoTearDown ()

รื้อถอน apk ทั้งหมดที่ติดตั้งโดยอัตโนมัติ

final IAbi getAbi ()
final IBuildInfo getBuild ()
final ITestDevice getDevice ()
final IInvocationContext getInvocationContext ()
final TestRunResult getLastDeviceRunResults ()

ส่งคืน TestRunResult ที่เป็นผลลัพธ์จาก runDeviceTests ล่าสุดที่ทำงาน

final getListDevices ()
TestInformation getTestInformation ()
boolean hasDeviceFeature (String feature)
final void installPackage ( DeviceTestRunOptions options)

ติดตั้ง APK ตาม DeviceTestRunOptions บนอุปกรณ์

final void installPackage (String apkFileName, String... options)

ติดตั้ง APK ตามชื่อบนอุปกรณ์

final void installPackage ( ITestDevice device, String apkFileName, String... options)

ติดตั้ง APK ตามชื่อบนอุปกรณ์ที่กำหนด

final void installPackageAsUser ( ITestDevice device, String apkFileName, boolean grantPermission, int userId, String... options)

ติดตั้ง APK ที่ระบุชื่อสำหรับผู้ใช้เฉพาะบนอุปกรณ์ที่กำหนด

final void installPackageAsUser (String apkFileName, boolean grantPermission, int userId, String... options)

ติดตั้ง APK ที่ระบุชื่อสำหรับผู้ใช้เฉพาะ

final boolean isPackageInstalled (String pkg)

ตรวจสอบว่ามีการติดตั้งแพ็คเกจตามชื่อที่กำหนดบนอุปกรณ์หรือไม่

final boolean isPackageInstalled ( ITestDevice device, String pkg)

ตรวจสอบว่ามีการติดตั้งแพ็คเกจตามชื่อที่กำหนดบนอุปกรณ์หรือไม่

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, instrumentationArgs) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, instrumentationArgs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests (String pkgName, String testClassName, String testMethodName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( DeviceTestRunOptions options)

รันฐานเครื่องมือวัดตามข้อมูลใน DeviceTestRunOptions

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests (String pkgName, String testClassName, Integer userId, Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests (String pkgName, String testClassName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests (String pkgName, String testClassName, Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final boolean runDeviceTests (String runner, String pkgName, String testClassName, String testMethodName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้

final void setAbi ( IAbi abi)
final void setTestInformation ( TestInformation testInformation)
final String uninstallPackage (String pkgName)

ถอนการติดตั้งแพ็คเกจบนอุปกรณ์

final String uninstallPackage ( ITestDevice device, String pkgName)

ถอนการติดตั้งแพ็คเกจบนอุปกรณ์

ผู้รับเหมาก่อสร้างสาธารณะ

BaseHostJUnit4Test

public BaseHostJUnit4Test ()

วิธีการสาธารณะ

autoTearDown

public final void autoTearDown ()

รื้อถอน apk ทั้งหมดที่ติดตั้งโดยอัตโนมัติ การดำเนินการนี้จะถอนการติดตั้ง APK ทั้งหมดจากอุปกรณ์ที่ติดตั้งไว้

ขว้าง
DeviceNotAvailableException

รับอาบี

public final IAbi getAbi ()

การส่งคืน
IAbi

รับสร้าง

public final IBuildInfo getBuild ()

การส่งคืน
IBuildInfo

รับอุปกรณ์

public final ITestDevice getDevice ()

การส่งคืน
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

การส่งคืน
IInvocationContext

รับผลลัพธ์ LastDeviceRun

public final TestRunResult getLastDeviceRunResults ()

ส่งคืน TestRunResult ที่เป็นผลลัพธ์จาก runDeviceTests ล่าสุดที่ทำงาน หรือเป็นโมฆะหากไม่มีผลลัพธ์

การส่งคืน
TestRunResult

getListDevices

public final  getListDevices ()

การส่งคืน

รับข้อมูลการทดสอบ

public TestInformation getTestInformation ()

การส่งคืน
TestInformation

มีคุณลักษณะของอุปกรณ์

public boolean hasDeviceFeature (String feature)

พารามิเตอร์
feature String

การส่งคืน
boolean

ขว้าง
DeviceNotAvailableException

ติดตั้งแพ็คเกจ

public final void installPackage (DeviceTestRunOptions options)

ติดตั้ง APK ตาม DeviceTestRunOptions บนอุปกรณ์ Apk จะถูกล้างอัตโนมัติ

พารามิเตอร์
options DeviceTestRunOptions : ตัวเลือกของการติดตั้งแพ็คเกจ

ขว้าง
DeviceNotAvailableException
TargetSetupError

ติดตั้งแพ็คเกจ

public final void installPackage (String apkFileName, 
                String... options)

ติดตั้ง APK ตามชื่อบนอุปกรณ์ Apk จะถูกล้างอัตโนมัติ

พารามิเตอร์
apkFileName String : ชื่อของไฟล์ APK

options String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งการติดตั้ง

ขว้าง
DeviceNotAvailableException
TargetSetupError

ติดตั้งแพ็คเกจ

public final void installPackage (ITestDevice device, 
                String apkFileName, 
                String... options)

ติดตั้ง APK ตามชื่อบนอุปกรณ์ที่กำหนด Apk จะถูกล้างอัตโนมัติ

พารามิเตอร์
device ITestDevice : ITestDevice ที่จะติดตั้ง apk

apkFileName String : ชื่อของไฟล์ apk

options String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งการติดตั้ง

ขว้าง
DeviceNotAvailableException
TargetSetupError

ติดตั้ง PackageAsUser

public final void installPackageAsUser (ITestDevice device, 
                String apkFileName, 
                boolean grantPermission, 
                int userId, 
                String... options)

ติดตั้ง APK ที่ระบุชื่อสำหรับผู้ใช้เฉพาะบนอุปกรณ์ที่กำหนด

พารามิเตอร์
device ITestDevice : ITestDevice ที่จะติดตั้ง apk

apkFileName String : ชื่อของไฟล์ apk

grantPermission boolean : ไม่ว่าจะผ่านการตั้งค่าสถานะการอนุญาตเมื่อติดตั้ง apk

userId int : ID ผู้ใช้ของผู้ใช้ที่จะติดตั้ง APK

options String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งการติดตั้ง

ขว้าง
DeviceNotAvailableException
TargetSetupError

ติดตั้ง PackageAsUser

public final void installPackageAsUser (String apkFileName, 
                boolean grantPermission, 
                int userId, 
                String... options)

ติดตั้ง APK ที่ระบุชื่อสำหรับผู้ใช้เฉพาะ

พารามิเตอร์
apkFileName String : ชื่อของไฟล์ apk

grantPermission boolean : ไม่ว่าจะผ่านการตั้งค่าสถานะการอนุญาตเมื่อติดตั้ง apk

userId int : ID ผู้ใช้ของผู้ใช้ที่จะติดตั้ง APK

options String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งการติดตั้ง

ขว้าง
DeviceNotAvailableException
TargetSetupError

isPackageInstalled แล้ว

public final boolean isPackageInstalled (String pkg)

ตรวจสอบว่ามีการติดตั้งแพ็คเกจตามชื่อที่กำหนดบนอุปกรณ์หรือไม่

พารามิเตอร์
pkg String : ชื่อของแพ็คเกจ

การส่งคืน
boolean เป็นจริงหากพบแพ็คเกจบนอุปกรณ์

ขว้าง
DeviceNotAvailableException

isPackageInstalled แล้ว

public final boolean isPackageInstalled (ITestDevice device, 
                String pkg)

ตรวจสอบว่ามีการติดตั้งแพ็คเกจตามชื่อที่กำหนดบนอุปกรณ์หรือไม่

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ควรถอนการติดตั้งแพ็คเกจ

pkg String : ชื่อของแพ็คเกจ

การส่งคืน
boolean เป็นจริงหากพบแพ็คเกจบนอุปกรณ์

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

userId Integer : รหัสของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

maxTimeToOutputMs Long : การหมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง

maxInstrumentationTimeoutMs Long : การหมดเวลาสูงสุดที่เครื่องมือวัดทั้งหมดต้องทำให้เสร็จ

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                boolean isWindowAnimationDisabled, 
                 instrumentationArgs, 
                 extraListeners)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

runner String

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

userId Integer : รหัสของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

maxTimeToOutputMs Long : การหมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง

maxInstrumentationTimeoutMs Long : การหมดเวลาสูงสุดที่เครื่องมือวัดทั้งหมดต้องทำให้เสร็จสิ้น

checkResults boolean : มีการตรวจสอบผลลัพธ์เพื่อหาข้อขัดข้องหรือไม่

isHiddenApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ที่ซ่อนอยู่หรือไม่

isTestApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ทดสอบหรือไม่

isIsolatedStorageDisabled boolean : เราควรปิดการใช้งานที่เก็บข้อมูลแบบแยกหรือไม่

isWindowAnimationDisabled boolean : เราควรปิดการใช้งานภาพเคลื่อนไหวของหน้าต่างหรือไม่

instrumentationArgs : อาร์กิวเมนต์ที่จะส่งผ่านไปยังเครื่องมือวัด

extraListeners

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                 instrumentationArgs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

runner String

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

userId Integer : รหัสของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

maxTimeToOutputMs Long : การหมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง

maxInstrumentationTimeoutMs Long : การหมดเวลาสูงสุดที่เครื่องมือวัดทั้งหมดต้องทำให้เสร็จ

checkResults boolean : มีการตรวจสอบผลลัพธ์เพื่อหาข้อขัดข้องหรือไม่

isHiddenApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ที่ซ่อนอยู่หรือไม่

instrumentationArgs : อาร์กิวเมนต์ที่จะส่งผ่านไปยังเครื่องมือวัด

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                String testMethodName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (DeviceTestRunOptions options)

รันฐานเครื่องมือวัดตามข้อมูลใน DeviceTestRunOptions

พารามิเตอร์
options DeviceTestRunOptions : DeviceTestRunOptions ขับเคลื่อนการตั้งค่าเครื่องมือ

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                boolean isWindowAnimationDisabled, 
                boolean isRestartDisabled, 
                 instrumentationArgs, 
                 extraListeners)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

runner String

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

userId Integer : รหัสของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

maxTimeToOutputMs Long : การหมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง

maxInstrumentationTimeoutMs Long : การหมดเวลาสูงสุดที่เครื่องมือวัดทั้งหมดต้องทำให้เสร็จ

checkResults boolean : มีการตรวจสอบผลลัพธ์เพื่อหาข้อขัดข้องหรือไม่

isHiddenApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ที่ซ่อนอยู่หรือไม่

isTestApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ทดสอบหรือไม่

isIsolatedStorageDisabled boolean : เราควรปิดการใช้งานที่เก็บข้อมูลแบบแยกหรือไม่

isWindowAnimationDisabled boolean : เราควรปิดการใช้งานภาพเคลื่อนไหวของหน้าต่างหรือไม่

isRestartDisabled boolean

instrumentationArgs : อาร์กิวเมนต์ที่จะส่งผ่านไปยังเครื่องมือวัด

extraListeners

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                Integer userId, 
                Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

userId Integer : รหัสของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                Long testTimeoutMs)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                 instrumentationArgs, 
                 extraListeners)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ไม่ใช้งานเครื่องมือวัด

runner String

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

userId Integer : รหัสของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้

testTimeoutMs Long : การหมดเวลาเป็นมิลลิวินาทีที่จะใช้กับแต่ละกรณีทดสอบ

maxTimeToOutputMs Long : การหมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง

maxInstrumentationTimeoutMs Long : การหมดเวลาสูงสุดที่เครื่องมือวัดทั้งหมดต้องทำให้เสร็จสิ้น

checkResults boolean : มีการตรวจสอบผลลัพธ์เพื่อหาข้อขัดข้องหรือไม่

isHiddenApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ที่ซ่อนอยู่หรือไม่

isTestApiCheckDisabled boolean : เราควรปิดการใช้งานการตรวจสอบ API ทดสอบหรือไม่

isIsolatedStorageDisabled boolean : เราควรปิดการใช้งานที่เก็บข้อมูลแบบแยกหรือไม่

instrumentationArgs : อาร์กิวเมนต์ที่จะส่งผ่านไปยังเครื่องมือวัด

extraListeners

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

รันการทดสอบอุปกรณ์

public final boolean runDeviceTests (String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName)

วิธีการรันแพ็คเกจเครื่องมือที่ติดตั้งไว้ ใช้ getLastDeviceRunResults() ทันทีเพื่อรับรายละเอียดของผลลัพธ์

พารามิเตอร์
runner String : รันเนอร์เครื่องมือวัดที่จะใช้

pkgName String : ชื่อของแพ็คเกจที่จะรัน

testClassName String : ชื่อของคลาสทดสอบที่จะรัน

testMethodName String : ชื่อของวิธีทดสอบในคลาสที่จะรัน

การส่งคืน
boolean จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

เซตอาบี

public final void setAbi (IAbi abi)

พารามิเตอร์
abi IAbi

ตั้งค่าข้อมูลการทดสอบ

public final void setTestInformation (TestInformation testInformation)

พารามิเตอร์
testInformation TestInformation

ถอนการติดตั้ง Package

public final String uninstallPackage (String pkgName)

ถอนการติดตั้งแพ็คเกจบนอุปกรณ์

พารามิเตอร์
pkgName String : แพ็คเกจ Android ที่จะถอนการติดตั้ง

การส่งคืน
String String ที่มีรหัสข้อผิดพลาด หรือ null หากสำเร็จ

ขว้าง
DeviceNotAvailableException

ถอนการติดตั้ง Package

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

ถอนการติดตั้งแพ็คเกจบนอุปกรณ์

พารามิเตอร์
device ITestDevice : อุปกรณ์ที่ควรถอนการติดตั้งแพ็คเกจ

pkgName String : แพ็คเกจ Android ที่จะถอนการติดตั้ง

การส่งคืน
String String ที่มีรหัสข้อผิดพลาด หรือ null หากสำเร็จ

ขว้าง
DeviceNotAvailableException