Example usage for io.netty.buffer PooledByteBufAllocator DEFAULT

List of usage examples for io.netty.buffer PooledByteBufAllocator DEFAULT

Introduction

In this page you can find the example usage for io.netty.buffer PooledByteBufAllocator DEFAULT.

Prototype

PooledByteBufAllocator DEFAULT

To view the source code for io.netty.buffer PooledByteBufAllocator DEFAULT.

Click Source Link

Usage

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv4TypeSerializerTest.java

License:Open Source License

/**
 * Test correct serialization/*from   ww  w . j  a v a 2 s . c om*/
 */
@Test
public void testSerialize() {
    MatchEntryBuilder builder = prepareIcmpv4TypeMatchEntry((short) 128);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serialize(builder.build(), buffer);

    checkHeader(buffer, false);
    assertEquals("Wrong value", 128, buffer.readUnsignedByte());
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv4TypeSerializerTest.java

License:Open Source License

/**
 * Test correct header serialization//from w ww.  j av a 2 s  .  co m
 */
@Test
public void testSerializeHeader() {
    MatchEntryBuilder builder = prepareIcmpv4TypeHeader(false);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serializeHeader(builder.build(), buffer);

    checkHeader(buffer, false);
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv6CodeSerializerTest.java

License:Open Source License

/**
 * Test correct serialization/*  w w w.ja  v  a 2  s.c  o  m*/
 */
@Test
public void testSerialize() {
    MatchEntryBuilder builder = prepareIcmpv6CodeMatchEntry((short) 101);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serialize(builder.build(), buffer);

    checkHeader(buffer, false);
    assertEquals("Wrong value", 101, buffer.readUnsignedByte());
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv6CodeSerializerTest.java

License:Open Source License

/**
 * Test correct header serialization/*  www . j a  v  a  2 s .co  m*/
 */
@Test
public void testSerializeHeader() {
    MatchEntryBuilder builder = prepareIcmpv6CodeHeader(false);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serializeHeader(builder.build(), buffer);

    checkHeader(buffer, false);
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv6TypeSerializerTest.java

License:Open Source License

/**
 * Test correct serialization//from  w  w w  .j a  v a  2s .c  o m
 */
@Test
public void testSerialize() {
    MatchEntryBuilder builder = prepareIcmpv6TypeMatchEntry((short) 123);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serialize(builder.build(), buffer);

    checkHeader(buffer, false);
    assertEquals("Wrong value", 123, buffer.readUnsignedByte());
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv6TypeSerializerTest.java

License:Open Source License

/**
 * Test correct header serialization/*w  w w .  jav  a2s . c  o m*/
 */
@Test
public void testSerializeHeader() {
    MatchEntryBuilder builder = prepareIcmpv6TypeHeader(false);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serializeHeader(builder.build(), buffer);

    checkHeader(buffer, false);
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpDscpSerializerTest.java

License:Open Source License

/**
 * Test correct serialization/*from   w  ww  .  jav  a  2 s  . c  o  m*/
 */
@Test
public void testSerialize() {
    MatchEntryBuilder builder = prepareIpDscpMatchEntry((short) 58);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serialize(builder.build(), buffer);

    checkHeader(buffer, false);
    assertEquals("Wrong value", 58, buffer.readUnsignedByte());
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpDscpSerializerTest.java

License:Open Source License

/**
 * Test correct header serialization//from  www  .  ja  v  a2 s.  c  om
 */
@Test
public void testSerializeHeader() {
    MatchEntryBuilder builder = prepareIpDscpHeader(false);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serializeHeader(builder.build(), buffer);

    checkHeader(buffer, false);
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpProtoSerializerTest.java

License:Open Source License

/**
 * Test correct serialization//  w  ww.j a  v a  2s  .com
 */
@Test
public void testSerialize() {
    MatchEntryBuilder builder = prepareMatchEntry((short) 123);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serialize(builder.build(), buffer);

    checkHeader(buffer, false);
    assertEquals("Wrong value", 123, buffer.readUnsignedByte());
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}

From source file:org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpProtoSerializerTest.java

License:Open Source License

/**
 * Test correct header serialization//  w  w  w  .j a v a2 s  .co  m
 */
@Test
public void testSerializeHeader() {
    MatchEntryBuilder builder = prepareHeader(false);

    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    serializer.serializeHeader(builder.build(), buffer);

    checkHeader(buffer, false);
    assertTrue("Unexpected data", buffer.readableBytes() == 0);
}