use of org.kaazing.k3po.lang.el.BytesMatcher in project zilla by aklivity.
the class AmqpFunctionsTest method shouldMatchAmqpDataExtensionWithOnlyPropertiesWithLongMessageId.
@Test
public void shouldMatchAmqpDataExtensionWithOnlyPropertiesWithLongMessageId() throws Exception {
BytesMatcher matcher = matchDataEx().typeId(0).messageId(1L).userId("user1").to("clients").build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new AmqpDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0).deliveryTag(b -> b.bytes(b2 -> b2.set("00".getBytes()))).messageFormat(0).flags(1).properties(b -> b.messageId(m -> m.ulong(1L)).userId(u -> u.bytes(b2 -> b2.set("user1".getBytes()))).to("clients")).bodyKind(b -> b.set(VALUE)).build();
assertNotNull(matcher.match(byteBuf));
}
use of org.kaazing.k3po.lang.el.BytesMatcher in project zilla by aklivity.
the class AmqpFunctionsTest method shouldMatchAmqpDataExtensionWithOnlyPropertiesWithStringMessageId.
@Test
public void shouldMatchAmqpDataExtensionWithOnlyPropertiesWithStringMessageId() throws Exception {
BytesMatcher matcher = matchDataEx().typeId(0).messageId("message1").userId("user1").to("clients").build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new AmqpDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0).deliveryTag(b -> b.bytes(b2 -> b2.set("00".getBytes()))).messageFormat(0).flags(1).properties(p -> p.messageId(m -> m.stringtype("message1")).userId(u -> u.bytes(b2 -> b2.set("user1".getBytes()))).to("clients")).bodyKind(b -> b.set(VALUE)).build();
assertNotNull(matcher.match(byteBuf));
}
use of org.kaazing.k3po.lang.el.BytesMatcher in project zilla by aklivity.
the class AmqpFunctionsTest method shouldNotMatchAmqpDataExtensionMessageFormat.
@Test(expected = Exception.class)
public void shouldNotMatchAmqpDataExtensionMessageFormat() throws Exception {
BytesMatcher matcher = matchDataEx().typeId(0).deliveryTag("00").messageFormat(1).flags("SETTLED").bodyKind("VALUE").build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new AmqpDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0).deliveryTag(b -> b.bytes(b2 -> b2.set("00".getBytes()))).messageFormat(0).flags(1).bodyKind(b -> b.set(VALUE)).build();
matcher.match(byteBuf);
}
use of org.kaazing.k3po.lang.el.BytesMatcher in project zilla by aklivity.
the class AmqpFunctionsTest method shouldMatchAmqpDataExtensionWithDeferred.
@Test
public void shouldMatchAmqpDataExtensionWithDeferred() throws Exception {
BytesMatcher matcher = matchDataEx().typeId(0).deliveryTag("00").messageFormat(0).flags("BATCHABLE", "ABORTED", "RESUME", "SETTLED").bodyKind("VALUE").deferred(100).build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new AmqpDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0).deliveryTag(b -> b.bytes(b2 -> b2.set("00".getBytes()))).messageFormat(0).flags(15).bodyKind(b -> b.set(VALUE)).deferred(100).build();
assertNotNull(matcher.match(byteBuf));
}
use of org.kaazing.k3po.lang.el.BytesMatcher in project zilla by aklivity.
the class AmqpFunctionsTest method shouldMatchAmqpDataExtensionWithOnlyPropertiesWithBinaryMessageId.
@Test
public void shouldMatchAmqpDataExtensionWithOnlyPropertiesWithBinaryMessageId() throws Exception {
BytesMatcher matcher = matchDataEx().typeId(0).messageId("message1".getBytes()).userId("user1").to("clients").subject("subject1").replyTo("localhost").correlationId("correlationId1").contentType("content_type").contentEncoding("content_encoding").absoluteExpiryTime(12345L).creationTime(12345L).groupId("group_id1").groupSequence(1).replyToGroupId("reply_group_id").build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new AmqpDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0).deliveryTag(b -> b.bytes(b2 -> b2.set("00".getBytes()))).messageFormat(0).flags(1).properties(p -> p.messageId(m -> m.binary(b1 -> b1.bytes(b2 -> b2.set("message1".getBytes())))).userId(u -> u.bytes(b2 -> b2.set("user1".getBytes(UTF_8)))).to("clients").subject("subject1").replyTo("localhost").correlationId(c -> c.stringtype("correlationId1")).contentType("content_type").contentEncoding("content_encoding").absoluteExpiryTime(12345L).creationTime(12345L).groupId("group_id1").groupSequence(1).replyToGroupId("reply_group_id")).bodyKind(b -> b.set(VALUE)).build();
assertNotNull(matcher.match(byteBuf));
}
Aggregations