BasicJeriExporter exporter = new BasicJeriExporter(
new TestServerEndpoint(getListenPort()), new BasicILFactory());
TestServiceImpl service = new TestServiceImpl();
TestService stub = (TestService) exporter.export(service);
//send a request and receive a response
stub.doSomething();
//Verify that checkPermissions is called
if (methodCalls.get(checkPermissions)==null) {
throw new TestException("The ServerConnectionManager"
+ " did not call checkPermissions on the ServerConnection");
}