assertEquals("d", c.getSharedSessionName());
}
public void testMissingSessionException() {
// Set up the test objects. We want to mock out RemoteService.
HessianConnection c = new HessianConnection("a");
c.service = new RemoteService() {
public RemoteSession establishSession() throws RemoteException {
return null;
}
public RemoteSession establishSharedSession(String name) throws RemoteException {
return null;
}
public Object processMessage(ClientMessage message) throws RemoteException, Throwable {
throw new MissingSessionException();
}
};
try {
c.doSendMessage(null);
}
catch (CayenneRuntimeException e) {
// Verify that CayenneRuntimeExceptions are not wrapped in another CayenneRuntimeException.
assertTrue(e instanceof MissingSessionException);
}