コード例 #1
0
 /** check the normal scenario works */
 @Test(timeout = 1000)
 public void basic() throws InterruptedException {
   // should work
   MockedRequestHandler newSessionRequest = new MockedNewSessionRequestHandler(registry, ff);
   newSessionRequest.process();
   TestSession s = newSessionRequest.getTestSession();
   Assert.assertNotNull(s);
   s.terminate();
   Assert.assertEquals(0, registry.getNewSessionRequests().size());
 }
コード例 #2
0
 /** check the normal scenario works */
 @Test(timeout = 1000)
 public void basic() {
   // should work
   MockedRequestHandler newSessionRequest = GridHelper.createNewSessionHandler(registry, ff);
   newSessionRequest.process();
   TestSession s = newSessionRequest.getSession();
   assertNotNull(s);
   registry.terminate(s, SessionTerminationReason.CLIENT_STOPPED_SESSION);
   assertEquals(0, registry.getNewSessionRequestCount());
 }
コード例 #3
0
 /** check the normal scenario works */
 @Test(timeout = 1000)
 public void basic() {
   // should work
   MockedRequestHandler newSessionRequest = new MockedNewSessionRequestHandler(registry, ff);
   newSessionRequest.process();
   TestSession s = newSessionRequest.getTestSession();
   Assert.assertNotNull(s);
   registry.terminate(s);
   Assert.assertEquals(0, registry.getNewSessionRequestCount());
 }
コード例 #4
0
  /**
   * check that a crashes during the new session request handling doesn't result in a corrupted
   * state
   *
   * @throws InterruptedException
   */
  @Test(timeout = 1000)
  public void requestIsremovedFromTheQeueAfterItcrashes() throws InterruptedException {
    // should work
    try {
      MockedRequestHandler newSessionRequest =
          new MockedBuggyNewSessionRequestHandler(registry, ff);
      newSessionRequest.process();
    } catch (RuntimeException e) {
      System.out.println(e.getMessage());
    }

    Assert.assertEquals(0, registry.getNewSessionRequests().size());
  }
コード例 #5
0
  /**
   * check that a crashes during the new session request handling doesn't result in a corrupted
   * state
   */
  @Test(timeout = 1000)
  public void requestIsremovedFromTheQeueAfterItcrashes() throws InterruptedException {
    // should work
    try {
      SeleniumBasedRequest newSession =
          GridHelper.createNewSessionRequest(registry, SeleniumProtocol.WebDriver, ff);
      MockedRequestHandler newSessionRequest =
          new MockedBuggyNewSessionRequestHandler(newSession, null, registry);
      newSessionRequest.process();
    } catch (RuntimeException e) {
      System.out.println(e.getMessage());
    }

    assertEquals(0, registry.getNewSessionRequestCount());
  }