use of org.apache.ignite.client.PersonBinarylizable in project ignite by apache.
the class CacheAsyncTest method testPutAsyncThrowsExceptionOnFailedSerialization.
/**
* Tests that request encode errors are handled correctly.
*/
@Test
public void testPutAsyncThrowsExceptionOnFailedSerialization() {
ClientCache<Integer, PersonBinarylizable> cache = client.createCache(TMP_CACHE_NAME);
IgniteClientFuture<Void> fut = cache.putAsync(1, new PersonBinarylizable("1", true, false, false));
GridTestUtils.assertThrowsAnyCause(null, fut::get, BinaryObjectException.class, "Failed to serialize object [typeName=org.apache.ignite.client.PersonBinarylizable]");
}
use of org.apache.ignite.client.PersonBinarylizable in project ignite by apache.
the class CacheAsyncTest method testGetAsyncThrowsExceptionOnFailedDeserialization.
/**
* Tests that response decode errors are handled correctly.
*/
@Test
public void testGetAsyncThrowsExceptionOnFailedDeserialization() throws Exception {
ClientCache<Integer, PersonBinarylizable> cache = client.createCache(TMP_CACHE_NAME);
cache.put(1, new PersonBinarylizable("1", false, true, false));
Throwable t = cache.getAsync(1).handle((res, err) -> err).toCompletableFuture().get();
assertTrue(t.getMessage().contains("Failed to deserialize object"));
assertTrue(X.hasCause(t, "Failed to deserialize object", ClientException.class));
assertTrue(X.hasCause(t, "_read_", ArithmeticException.class));
}
use of org.apache.ignite.client.PersonBinarylizable in project ignite by apache.
the class IgniteCacheContinuousQueryClientTest method testFailedSerializationAfterNodeLeaves.
/**
* Checks that deserialization error after client node leaves does not fail server node.
*/
@Test
public void testFailedSerializationAfterNodeLeaves() throws Exception {
startGrids(1);
final int CLIENT_ID = 1;
Ignite clientNode = startClientGrid(CLIENT_ID);
IgniteCache<Integer, PersonBinarylizable> cache = clientNode.cache(DEFAULT_CACHE_NAME);
PersonBinarylizable bin = new PersonBinarylizable("1", false, true, true);
cache.query(new ScanQuery<>((k, v) -> !v.equals(bin)));
stopGrid(1);
Thread.sleep(1100);
assertNotNull(grid(0).cache(DEFAULT_CACHE_NAME));
assertFalse(failure.get());
stopGrid(0);
}
Aggregations