use of org.opendaylight.protocol.rsvp.parser.spi.pojo.SimpleRSVPExtensionProviderContext in project bgpcep by opendaylight.
the class LinkstateAttributeParserTest method setUp.
@Before
public final void setUp() {
this.context = new SimpleRSVPExtensionProviderContext();
this.rsvpActivator = new RSVPActivator();
this.rsvpActivator.start(this.context);
this.parser = new LinkstateAttributeParser(false, this.context.getRsvpRegistry());
}
use of org.opendaylight.protocol.rsvp.parser.spi.pojo.SimpleRSVPExtensionProviderContext in project bgpcep by opendaylight.
the class EROSubobjectParserTest method setUp.
@Before
public void setUp() {
this.ctx = new SimpleRSVPExtensionProviderContext();
this.act = new RSVPActivator();
this.act.start(this.ctx);
}
use of org.opendaylight.protocol.rsvp.parser.spi.pojo.SimpleRSVPExtensionProviderContext in project bgpcep by opendaylight.
the class RROSubobjectParserTest method testRROLabelSubobject.
@Test
public void testRROLabelSubobject() throws Exception {
final SimpleRSVPExtensionProviderContext ctx = new SimpleRSVPExtensionProviderContext();
try (RSVPActivator a = new RSVPActivator()) {
a.start(ctx);
final RROLabelSubobjectParser parser = new RROLabelSubobjectParser(ctx.getLabelHandlerRegistry());
final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
subs.setSubobjectType(new LabelCaseBuilder().setLabel(new LabelBuilder().setUniDirectional(true).setGlobal(false).setLabelType(new GeneralizedLabelCaseBuilder().setGeneralizedLabel(new GeneralizedLabelBuilder().setGeneralizedLabel(new byte[] { (byte) 0x12, (byte) 0x00, (byte) 0x25, (byte) 0xFF }).build()).build()).build()).build());
assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(LABEL_BYTES, 2))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
Assert.assertArrayEquals(LABEL_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null);
Assert.fail();
} catch (final IllegalArgumentException e) {
Assert.assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
}
try {
parser.parseSubobject(Unpooled.EMPTY_BUFFER);
Assert.fail();
} catch (final IllegalArgumentException e) {
Assert.assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
}
}
}
use of org.opendaylight.protocol.rsvp.parser.spi.pojo.SimpleRSVPExtensionProviderContext in project bgpcep by opendaylight.
the class TEObjectTest method setUp.
@Before
public void setUp() {
this.act = new RSVPActivator();
this.context = new SimpleRSVPExtensionProviderContext();
this.act.start(this.context);
}
Aggregations