Code example for TestResult

Methods: addListener

0
        try { 
            TestResult r = aTestRunner.start(args);
            if (!r.wasSuccessful())
                System.exit(FAILURE_EXIT);
            System.exit(SUCCESS_EXIT);
        } catch(Exception e) {
            System.err.println(e.getMessage());
            System.exit(EXCEPTION_EXIT);
        } 
    } 
 
    private static void printUsage() { 
        System.out.println("Usage: DeviceTestRunner <test_class> [-s device_serial] " +
                "[-p test_data_path]"); 
    } 
 
    /** 
     * Override parent to set DeviceTest data 
     */ 
    @Override 
    public TestResult doRun(Test test, boolean wait) {
        if (test instanceof DeviceTest) {