fix tests for chronicle map on engine.

This commit is contained in:
Peter Lawrey
2015-05-17 12:22:42 +01:00
parent 9b74715f22
commit 5ed8ea7833
@@ -3,13 +3,16 @@ package net.openhft.chronicle.map;
import net.openhft.chronicle.engine.client.ClientWiredStatelessTcpConnectionHub;
import net.openhft.chronicle.wire.CoreFields;
import net.openhft.chronicle.wire.ParameterizeWireKey;
import net.openhft.chronicle.wire.ValueIn;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.function.Function;
/**
* Created by Rob Austin
*/
public abstract class MapStatelessClient< E extends ParameterizeWireKey> extends AbstactStatelessClient<E> {
public abstract class MapStatelessClient<E extends ParameterizeWireKey> extends AbstactStatelessClient<E> {
/**
* @param channelName
@@ -28,14 +31,19 @@ public abstract class MapStatelessClient< E extends ParameterizeWireKey> extends
@Nullable
protected <R> R proxyReturnTypedObject(
@NotNull final E eventId,
R usingValue,
@NotNull final Class<R> resultType,
@Nullable Object... args) {
Function<ValueIn, R> consumerIn = resultType == CharSequence.class && usingValue != null
? f -> {
f.text((StringBuilder) usingValue);
return usingValue;
}
: f -> f.object(resultType);
return proxyReturnWireConsumerInOut(eventId,
CoreFields.reply, toParameters(eventId, args),
f -> f.object(resultType));
CoreFields.reply,
toParameters(eventId, args),
consumerIn);
}
}