use of com.hazelcast.nio.ObjectDataOutput in project hazelcast by hazelcast.
the class InvalidRawDataPortable method writePortable.
@Override
public void writePortable(PortableWriter writer) throws IOException {
writer.writeLong("l", l);
final ObjectDataOutput output = writer.getRawDataOutput();
output.writeInt(k);
output.writeUTF(s);
writer.writeCharArray("c", c);
output.writeObject(sds);
writer.writePortable("p", p);
}
use of com.hazelcast.nio.ObjectDataOutput in project hazelcast-jet by hazelcast.
the class DistributedDoubleSummaryStatisticsTest method writeData.
@Test
public void writeData() throws IOException {
// Given
DistributedDoubleSummaryStatistics stats = new DistributedDoubleSummaryStatistics();
stats.accept(1);
stats.accept(3);
ObjectDataOutput out = mock(ObjectDataOutput.class);
// When
stats.writeData(out);
// Then
verify(out).writeLong(stats.getCount());
verify(out).writeDouble(stats.getSum());
verify(out).writeDouble(stats.getMin());
verify(out).writeDouble(stats.getMax());
verifyNoMoreInteractions(out);
}
use of com.hazelcast.nio.ObjectDataOutput in project hazelcast-jet by hazelcast.
the class DistributedIntSummaryStatisticsTest method writeData.
@Test
public void writeData() throws IOException {
// Given
DistributedIntSummaryStatistics stats = new DistributedIntSummaryStatistics();
stats.accept(1);
stats.accept(3);
ObjectDataOutput out = mock(ObjectDataOutput.class);
// When
stats.writeData(out);
// Then
verify(out).writeLong(stats.getCount());
verify(out).writeLong(stats.getSum());
verify(out).writeInt(stats.getMin());
verify(out).writeInt(stats.getMax());
verifyNoMoreInteractions(out);
}
use of com.hazelcast.nio.ObjectDataOutput in project hazelcast-jet by hazelcast.
the class DistributedLongSummaryStatisticsTest method writeData.
@Test
public void writeData() throws IOException {
// Given
DistributedLongSummaryStatistics stats = new DistributedLongSummaryStatistics();
stats.accept(1);
stats.accept(3);
ObjectDataOutput out = mock(ObjectDataOutput.class);
// When
stats.writeData(out);
// Then
verify(out).writeLong(stats.getCount());
verify(out).writeLong(stats.getSum());
verify(out).writeLong(stats.getMin());
verify(out).writeLong(stats.getMax());
verifyNoMoreInteractions(out);
}
use of com.hazelcast.nio.ObjectDataOutput in project dolphin-platform by canoo.
the class EventStreamSerializerTests method convertToJson.
private <T extends Serializable> JsonElement convertToJson(DolphinEvent<T> event) throws IOException {
final EventStreamSerializer streamSerializer = new EventStreamSerializer();
final ObjectDataOutput output = new ByteObjectDataOutput();
streamSerializer.write(output, event);
final byte[] rawOutputData = output.toByteArray();
final String outputData = new String(rawOutputData);
return new JsonParser().parse(outputData);
}
Aggregations