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 testProtectionObjectParser1.
@Test
public void testProtectionObjectParser1() throws RSVPParsingException {
final ProtectionObjectParser parser = new ProtectionObjectParser();
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_PROTECTION_C1, 4, TEObjectUtil.TE_LSP_PROTECTION_C1.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_PROTECTION_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 testAdminStatusObjectParser.
@Test
public void testAdminStatusObjectParser() throws RSVPParsingException {
final AdminStatusObjectParser admParser = new AdminStatusObjectParser();
final RsvpTeObject obj = admParser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_ADMIN_STATUS, 4, TEObjectUtil.TE_LSP_ADMIN_STATUS.length - 4)));
final ByteBuf output = Unpooled.buffer();
admParser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_ADMIN_STATUS, 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 testBandwidthObjectParser1.
@Test
public void testBandwidthObjectParser1() throws RSVPParsingException {
final BandwidthObjectParser parser = new BandwidthObjectParser();
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_BANDWIDTH_1, 4, TEObjectUtil.TE_LSP_BANDWIDTH_1.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_BANDWIDTH_1, 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 testProtectionObjectParser2.
@Test
public void testProtectionObjectParser2() throws RSVPParsingException {
final DynamicProtectionObjectParser parser = new DynamicProtectionObjectParser();
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_PROTECTION_C2, 4, TEObjectUtil.TE_LSP_PROTECTION_C2.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_PROTECTION_C2, 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 testRecordRouteParser.
@Test
public void testRecordRouteParser() throws RSVPParsingException {
final RecordRouteObjectParser parser = new RecordRouteObjectParser(this.context.getRROSubobjectHandlerRegistry());
final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_RECORD_ROUTE, 4, TEObjectUtil.TE_LSP_RECORD_ROUTE.length - 4)));
final ByteBuf output = Unpooled.buffer();
parser.serializeObject(obj, output);
assertArrayEquals(TEObjectUtil.TE_LSP_RECORD_ROUTE, ByteArray.getAllBytes(output));
}
Aggregations