Exemplo n.º 1
0
  public void testCheckServiceVersionMismatchedMinorVersion() throws Exception {
    DummyService service = createDummyService();

    service.callCheckServiceVersion(1, 0, null);
    service.checkHandleServiceVersionMismatchInvoked(false);
    service.callCheckServiceVersion(1, 1, null);
    service.checkHandleServiceVersionMismatchInvoked(true);
  }
Exemplo n.º 2
0
  public void testHandleServiceVersionMismatchThrowsRuntimeException() throws Exception {
    DummyService service = createDummyService();

    service.callCheckServiceVersion(1, 0, null);
    service.checkHandleServiceVersionMismatchInvoked(false);
    RuntimeException rte = new RuntimeException();
    try {
      service.callCheckServiceVersion(1, 1, rte);
    } catch (IllegalStateException e) {
      System.err.println(e);
      if (e.getCause() != rte) {
        fail("expected cause to be original exception");
      }
    } catch (Exception e) {
      System.err.println(e);
      fail("expected IllegalStateException");
    }

    service.checkHandleServiceVersionMismatchInvoked(true);
  }
Exemplo n.º 3
0
  public void testHandleServiceVersionMismatchThrowsIllegalStateException() throws Exception {
    DummyService service = createDummyService();

    service.callCheckServiceVersion(1, 0, null);
    service.checkHandleServiceVersionMismatchInvoked(false);

    IllegalStateException ise = new IllegalStateException();
    try {
      service.callCheckServiceVersion(1, 1, ise);
    } catch (IllegalStateException e) {
      System.err.println(e);
      if (e != ise) {
        fail("expected IllegalStateException to be original one");
      }
    } catch (Exception e) {
      System.err.println(e);
      fail("expected IllegalStateException");
    }

    service.checkHandleServiceVersionMismatchInvoked(true);
  }