use of com.sleepycat.bind.tuple.TupleInput in project qpid-broker-j by apache.
the class AMQShortStringEncodingTest method testWriteReadShortStringWithLengthOver127.
@Test
public void testWriteReadShortStringWithLengthOver127() {
AMQShortString value = createString('a', 128);
// write into tuple output
TupleOutput tupleOutput = new TupleOutput();
AMQShortStringEncoding.writeShortString(value, tupleOutput);
byte[] data = tupleOutput.getBufferBytes();
// read from tuple input
TupleInput tupleInput = new TupleInput(data);
AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
assertEquals("Expected " + value + " but got " + result, value, result);
}
use of com.sleepycat.bind.tuple.TupleInput in project qpid-broker-j by apache.
the class AMQShortStringEncodingTest method testWriteReadShortStringWithLengthLess127.
@Test
public void testWriteReadShortStringWithLengthLess127() {
AMQShortString value = AMQShortString.createAMQShortString("test");
// write into tuple output
TupleOutput tupleOutput = new TupleOutput();
AMQShortStringEncoding.writeShortString(value, tupleOutput);
byte[] data = tupleOutput.getBufferBytes();
// read from tuple input
TupleInput tupleInput = new TupleInput(data);
AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
assertEquals("Expected " + value + " but got " + result, value, result);
}
Aggregations