Added meta-inf to stateful02.
[bgpcep.git] / pcep / impl / src / test / java / org / opendaylight / protocol / pcep / impl / PCEPRROSubobjectParserTest.java
index 1ed5cd83d3b84ed960904ca5533d7cfe544544af..d99eaedb5d08e0dff62853713a6af7dc0395af26 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.protocol.pcep.impl.subobject.RROPathKey128SubobjectParse
 import org.opendaylight.protocol.pcep.impl.subobject.RROPathKey32SubobjectParser;
 import org.opendaylight.protocol.pcep.impl.subobject.RROUnnumberedInterfaceSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext;
+import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
@@ -120,14 +120,18 @@ public class PCEPRROSubobjectParserTest {
 
        @Test
        public void testRROLabelSubobject() throws Exception {
-               final RROLabelSubobjectParser parser = new RROLabelSubobjectParser(ServiceLoaderPCEPExtensionProviderContext.create().getLabelHandlerRegistry());
-               final SubobjectBuilder subs = new SubobjectBuilder();
-               subs.setSubobjectType(new LabelCaseBuilder().setLabel(
-                               new LabelBuilder().setUniDirectional(true).setGlobal(true).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(ByteArray.cutBytes(labelBytes, 2)));
-               assertArrayEquals(labelBytes, parser.serializeSubobject(subs.build()));
+               final SimplePCEPExtensionProviderContext ctx = new SimplePCEPExtensionProviderContext();
+               try (Activator a = new Activator()) {
+                       a.start(ctx);
+                       final RROLabelSubobjectParser parser = new RROLabelSubobjectParser(ctx.getLabelHandlerRegistry());
+                       final SubobjectBuilder subs = new SubobjectBuilder();
+                       subs.setSubobjectType(new LabelCaseBuilder().setLabel(
+                                       new LabelBuilder().setUniDirectional(true).setGlobal(true).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(ByteArray.cutBytes(labelBytes, 2)));
+                       assertArrayEquals(labelBytes, parser.serializeSubobject(subs.build()));
+               }
        }
 }