* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.parser.impl.message.update;
import static org.junit.Assert.assertArrayEquals;
@Test
public void testUnrecognizedAttributesSerializer() {
- final byte[] unrecognizedValue1 = { (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35 };
- final byte[] unrecognizedValue2 = { (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd7, 0x5d, 0x75, (byte)0xd7, 0x5d, 0x75 };
- final byte[] unrecognizedBytes = { (byte)0xe0, 0x65, 0x0c, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35,
- (byte)0xe0, 0x66, 0x0c, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd7, 0x5d, 0x75, (byte)0xd7, 0x5d, 0x75 };
+ final byte[] unrecognizedValue1 = {
+ (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35
+ };
+ final byte[] unrecognizedValue2 = {
+ (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd7, 0x5d, 0x75, (byte)0xd7, 0x5d, 0x75
+ };
+ final byte[] unrecognizedBytes = {
+ (byte)0xe0, 0x65, 0x0c, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35,
+ (byte)0xd3, 0x5d, 0x35, (byte)0xe0, 0x66, 0x0c, (byte)0xd3, 0x5d, 0x35, (byte)0xd3, 0x5d, 0x35,
+ (byte)0xd7, 0x5d, 0x75, (byte)0xd7, 0x5d, 0x75
+ };
final List<UnrecognizedAttributes> unrecognizedAttrs = new ArrayList<>();
- final UnrecognizedAttributes unrecognizedAttribute1 = new UnrecognizedAttributesBuilder().setPartial(true).setTransitive(true).setType((short) 101).setValue(unrecognizedValue1).build();
+ final UnrecognizedAttributes unrecognizedAttribute1 = new UnrecognizedAttributesBuilder().setPartial(true)
+ .setTransitive(true).setType((short) 101).setValue(unrecognizedValue1).build();
unrecognizedAttrs.add(unrecognizedAttribute1);
- final UnrecognizedAttributes unrecognizedAttribute2 = new UnrecognizedAttributesBuilder().setPartial(true).setTransitive(true).setType((short) 102).setValue(unrecognizedValue2).build();
+ final UnrecognizedAttributes unrecognizedAttribute2 = new UnrecognizedAttributesBuilder().setPartial(true)
+ .setTransitive(true).setType((short) 102).setValue(unrecognizedValue2).build();
unrecognizedAttrs.add(unrecognizedAttribute2);
final Attributes attrs = new AttributesBuilder().setUnrecognizedAttributes(unrecognizedAttrs).build();
final ByteBuf buffer = Unpooled.buffer();
- ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry().serializeAttribute(attrs, buffer);
+ ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry().serializeAttribute(attrs,
+ buffer);
assertArrayEquals(unrecognizedBytes, ByteArray.readAllBytes(buffer));
}
}