การทดสอบ BaseHostJUnit4
public abstract class BaseHostJUnit4Test
extends Object
implements IAbiReceiver , ITestInformationReceiver
java.lang.Object |
↳ | com.android.tradefed.testtype.junit4.BaseHostJUnit4Test |
คลาสการทดสอบพื้นฐานสำหรับการเรียกใช้การทดสอบสไตล์โฮสต์ JUnit4 คลาสนี้รองรับการติดตั้ง เรียกใช้ และล้างการทดสอบเครื่องมือวัดจากฝั่งโฮสต์ คลาสนี้รองรับอุปกรณ์หลายเครื่อง ควรเป็นแหล่งความจริงแหล่งเดียวในการเรียกใช้การทดสอบเครื่องมือจากฝั่งโฮสต์ เพื่อหลีกเลี่ยงยูทิลิตี้และคลาสพื้นฐานที่ซ้ำกัน
สรุป
วิธีการสาธารณะ |
---|
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) ถอนการติดตั้งแพ็คเกจบนอุปกรณ์ |
ผู้สร้างสาธารณะ
การทดสอบ BaseHostJUnit4
public BaseHostJUnit4Test ()
วิธีการสาธารณะ
autoTearDown
public final void autoTearDown ()
ฉีกลงอัตโนมัติสำหรับ apk ทั้งหมดที่ติดตั้ง การดำเนินการนี้จะถอนการติดตั้ง apk ทั้งหมดออกจากอุปกรณ์ที่ติดตั้งไว้
รับเอบี
public final IAbi getAbi ()
getLastDeviceRunResults
public final TestRunResult getLastDeviceRunResults ()
ส่งกลับ TestRunResult
ที่เกิดจาก runDeviceTests ล่าสุดที่รัน หรือเป็นโมฆะหากไม่มีผลลัพธ์
getList อุปกรณ์
public final getListDevices ()
มีDeviceFeature
public boolean hasDeviceFeature (String feature)
พารามิเตอร์ |
---|
feature | String |
ติดตั้งแพ็คเกจ
public final void installPackage (DeviceTestRunOptions options)
ติดตั้ง apk ตาม DeviceTestRunOptions
บนอุปกรณ์ Apk จะถูกล้างอัตโนมัติ
พารามิเตอร์ |
---|
options | DeviceTestRunOptions : ตัวเลือกของการติดตั้งแพ็คเกจ |
ติดตั้งแพ็คเกจ
public final void installPackage (String apkFileName,
String... options)
ติดตั้ง apk ตามชื่อบนอุปกรณ์ Apk จะถูกล้างอัตโนมัติ
พารามิเตอร์ |
---|
apkFileName | String : ชื่อของไฟล์ apk |
options | String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งติดตั้ง |
ติดตั้งแพ็คเกจ
public final void installPackage (ITestDevice device,
String apkFileName,
String... options)
ติดตั้ง apk ตามชื่อบนอุปกรณ์ที่กำหนด Apk จะถูกล้างอัตโนมัติ
พารามิเตอร์ |
---|
device | ITestDevice : ITestDevice ที่จะติดตั้ง apk |
apkFileName | String : ชื่อของไฟล์ apk |
options | String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งติดตั้ง |
ติดตั้ง 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 : รหัสผู้ใช้ของผู้ใช้ที่จะติดตั้ง apk |
options | String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งติดตั้ง |
ติดตั้ง PackageAsUser
public final void installPackageAsUser (String apkFileName,
boolean grantPermission,
int userId,
String... options)
ติดตั้ง apk ที่กำหนดชื่อสำหรับผู้ใช้เฉพาะ
พารามิเตอร์ |
---|
apkFileName | String : ชื่อของไฟล์ apk |
grantPermission | boolean : ว่าจะผ่านการตั้งค่าสถานะการให้สิทธิ์เมื่อติดตั้ง apk หรือไม่ |
userId | int : รหัสผู้ใช้ของผู้ใช้ที่จะติดตั้ง apk |
options | String : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่งติดตั้ง |
isPackageInstalled
public final boolean isPackageInstalled (String pkg)
ตรวจสอบว่ามีการติดตั้งแพ็คเกจของชื่อที่ระบุบนอุปกรณ์หรือไม่
พารามิเตอร์ |
---|
pkg | String : ชื่อของแพ็คเกจ |
ส่งคืน |
---|
boolean | จริงหากพบแพ็คเกจบนอุปกรณ์ |
isPackageInstalled
public final boolean isPackageInstalled (ITestDevice device,
String pkg)
ตรวจสอบว่ามีการติดตั้งแพ็คเกจของชื่อที่ระบุบนอุปกรณ์หรือไม่
พารามิเตอร์ |
---|
device | ITestDevice : อุปกรณ์ที่ควรถอนการติดตั้งแพ็คเกจ |
pkg | String : ชื่อของแพ็คเกจ |
ส่งคืน |
---|
boolean | จริงหากพบแพ็คเกจบนอุปกรณ์ |
เรียกใช้การทดสอบอุปกรณ์
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 : id ของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้ |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
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 | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
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 : id ของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้ |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
maxTimeToOutputMs | Long : หมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง |
maxInstrumentationTimeoutMs | Long : ระยะหมดเวลาสูงสุดที่เครื่องมือทั้งหมดต้องทำให้เสร็จ |
checkResults | boolean : มีการตรวจสอบผลลัพธ์ว่ามีข้อขัดข้องหรือไม่ |
isHiddenApiCheckDisabled | boolean : เราควรปิดการตรวจสอบ API ที่ซ่อนอยู่หรือไม่ |
isTestApiCheckDisabled | boolean : เราควรปิดใช้งานการตรวจสอบ API ทดสอบหรือไม่ |
isIsolatedStorageDisabled | boolean : เราควรปิดการใช้งานที่เก็บข้อมูลแยกหรือไม่ |
isWindowAnimationDisabled | boolean : เราควรปิดการใช้งานหน้าต่างแอนิเมชั่นหรือไม่ |
instrumentationArgs | : อาร์กิวเมนต์ที่จะส่งไปยังเครื่องมือวัด |
extraListeners | |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
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 | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
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 : id ของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้ |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
maxTimeToOutputMs | Long : หมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง |
maxInstrumentationTimeoutMs | Long : ระยะหมดเวลาสูงสุดที่เครื่องมือทั้งหมดต้องทำให้เสร็จ |
checkResults | boolean : มีการตรวจสอบผลลัพธ์ว่ามีข้อขัดข้องหรือไม่ |
isHiddenApiCheckDisabled | boolean : เราควรปิดการตรวจสอบ API ที่ซ่อนอยู่หรือไม่ |
instrumentationArgs | : อาร์กิวเมนต์ที่จะส่งไปยังเครื่องมือวัด |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (String pkgName,
String testClassName,
String testMethodName)
เมธอดในการเรียกใช้แพ็คเกจเครื่องมือวัดที่ติดตั้ง ใช้ getLastDeviceRunResults()
ทันทีเพื่อรับรายละเอียดของผลลัพธ์
พารามิเตอร์ |
---|
pkgName | String : ชื่อของแพ็คเกจที่จะรัน |
testClassName | String : ชื่อของคลาสทดสอบที่จะรัน |
testMethodName | String : ชื่อของวิธีการทดสอบในคลาสที่จะเรียกใช้ |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (DeviceTestRunOptions options)
เรียกใช้ฐานเครื่องมือตามข้อมูลใน DeviceTestRunOptions
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
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 : id ของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้ |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
maxTimeToOutputMs | Long : หมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง |
maxInstrumentationTimeoutMs | Long : ระยะหมดเวลาสูงสุดที่เครื่องมือทั้งหมดต้องทำให้เสร็จ |
checkResults | boolean : มีการตรวจสอบผลลัพธ์ว่ามีข้อขัดข้องหรือไม่ |
isHiddenApiCheckDisabled | boolean : เราควรปิดการตรวจสอบ API ที่ซ่อนอยู่หรือไม่ |
isTestApiCheckDisabled | boolean : เราควรปิดใช้งานการตรวจสอบ API ทดสอบหรือไม่ |
isIsolatedStorageDisabled | boolean : เราควรปิดการใช้งานที่เก็บข้อมูลแยกหรือไม่ |
isWindowAnimationDisabled | boolean : เราควรปิดการใช้งานหน้าต่างแอนิเมชั่นหรือไม่ |
isRestartDisabled | boolean |
instrumentationArgs | : อาร์กิวเมนต์ที่จะส่งไปยังเครื่องมือวัด |
extraListeners | |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (ITestDevice device,
String pkgName,
String testClassName,
String testMethodName)
เมธอดในการเรียกใช้แพ็คเกจเครื่องมือวัดที่ติดตั้ง ใช้ getLastDeviceRunResults()
ทันทีเพื่อรับรายละเอียดของผลลัพธ์
พารามิเตอร์ |
---|
device | ITestDevice : อุปกรณ์ที่จะรันเครื่องมือวัด |
pkgName | String : ชื่อของแพ็คเกจที่จะรัน |
testClassName | String : ชื่อของคลาสทดสอบที่จะรัน |
testMethodName | String : ชื่อของวิธีการทดสอบในคลาสที่จะเรียกใช้ |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (String pkgName,
String testClassName,
Integer userId,
Long testTimeoutMs)
เมธอดในการเรียกใช้แพ็คเกจเครื่องมือวัดที่ติดตั้ง ใช้ getLastDeviceRunResults()
ทันทีเพื่อรับรายละเอียดของผลลัพธ์
พารามิเตอร์ |
---|
pkgName | String : ชื่อของแพ็คเกจที่จะรัน |
testClassName | String : ชื่อของคลาสทดสอบที่จะรัน |
userId | Integer : id ของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้ |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (String pkgName,
String testClassName)
เมธอดในการเรียกใช้แพ็คเกจเครื่องมือวัดที่ติดตั้ง ใช้ getLastDeviceRunResults()
ทันทีเพื่อรับรายละเอียดของผลลัพธ์
พารามิเตอร์ |
---|
pkgName | String : ชื่อของแพ็คเกจที่จะรัน |
testClassName | String : ชื่อของคลาสทดสอบที่จะรัน |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (String pkgName,
String testClassName,
Long testTimeoutMs)
เมธอดในการเรียกใช้แพ็คเกจเครื่องมือวัดที่ติดตั้ง ใช้ getLastDeviceRunResults()
ทันทีเพื่อรับรายละเอียดของผลลัพธ์
พารามิเตอร์ |
---|
pkgName | String : ชื่อของแพ็คเกจที่จะรัน |
testClassName | String : ชื่อของคลาสทดสอบที่จะรัน |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
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 : id ของผู้ใช้ที่จะทำการทดสอบ สามารถเป็นโมฆะได้ |
testTimeoutMs | Long : การหมดเวลาในหน่วยมิลลิวินาทีที่จะใช้กับกรณีทดสอบแต่ละกรณี |
maxTimeToOutputMs | Long : หมดเวลาสูงสุดที่การทดสอบต้องเริ่มแสดงผลบางอย่าง |
maxInstrumentationTimeoutMs | Long : ระยะหมดเวลาสูงสุดที่เครื่องมือทั้งหมดต้องทำให้เสร็จ |
checkResults | boolean : มีการตรวจสอบผลลัพธ์ว่ามีข้อขัดข้องหรือไม่ |
isHiddenApiCheckDisabled | boolean : เราควรปิดการตรวจสอบ API ที่ซ่อนอยู่หรือไม่ |
isTestApiCheckDisabled | boolean : เราควรปิดใช้งานการตรวจสอบ API ทดสอบหรือไม่ |
isIsolatedStorageDisabled | boolean : เราควรปิดการใช้งานที่เก็บข้อมูลแยกหรือไม่ |
instrumentationArgs | : อาร์กิวเมนต์ที่จะส่งไปยังเครื่องมือวัด |
extraListeners | |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เรียกใช้การทดสอบอุปกรณ์
public final boolean runDeviceTests (String runner,
String pkgName,
String testClassName,
String testMethodName)
เมธอดในการเรียกใช้แพ็คเกจเครื่องมือวัดที่ติดตั้ง ใช้ getLastDeviceRunResults()
ทันทีเพื่อรับรายละเอียดของผลลัพธ์
พารามิเตอร์ |
---|
runner | String : รันเนอร์เครื่องมือที่จะใช้ |
pkgName | String : ชื่อของแพ็คเกจที่จะรัน |
testClassName | String : ชื่อของคลาสทดสอบที่จะรัน |
testMethodName | String : ชื่อของวิธีการทดสอบในคลาสที่จะเรียกใช้ |
ส่งคืน |
---|
boolean | จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เป็นอย่างอื่น |
เซทเอบี
public final void setAbi (IAbi abi)
public final void setTestInformation (TestInformation testInformation)
พารามิเตอร์ |
---|
testInformation | TestInformation |
ถอนการติดตั้งแพ็คเกจ
public final String uninstallPackage (String pkgName)
ถอนการติดตั้งแพ็คเกจบนอุปกรณ์
พารามิเตอร์ |
---|
pkgName | String : แพ็คเกจ Android ที่จะถอนการติดตั้ง |
ส่งคืน |
---|
String | String ที่มีรหัสข้อผิดพลาดหรือ null หากสำเร็จ |
ถอนการติดตั้งแพ็คเกจ
public final String uninstallPackage (ITestDevice device,
String pkgName)
ถอนการติดตั้งแพ็คเกจบนอุปกรณ์
พารามิเตอร์ |
---|
device | ITestDevice : อุปกรณ์ที่ควรถอนการติดตั้งแพ็คเกจ |
pkgName | String : แพ็คเกจ Android ที่จะถอนการติดตั้ง |
ส่งคืน |
---|
String | String ที่มีรหัสข้อผิดพลาดหรือ null หากสำเร็จ |