Search in sources :

Example 1 with ArbitraryCaseBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.ArbitraryCaseBuilder in project bgpcep by opendaylight.

the class ArbitraryParserTest method parserTest.

@Test
public void parserTest() {
    final ByteBuf buff = Unpooled.buffer(VALUE_SIZE);
    final ArbitraryCase arbitrary = new ArbitraryCaseBuilder().setArbitrary(new ArbitraryBuilder().setArbitrary(ARB_VALUE).build()).build();
    this.parser.serializeEsi(arbitrary, buff);
    assertArrayEquals(ARB_RESULT, ByteArray.getAllBytes(buff));
    final Esi acResult = this.parser.parseEsi(Unpooled.wrappedBuffer(ARB_VALUE));
    assertEquals(arbitrary, acResult);
    final ContainerNode cont = createContBuilder(new NodeIdentifier(Arbitrary.QNAME)).addChild(createValueBuilder(ARB_VALUE, ARB_NID).build()).build();
    final Esi acmResult = this.parser.serializeEsi(cont);
    assertEquals(arbitrary, acmResult);
}
Also used : ArbitraryCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.ArbitraryCase) NodeIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier) Esi(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) ArbitraryCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.ArbitraryCaseBuilder) ArbitraryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.arbitrary._case.ArbitraryBuilder) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 Esi (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi)1 ArbitraryCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.ArbitraryCase)1 ArbitraryCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.ArbitraryCaseBuilder)1 ArbitraryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.arbitrary._case.ArbitraryBuilder)1 NodeIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)1 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)1