host.registerService("bar1", 9999, new MockRemote());
host.unregisterService("bar1", 9999);
}
public void testRegisterServiceAlreadyBound() throws RMIHostRuntimeException, RMIHostException {
DefaultRMIHost host = new DefaultRMIHost();
host.registerService("bar2", 9997, new MockRemote());
try {
host.registerService("bar2", 9997, new MockRemote());
} catch (RMIHostException e) {
// expected
host.unregisterService("bar2", 9997);
}
}