fixed an issue, around sending exceptions back to the stateless client from the server

This commit is contained in:
Rob Austin
2015-05-14 10:57:05 +01:00
parent 8780e9e697
commit 5b2cb939a4
2 changed files with 31 additions and 1 deletions
@@ -1832,7 +1832,7 @@ class StatelessServerConnector<K, V> {
writeException(writer, e);
writeSizeAndFlags(sizeLocation + SIZE_OF_TRANSACTION_ID, true, writer.in());
writeSizeAndFlags(sizeLocation , true, writer.in());
return null;
}
@@ -205,6 +205,36 @@ public class StatelessClientTest {
}
/**
* test that when the map is full and exception is thrown back to the user
*
* @throws IOException
* @throws InterruptedException
*/
@Test(timeout = 10000, expected = IllegalStateException.class)
public void testExceptionFromServer() throws IOException, InterruptedException {
int port = s_port++;
final int size = 100;
try (ChronicleMap<Integer, CharSequence> serverMap = ChronicleMapBuilder
.of(Integer.class, CharSequence.class)
.entries(10)
.replication((byte) 2, TcpTransportAndNetworkConfig.of(port))
.create()) {
try (ChronicleMap<Integer, CharSequence> statelessMap = localClient(port)) {
for (int i = 0; i < size; i++) {
statelessMap.put(i, "hello");
}
assertEquals(statelessMap.size(), size);
}
}
}
@Test
public void testBufferOverFlowPutAllAndKeySet() throws IOException, InterruptedException {
int port = 10 + s_port++;