@AfterMethod
 public void DefaultResult(ITestResult result) throws InterruptedException {
   System.out.println("Method name: " + result.getMethod().getMethodName());
   System.out.println("Success %:" + result.isSuccess());
   if (!result.isSuccess()) {
     TestUtil.takeScreenShot(result.getMethod().getMethodName());
     closeBrowser();
     System.out.println("Closing the Browser");
     openBrowser();
     System.out.println("Opening the Browser");
     TestUtil.doLogin();
     System.out.println("Performed Login");
   } else {
     System.out.println("Testcase is passed, Not required to call Exit!");
   }
 }
Ejemplo n.º 2
0
  public static void main(String[] args) {
    int[] A = {1, 5, 4, 3, 1, 2, 0, 1};
    int step = new Q39_JumpGame2().jumpMy(A);
    System.out.println(step);
    int step2 = new Q39_JumpGame2().jumpEx(A);
    System.out.println(step2);

    int[] testA = TestUtil.generateArray(999, 50, false);
    long l1 = System.currentTimeMillis();
    int stepa = new Q39_JumpGame2().jumpMy(testA);
    long l2 = System.currentTimeMillis();
    int stepb = new Q39_JumpGame2().jumpEx(testA);
    long l3 = System.currentTimeMillis();
    long span1 = l2 - l1, span2 = l3 - l2;
    System.out.println(stepa + " Cost " + span1);
    System.out.println(stepb + " Cost " + span2);
  }
 // Runmode of test case in a suite
 @BeforeTest
 public void checkTestSkip() throws Exception {
   TestUtil.checkTestSkip("ExamTakerSuite", "TestCase_DeleteExamTaker");
 }