จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ

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 ( ITestDevice device, String apkFileName, String... options)

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

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

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

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

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

final void installPackageAsUser ( ITestDevice device, 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

getAbi

public final IAbi getAbi ()

คืนสินค้า
IAbi

getBuild

public final IBuildInfo getBuild ()

คืนสินค้า
IBuildInfo

getDevice

public final ITestDevice getDevice ()

คืนสินค้า
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

คืนสินค้า
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

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

คืนสินค้า
TestRunResult

getListDevices

public final  getListDevices ()

คืนสินค้า

getTestInformation

public TestInformation getTestInformation ()

คืนสินค้า
TestInformation

มีDeviceFeature

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 (ITestDevice device, 
                String apkFileName, 
                String... options)

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

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

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

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

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

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

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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

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

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

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

userId int : รหัสผู้ใช้ของผู้ใช้ที่จะติดตั้ง apk

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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 : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่ง install

ขว้าง
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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (DeviceTestRunOptions options)

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

setAbi

public final void setAbi (IAbi abi)

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

setTestInformation

public final void setTestInformation (TestInformation testInformation)

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

ถอนการติดตั้งแพ็คเกจ

public final String uninstallPackage (String pkgName)

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

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

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

ขว้าง
DeviceNotAvailableException

ถอนการติดตั้งแพ็คเกจ

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

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

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

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

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

ขว้าง
DeviceNotAvailableException
,

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 ( ITestDevice device, String apkFileName, String... options)

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

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

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

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

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

final void installPackageAsUser ( ITestDevice device, 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

getAbi

public final IAbi getAbi ()

คืนสินค้า
IAbi

getBuild

public final IBuildInfo getBuild ()

คืนสินค้า
IBuildInfo

getDevice

public final ITestDevice getDevice ()

คืนสินค้า
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

คืนสินค้า
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

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

คืนสินค้า
TestRunResult

getListDevices

public final  getListDevices ()

คืนสินค้า

getTestInformation

public TestInformation getTestInformation ()

คืนสินค้า
TestInformation

มีDeviceFeature

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 (ITestDevice device, 
                String apkFileName, 
                String... options)

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

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

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

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

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

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

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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

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

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

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

userId int : รหัสผู้ใช้ของผู้ใช้ที่จะติดตั้ง apk

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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 : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่ง install

ขว้าง
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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (DeviceTestRunOptions options)

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

setAbi

public final void setAbi (IAbi abi)

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

setTestInformation

public final void setTestInformation (TestInformation testInformation)

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

ถอนการติดตั้งแพ็คเกจ

public final String uninstallPackage (String pkgName)

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

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

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

ขว้าง
DeviceNotAvailableException

ถอนการติดตั้งแพ็คเกจ

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

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

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

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

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

ขว้าง
DeviceNotAvailableException
,

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 ( ITestDevice device, String apkFileName, String... options)

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

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

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

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

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

final void installPackageAsUser ( ITestDevice device, 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

getAbi

public final IAbi getAbi ()

คืนสินค้า
IAbi

getBuild

public final IBuildInfo getBuild ()

คืนสินค้า
IBuildInfo

getDevice

public final ITestDevice getDevice ()

คืนสินค้า
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

คืนสินค้า
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

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

คืนสินค้า
TestRunResult

getListDevices

public final  getListDevices ()

คืนสินค้า

getTestInformation

public TestInformation getTestInformation ()

คืนสินค้า
TestInformation

มีDeviceFeature

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 (ITestDevice device, 
                String apkFileName, 
                String... options)

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

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

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

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

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

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

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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

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

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

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

userId int : รหัสผู้ใช้ของผู้ใช้ที่จะติดตั้ง apk

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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 : ตัวเลือกพิเศษที่กำหนดให้กับคำสั่ง install

ขว้าง
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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

runDeviceTests

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 จริงถ้ามันสำเร็จโดยไม่ล้มเหลว เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

ขว้าง
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (DeviceTestRunOptions options)

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

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

คืนสินค้า
boolean True if it succeeded without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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)

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
device ITestDevice : the device agaisnt which to run the instrumentation.

runner String

pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

testMethodName String : the name of the test method in the class to be run.

userId Integer : the id of the user to run the test against. can be null.

testTimeoutMs Long : the timeout in millisecond to be applied to each test case.

maxTimeToOutputMs Long : the max timeout the test has to start outputting something.

maxInstrumentationTimeoutMs Long : the max timeout the full instrumentation has to complete.

checkResults boolean : whether or not the results are checked for crashes.

isHiddenApiCheckDisabled boolean : whether or not we should disable the hidden api check.

isTestApiCheckDisabled boolean : whether or not we should disable the test api check.

isIsolatedStorageDisabled boolean : whether or not we should disable isolated storage.

isWindowAnimationDisabled boolean : whether or not we should disable window animation.

isRestartDisabled boolean

instrumentationArgs : arguments to pass to the instrumentation.

extraListeners

คืนสินค้า
boolean True if it succeeded without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
device ITestDevice : the device agaisnt which to run the instrumentation.

pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

testMethodName String : the name of the test method in the class to be run.

คืนสินค้า
boolean True if it succeed without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

userId Integer : the id of the user to run the test against. can be null.

testTimeoutMs Long : the timeout in millisecond to be applied to each test case.

คืนสินค้า
boolean True if it succeed without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

คืนสินค้า
boolean True if it succeed without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

testTimeoutMs Long : the timeout in millisecond to be applied to each test case.

คืนสินค้า
boolean True if it succeed without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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)

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
device ITestDevice : the device agaisnt which to run the instrumentation.

runner String

pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

testMethodName String : the name of the test method in the class to be run.

userId Integer : the id of the user to run the test against. can be null.

testTimeoutMs Long : the timeout in millisecond to be applied to each test case.

maxTimeToOutputMs Long : the max timeout the test has to start outputting something.

maxInstrumentationTimeoutMs Long : the max timeout the full instrumentation has to complete.

checkResults boolean : whether or not the results are checked for crashes.

isHiddenApiCheckDisabled boolean : whether or not we should disable the hidden api check.

isTestApiCheckDisabled boolean : whether or not we should disable the test api check.

isIsolatedStorageDisabled boolean : whether or not we should disable isolated storage.

instrumentationArgs : arguments to pass to the instrumentation.

extraListeners

คืนสินค้า
boolean True if it succeeded without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

runDeviceTests

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

Method to run an installed instrumentation package. Use getLastDeviceRunResults() right after to get the details of results.

พารามิเตอร์
runner String : the instrumentation runner to be used.

pkgName String : the name of the package to run.

testClassName String : the name of the test class to run.

testMethodName String : the name of the test method in the class to be run.

คืนสินค้า
boolean True if it succeed without failure. เท็จเป็นอย่างอื่น

ขว้าง
DeviceNotAvailableException

setAbi

public final void setAbi (IAbi abi)

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

setTestInformation

public final void setTestInformation (TestInformation testInformation)

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

uninstallPackage

public final String uninstallPackage (String pkgName)

Uninstalls a package on the device.

พารามิเตอร์
pkgName String : the Android package to uninstall

คืนสินค้า
String a String with an error code, or null if success

ขว้าง
DeviceNotAvailableException

uninstallPackage

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

Uninstalls a package on the device

พารามิเตอร์
device ITestDevice : the device that should uninstall the package.

pkgName String : the Android package to uninstall

คืนสินค้า
String a String with an error code, or null if success

ขว้าง
DeviceNotAvailableException