Ejemplo n.º 1
0
  @Test
  @Ignore // timeout no longer works for the primary viewdef for now
  public void testTimeout() throws Exception {
    // should take 1s to render this
    ViewDef view = new TestViewDef();
    view.addQuery(new DataGeneratorQuery("id", "1st", 10, 5).setDelay(1000));

    // set the renderer to timeout in 500ms
    runner.setTimeoutMS(500);
    assertEquals(500, runner.getTimeoutMS());

    try {
      runner.exec(view);
      fail("Expected timeout");
    } catch (FrameExecException ex) {
      // timeout exception should be thrown (wrapped by a RenderException)
      assertEquals(TimeoutException.class, ex.getCause().getClass());
    }
  }