@Test
  public void testRemoteInvocationWithException() {
    Throwable thrown = catchThrowable(() -> vm0.invoke(BasicDistributedTest::remoteThrowException));

    assertThat(thrown, instanceOf(RMIException.class));
    assertThat(thrown.getCause(), notNullValue());
    assertThat(thrown.getCause(), instanceOf(BasicTestException.class));
    assertThat(thrown.getCause().getMessage(), is(MESSAGE_FOR_remoteThrowException));
  }
This class tests the basic functionality of the distributed unit test framework.
geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/BasicDistributedTest.java