use of org.apache.geode.cache.client.internal.Op in project geode by apache.
the class ClientServerMiscDUnitTest method testLargeMessageIsRejected.
/**
* GEODE-478 - large payloads are rejected by client->server
*/
@Test
public void testLargeMessageIsRejected() throws Exception {
PORT1 = initServerCache(false);
createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1);
Region region = static_cache.getRegion(REGION_NAME1);
Op operation = new Op() {
@Override
public Object attempt(Connection cnx) throws Exception {
throw new MessageTooLargeException("message is too big");
}
@Override
public boolean useThreadLocalConnection() {
return false;
}
};
try {
((LocalRegion) region).getServerProxy().getPool().execute(operation);
} catch (GemFireIOException e) {
assertTrue(e.getCause() instanceof MessageTooLargeException);
return;
}
fail("expected an exception to be thrown");
}
Aggregations