use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class TEObjectTest method testFlowSpecObjectParser_HEAD_5.
@Test
public void testFlowSpecObjectParser_HEAD_5() throws RSVPParsingException {
final FlowSpecObjectParser parser = new FlowSpecObjectParser();
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_FLOWSPEC_H5, 4, TEObjectUtil.TE_LSP_FLOWSPEC_H5.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_FLOWSPEC_H5, ByteArray.getAllBytes(output));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class TEObjectTest method testBandwidthObjectParser2.
@Test
public void testBandwidthObjectParser2() throws RSVPParsingException {
final ReoptimizationBandwidthObjectParser parser = new ReoptimizationBandwidthObjectParser();
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_BANDWIDTH_2, 4, TEObjectUtil.TE_LSP_BANDWIDTH_2.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_BANDWIDTH_2, ByteArray.getAllBytes(output));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class TEObjectTest method testSessionAttributeParser1.
@Test
public void testSessionAttributeParser1() throws RSVPParsingException {
final SessionAttributeLspRaObjectParser parser = new SessionAttributeLspRaObjectParser();
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_SESSION_C1, 4, TEObjectUtil.TE_LSP_SESSION_C1.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_SESSION_C1, ByteArray.getAllBytes(output));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class TEObjectTest method testSecondaryExplicitRouteParser.
@Test
public void testSecondaryExplicitRouteParser() throws RSVPParsingException {
final SecondaryExplicitRouteObjectParser parser = new SecondaryExplicitRouteObjectParser(this.context.getEROSubobjectHandlerRegistry());
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_SECONDARY_EXPLICIT, 4, TEObjectUtil.TE_LSP_SECONDARY_EXPLICIT.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_SECONDARY_EXPLICIT, ByteArray.getAllBytes(output));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class ProtectionObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final BasicProtectionObjectBuilder builder = new BasicProtectionObjectBuilder();
final ProtectionSubobject pSub = ProtectionCommonParser.parseCommonProtectionBodyType1(byteBuf);
return builder.setProtectionSubobject(pSub).build();
}
Aggregations