throws IOException,
ClassNotFoundException,
EncodingException
{
final String k1 = MemcachedDriverTest.keyPrefix + "_key_fabulous";
final byte[] b1 = this.encoder.encode (" and miraculous", new EncodingMetadata ("text/plain", "identity")).data;
final KeyValueMessage mssg1 = new KeyValueMessage (k1, b1, "identity", "text/plain");
final IOperationCompletionHandler<Boolean> handler = new TestLoggingHandler<Boolean> ("append");
final IResult<Boolean> r1 = this.wrapper.invokeAppendOperation (MemcachedDriverTest.keyPrefix, mssg1, handler);
try {
Assert.assertTrue (r1.getResult ());
} catch (final InterruptedException e) {
this.exceptions.traceIgnoredException (e);
Assert.fail ();
} catch (final ExecutionException e) {
this.exceptions.traceIgnoredException (e);
Assert.fail ();
}
final IOperationCompletionHandler<KeyValueMessage> handler1 = new TestLoggingHandler<KeyValueMessage> ("Get after append");
final IResult<KeyValueMessage> r2 = this.wrapper.invokeGetOperation (MemcachedDriverTest.keyPrefix, k1, new EncodingMetadata ("text/plain", "identity"), handler1);
try {
final KeyValueMessage mssg = r2.getResult ();
Assert.assertEquals ("fantabulous and miraculous", this.encoder.decode (mssg.getData (), new EncodingMetadata ("text/plain", "identity")));
} catch (final InterruptedException e) {
this.exceptions.traceIgnoredException (e);
Assert.fail ();
} catch (final ExecutionException e) {
this.exceptions.traceIgnoredException (e);