public void testCheckServiceVersionMismatchedMinorVersion() throws Exception {
    DummyService service = createDummyService();

    service.callCheckServiceVersion(1, 0, null);
    service.checkHandleServiceVersionMismatchInvoked(false);
    service.callCheckServiceVersion(1, 1, null);
    service.checkHandleServiceVersionMismatchInvoked(true);
  }
  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);
  }
  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);
  }