UNREACH-DESTINATION Object 20/77820/11
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 13 Nov 2018 15:48:07 +0000 (16:48 +0100)
committerRobert Varga <nite@hq.sk>
Sun, 9 Dec 2018 20:37:52 +0000 (20:37 +0000)
https://tools.ietf.org/html/rfc8306#section-3.14

JIRA: BGPCEP-406
Change-Id: Ie7ef63e7f166059655ff558623c686f087b6302f
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
pcep/api/src/main/yang/pcep-types.yang
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/BaseParserExtensionActivator.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv4UnreachDestinationParser.java [new file with mode: 0644]
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv6UnreachDestinationParser.java [new file with mode: 0644]
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPUnreachDestinationSerializer.java [new file with mode: 0644]
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java

index c31977d98004cfc530ee237a953328226de813b5..dbc36c3c5ce383843a207d12f338716ab087869a 100644 (file)
@@ -517,6 +517,24 @@ module pcep-types {
         }
     }
 
+    grouping unreach-destination-object {
+        description "UNREACH-DESTINATION Object";
+        reference "https://tools.ietf.org/html/rfc8306#section-3.14";
+
+        container unreach-destination-obj {
+            uses object;
+
+            choice destination {
+                case ipv4-destination-case {
+                    uses ipv4-destinations;
+                }
+                case ipv6-destination-case {
+                    uses ipv6-destinations;
+                }
+            }
+        }
+    }
+
     grouping bandwidth {
         // No possibility to carry TLVs
         leaf bandwidth {
index ec7747a3ad42f0b5e11c2fd53e876cbca9f0b83d..4e1d6e64a50086aab61e8c3dfd21865fde413ab2 100644 (file)
@@ -55,6 +55,9 @@ import org.opendaylight.protocol.pcep.parser.object.PCEPSecondaryRecordRouteObje
 import org.opendaylight.protocol.pcep.parser.object.PCEPSvecObjectParser;
 import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPP2MPEndPointsIpv4ObjectParser;
 import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPP2MPEndPointsIpv6ObjectParser;
+import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPIpv4UnreachDestinationParser;
+import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPIpv6UnreachDestinationParser;
+import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPUnreachDestinationSerializer;
 import org.opendaylight.protocol.pcep.parser.subobject.EROAsNumberSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.EROIpv4PrefixSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.EROIpv6PrefixSubobjectParser;
@@ -135,6 +138,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.secondary.explicit.route.object.Sero;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.secondary.reported.route.object.Srro;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.svec.object.Svec;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObj;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.LabelCase;
@@ -229,6 +233,14 @@ public final class BaseParserExtensionActivator extends AbstractPCEPExtensionPro
         final PCEPEndPointsIpv6ObjectParser endpoints6Parser = new PCEPEndPointsIpv6ObjectParser();
         regs.add(context.registerObjectParser(endpoints6Parser));
 
+        final PCEPIpv4UnreachDestinationParser unreachIpv4Parser = new PCEPIpv4UnreachDestinationParser();
+        final PCEPIpv6UnreachDestinationParser unreachIpv6Parser = new PCEPIpv6UnreachDestinationParser();
+        regs.add(context.registerObjectParser(unreachIpv4Parser));
+        regs.add(context.registerObjectParser(unreachIpv6Parser));
+
+        final PCEPUnreachDestinationSerializer unreachSerializer= new PCEPUnreachDestinationSerializer();
+        regs.add(context.registerObjectSerializer(UnreachDestinationObj.class, unreachSerializer));
+
         final PCEPP2MPEndPointsIpv4ObjectParser endpoints4Pp2mparser = new PCEPP2MPEndPointsIpv4ObjectParser();
         regs.add(context.registerObjectParser(endpoints4Pp2mparser));
 
diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv4UnreachDestinationParser.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv4UnreachDestinationParser.java
new file mode 100644 (file)
index 0000000..c3840e4
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.pcep.parser.object.unreach;
+
+import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv4Address;
+
+import com.google.common.base.Preconditions;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import java.util.ArrayList;
+import java.util.List;
+import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
+import org.opendaylight.protocol.pcep.spi.ObjectUtil;
+import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.util.Ipv4Util;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObj;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObjBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv4DestinationCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv4DestinationCaseBuilder;
+
+public final class PCEPIpv4UnreachDestinationParser extends CommonObjectParser {
+    private static final int CLASS = 28;
+    private static final int TYPE = 1;
+
+    public PCEPIpv4UnreachDestinationParser() {
+        super(CLASS, TYPE);
+    }
+
+    public static void serializeObject(
+        final Boolean processing,
+        final Boolean ignore,
+        final Ipv4DestinationCase ipv4Case,
+        final ByteBuf buffer) {
+        final List<Ipv4AddressNoZone> dest = ipv4Case.getDestinationIpv4Address();
+        Preconditions.checkArgument(dest != null, "DestinationIpv4Address is mandatory.");
+        final ByteBuf body = Unpooled.buffer(Ipv4Util.IP4_LENGTH * dest.size());
+        dest.forEach(ipv4 -> writeIpv4Address(ipv4, body));
+        ObjectUtil.formatSubobject(TYPE, CLASS, processing, ignore, body, buffer);
+    }
+
+    @Override
+    public UnreachDestinationObj parseObject(final ObjectHeader header, final ByteBuf bytes)
+        throws PCEPDeserializerException {
+        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
+            "Array of bytes is mandatory. Can't be null or empty.");
+        final UnreachDestinationObjBuilder builder = new UnreachDestinationObjBuilder();
+        if (bytes.readableBytes() % Ipv4Util.IP4_LENGTH != 0) {
+            throw new PCEPDeserializerException("Wrong length of array of bytes.");
+        }
+        builder.setIgnore(header.isIgnore());
+        builder.setProcessingRule(header.isProcessingRule());
+        List<Ipv4AddressNoZone> dest = new ArrayList<>();
+        while (bytes.isReadable()) {
+            dest.add(Ipv4Util.noZoneAddressForByteBuf(bytes));
+        }
+        builder.setDestination(new Ipv4DestinationCaseBuilder().setDestinationIpv4Address(dest).build());
+        return builder.build();
+    }
+}
diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv6UnreachDestinationParser.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv6UnreachDestinationParser.java
new file mode 100644 (file)
index 0000000..0c8be58
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.pcep.parser.object.unreach;
+
+import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv6Address;
+
+import com.google.common.base.Preconditions;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import java.util.ArrayList;
+import java.util.List;
+import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
+import org.opendaylight.protocol.pcep.spi.ObjectUtil;
+import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.util.Ipv6Util;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObj;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObjBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv6DestinationCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv6DestinationCaseBuilder;
+
+public final class PCEPIpv6UnreachDestinationParser extends CommonObjectParser {
+    private static final int CLASS = 28;
+    private static final int TYPE = 2;
+
+    public PCEPIpv6UnreachDestinationParser() {
+        super(CLASS, TYPE);
+    }
+
+    public static void serializeObject(
+        final Boolean processing,
+        final Boolean ignore,
+        final Ipv6DestinationCase ipv6Case,
+        final ByteBuf buffer) {
+        final List<Ipv6AddressNoZone> dest = ipv6Case.getDestinationIpv6Address();
+        Preconditions.checkArgument(dest != null, "Destinationipv6Address is mandatory.");
+        final ByteBuf body = Unpooled.buffer(Ipv6Util.IPV6_LENGTH * dest.size());
+        dest.forEach(ipv6 -> writeIpv6Address(ipv6, body));
+        ObjectUtil.formatSubobject(TYPE, CLASS, processing, ignore, body, buffer);
+    }
+
+    @Override
+    public UnreachDestinationObj parseObject(final ObjectHeader header, final ByteBuf bytes)
+        throws PCEPDeserializerException {
+        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
+            "Array of bytes is mandatory. Can't be null or empty.");
+        final UnreachDestinationObjBuilder builder = new UnreachDestinationObjBuilder();
+        if (bytes.readableBytes() % Ipv6Util.IPV6_LENGTH != 0) {
+            throw new PCEPDeserializerException("Wrong length of array of bytes.");
+        }
+        builder.setIgnore(header.isIgnore());
+        builder.setProcessingRule(header.isProcessingRule());
+        List<Ipv6AddressNoZone> dest = new ArrayList<>();
+        while (bytes.isReadable()) {
+            dest.add(Ipv6Util.noZoneAddressForByteBuf(bytes));
+        }
+        builder.setDestination(new Ipv6DestinationCaseBuilder().setDestinationIpv6Address(dest).build());
+        return builder.build();
+    }
+}
diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPUnreachDestinationSerializer.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPUnreachDestinationSerializer.java
new file mode 100644 (file)
index 0000000..ccc7155
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.pcep.parser.object.unreach;
+
+import com.google.common.base.Preconditions;
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObj;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.Destination;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv4DestinationCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv6DestinationCase;
+
+public final class PCEPUnreachDestinationSerializer implements ObjectSerializer {
+    @Override
+    public void serializeObject(final Object object, final ByteBuf buffer) {
+        Preconditions.checkArgument(object instanceof UnreachDestinationObj,
+            "Wrong instance of PCEPObject. Passed %s. Needed UnreachDestinationObj.", object.getClass());
+        final UnreachDestinationObj uPObj = (UnreachDestinationObj) object;
+        final Destination destination = uPObj.getDestination();
+        final Boolean processing = object.isProcessingRule();
+        final Boolean ignore = object.isIgnore();
+        if (destination instanceof Ipv6DestinationCase) {
+            final Ipv6DestinationCase ipv6 = ((Ipv6DestinationCase) destination);
+            PCEPIpv6UnreachDestinationParser.serializeObject(processing, ignore, ipv6, buffer);
+        } else if (destination instanceof Ipv4DestinationCase) {
+            final Ipv4DestinationCase ipv4 = ((Ipv4DestinationCase) destination);
+            PCEPIpv4UnreachDestinationParser.serializeObject(processing, ignore, ipv4, buffer);
+        }
+    }
+}
\ No newline at end of file
index 868e13340b1b368a9fc1f606810e2617f9d11db8..69295fd64270a7d9211bf6ad8ec6664d38c6e60f 100644 (file)
@@ -20,6 +20,7 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
@@ -60,6 +61,9 @@ import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPEndPointsIpv6
 import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPEndPointsObjectSerializer;
 import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPP2MPEndPointsIpv4ObjectParser;
 import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPP2MPEndPointsIpv6ObjectParser;
+import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPIpv4UnreachDestinationParser;
+import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPIpv6UnreachDestinationParser;
+import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPUnreachDestinationSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
@@ -135,6 +139,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.req.missing.tlv.ReqMissingBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.rp.object.RpBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.svec.object.SvecBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.UnreachDestinationObjBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv4DestinationCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv4DestinationCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv6DestinationCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.unreach.destination.object.unreach.destination.obj.destination.Ipv6DestinationCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.objects.VendorInformationObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.objects.VendorInformationObjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlv;
@@ -1509,4 +1518,73 @@ public class PCEPObjectParserTest {
             assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
         }
     }
+
+    @Test
+    public void testPCEPIpv4UnreachDestinationObject() throws Exception {
+        final byte[] expected = {
+            0x1c, 0x10, 0x0, 0x8,
+            (byte) 0x7F, (byte) 0x0, (byte) 0x0, (byte) 0x1
+        };
+
+        final PCEPIpv4UnreachDestinationParser parser = new PCEPIpv4UnreachDestinationParser();
+        final PCEPUnreachDestinationSerializer serializer = new PCEPUnreachDestinationSerializer();
+        final ByteBuf result = Unpooled.wrappedBuffer(expected);
+
+        final UnreachDestinationObjBuilder builder = new UnreachDestinationObjBuilder();
+        builder.setProcessingRule(false);
+        builder.setIgnore(false);
+        final Ipv4DestinationCase dest = new Ipv4DestinationCaseBuilder()
+            .setDestinationIpv4Address(Collections.singletonList(new Ipv4AddressNoZone("127.0.0.1")))
+            .build();
+        builder.setDestination(dest);
+
+        assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false),
+            result.slice(4, result.readableBytes() - 4)));
+        final ByteBuf buf = Unpooled.buffer();
+        serializer.serializeObject(builder.build(), buf);
+        assertArrayEquals(result.array(), ByteArray.getAllBytes(buf));
+
+        try {
+            parser.parseObject(new ObjectHeaderImpl(true, true), null);
+            fail();
+        } catch (final IllegalArgumentException e) {
+            assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
+        }
+    }
+
+    @Test
+    public void testPCEPIpv6UnreachDestinationObject() throws Exception {
+        final byte[] expected = {
+            0x1c, 0x20, 0x0, 0x14,
+            (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
+            (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
+            (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
+            (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1
+        };
+
+        final PCEPIpv6UnreachDestinationParser parser = new PCEPIpv6UnreachDestinationParser();
+        final PCEPUnreachDestinationSerializer serializer = new PCEPUnreachDestinationSerializer();
+        final ByteBuf result = Unpooled.wrappedBuffer(expected);
+
+        final UnreachDestinationObjBuilder builder = new UnreachDestinationObjBuilder();
+        builder.setProcessingRule(false);
+        builder.setIgnore(false);
+        final Ipv6DestinationCase dest = new Ipv6DestinationCaseBuilder()
+            .setDestinationIpv6Address(Collections.singletonList(new Ipv6AddressNoZone("::1")))
+            .build();
+        builder.setDestination(dest);
+
+        assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false),
+            result.slice(4, result.readableBytes() - 4)));
+        final ByteBuf buf = Unpooled.buffer();
+        serializer.serializeObject(builder.build(), buf);
+        assertArrayEquals(result.array(), ByteArray.getAllBytes(buf));
+
+        try {
+            parser.parseObject(new ObjectHeaderImpl(true, true), null);
+            fail();
+        } catch (final IllegalArgumentException e) {
+            assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
+        }
+    }
 }