BUG-47 : PCEP migration to generated DTOs.
[bgpcep.git] / pcep / impl / src / test / java / org / opendaylight / protocol / pcep / impl / PCEPValidatorTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.pcep.impl;
9
10
11 public class PCEPValidatorTest {
12
13         // private static final LspaObject lspa = new PCEPLspaObject(0L, 0L, 0L, (short) 0, (short) 0, false, false, false,
14         // false);
15         //
16         // private final List<ExplicitRouteSubobject> eroSubobjects = asList(
17         // new EROAsNumberSubobject(new AsNumber(0xFFFFL), false),
18         // new EROUnnumberedInterfaceSubobject(new IPv4Address(new byte[] { (byte) 0x00, (byte) 0x11, (byte) 0x22, (byte)
19         // 0x33 }), new UnnumberedInterfaceIdentifier(0x00FF00FF), false));
20         //
21         // private final List<ReportedRouteSubobject> rroSubobjects = asList((ReportedRouteSubobject) new
22         // RROUnnumberedInterfaceSubobject(new IPv4Address(new byte[] {
23         // (byte) 0x00, (byte) 0x11, (byte) 0x22, (byte) 0x33 }), new UnnumberedInterfaceIdentifier(0x00FF00FF)));
24         //
25         // private final List<Long> requestIds = asList(0x000001L);
26         //
27         // private final IPv4Address ip4addr = new IPv4Address(new byte[] { (byte) 0xFF, 0x00, 0x00, 0x01 });
28         //
29         // private final PCEPSvecObject svecObj = new PCEPSvecObject(true, true, true, false, false,
30         // PCEPValidatorTest.this.requestIds, true);
31         //
32         // private final PCEPRequestParameterObject requestParameter = new PCEPRequestParameterObject(true, false, false,
33         // false, false, false, false, false, (short) 3, 1, true, false);
34         //
35         // // private final PCEPEndPointsObject<IPv4Address> endPoints = new
36         // // PCEPEndPointsObject<IPv4Address>(this.ip4addr, this.ip4addr);
37         //
38         // private final PCEPEndPointsObject<IPv4Address> endPoints = new PCEPEndPointsObject<IPv4Address>(this.ip4addr,
39         // this.ip4addr);
40         //
41         // private static final RawPCEPMessageFactory msgFactory = new RawPCEPMessageFactory();
42         //
43         // // private final PCEPClassTypeObject classType = new
44         // // PCEPClassTypeObject((short) 7);
45         // // private final PCEPClassTypeObjectProvider classTypeProvider = new
46         // // PCEPClassTypeObjectProvider((short) 7, true);
47         //
48         // private static List<Message> deserMsg(final String srcFile) throws IOException, DeserializerException,
49         // DocumentedException,
50         // PCEPDeserializerException {
51         // final byte[] bytesFromFile = ByteArray.fileToBytes(srcFile);
52         // final RawMessage rawMessage = (RawMessage) msgFactory.parse(bytesFromFile).get(0);
53         //
54         // return PCEPMessageValidator.getValidator(rawMessage.getMsgType()).validate(rawMessage.getAllObjects());
55         // }
56         //
57         // @Test
58         // public void testOpenMessageValidationFromBin() throws IOException, DeserializerException, DocumentedException,
59         // PCEPDeserializerException {
60         // assertEquals(
61         // deserMsg("src/test/resources/PCEPOpenMessage1.bin").toString(),
62         // asList(
63         // new PCEPOpenMessage(new PCEPOpenObject(30, 120, 1, asList(new PCEStatefulCapabilityTlv(false, true, true),
64         // new LSPStateDBVersionTlv(0x80))))).toString());
65         //
66         // assertEquals(deserMsg("src/test/resources/Open.1.bin").toString(),
67         // asList(new PCEPOpenMessage(new PCEPOpenObject(1, 4, 1))).toString());
68         //
69         // assertEquals(
70         // deserMsg("src/test/resources/Open.3.bin").toString(),
71         // asList(
72         // new PCEPOpenMessage(new PCEPOpenObject(1, 4, 1, asList(new PCEStatefulCapabilityTlv(false, true, true),
73         // new LSPStateDBVersionTlv(53))))).toString());
74         // }
75         //
76         // @Test
77         // public void testKeepAliveMessageValidationFromBin() throws IOException, PCEPDeserializerException,
78         // PCEPDocumentedException,
79         // DeserializerException, DocumentedException {
80         // assertEquals(deserMsg("src/test/resources/PCEPKeepAliveMessage1.bin").toString(),
81         // asList(new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build()).toString());
82         // assertEquals(deserMsg("src/test/resources/Keepalive.1.bin").toString(),
83         // asList(new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build()).toString());
84         // }
85         //
86         // @Test
87         // @Ignore
88         // // FIXME: should be fixed when we remove PCEPObject
89         // public void testCloseMsg() throws PCEPDeserializerException, IOException, PCEPDocumentedException,
90         // DeserializerException,
91         // DocumentedException {
92         // assertEquals(
93         // deserMsg("src/test/resources/PCEPCloseMessage1.bin"),
94         // asList(new CloseBuilder().setCCloseMessage(
95         // new CCloseMessageBuilder().setCClose(
96         // new CCloseBuilder().setReason(TerminationReason.TooManyUnknownMsg.getShortValue()).build()).build()).build()));
97         // assertEquals(
98         // deserMsg("src/test/resources/Close.1.bin").toString(),
99         // asList(new CloseBuilder().setCCloseMessage(
100         // new CCloseMessageBuilder().setCClose(
101         // new CCloseBuilder().setReason(TerminationReason.Unknown.getShortValue()).build()).build()).build()));
102         // }
103         //
104         // @Test
105         // public void testRequestMessageValidationFromBin() throws IOException, PCEPDeserializerException,
106         // PCEPDocumentedException,
107         // DeserializerException, DocumentedException {
108         // List<CompositeRequestObject> requests = new ArrayList<CompositeRequestObject>();
109         // final byte[] ipAdress = { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF };
110         // requests.add(new CompositeRequestObject(new PCEPRequestParameterObject(true, false, false, false, false, false,
111         // false, false, (short) 5, 0xDEADBEEFL, true, false), new PCEPEndPointsObject<IPv4Address>(new
112         // IPv4Address(ipAdress), new IPv4Address(ipAdress))));
113         // PCEPRequestMessage specMessage = new PCEPRequestMessage(requests);
114         // List<Message> deserMsgs = deserMsg("src/test/resources/PCEPRequestMessage1.bin");
115         // final List<Message> specMessages = Lists.newArrayList();
116         // specMessages.add(specMessage);
117         //
118         // assertEquals(deserMsgs.toString(), specMessages.toString());
119         //
120         // requests = new ArrayList<CompositeRequestObject>();
121         // final byte[] ipAdress2 = { (byte) 0x7F, (byte) 0x00, (byte) 0x00, (byte) 0x01 };
122         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
123         // IPv4Address(ipAdress2), new IPv4Address(ipAdress2))));
124         // specMessage = new PCEPRequestMessage(requests);
125         // deserMsgs = deserMsg("src/test/resources/PCReq.1.bin");
126         // specMessages.clear();
127         // specMessages.add(specMessage);
128         // assertEquals(deserMsgs.toString(), specMessages.toString());
129         //
130         // requests = new ArrayList<CompositeRequestObject>();
131         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
132         // IPv4Address(ipAdress2), new IPv4Address(ipAdress2)), null, null, null, null, null, null, null, null, new
133         // PCEPLoadBalancingObject(3, new Bandwidth(ByteArray.floatToBytes((float) 1024.75)), false)));
134         // specMessage = new PCEPRequestMessage(requests);
135         // deserMsgs = deserMsg("src/test/resources/PCReq.2.bin");
136         // specMessages.clear();
137         // specMessages.add(specMessage);
138         // assertEquals(deserMsgs.toString(), specMessages.toString());
139         //
140         // requests = new ArrayList<CompositeRequestObject>();
141         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
142         // IPv4Address(ipAdress2), new IPv4Address(ipAdress2)), null, new PCEPLspObject(1, false, false, true, false),
143         // PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(1000)), false,
144         // false), new ArrayList<PCEPMetricObject>() {
145         // private static final long serialVersionUID = 1L;
146         //
147         // {
148         // this.add(new PCEPMetricObject(true, true, new IGPMetric(53L), false, false));
149         // }
150         // }, new PCEPReportedRouteObject(this.rroSubobjects, false), new PCEPExistingPathBandwidthObject(new
151         // Bandwidth(ByteArray.floatToBytes(5353)), false, false), new PCEPIncludeRouteObject(this.eroSubobjects, false,
152         // false), new PCEPLoadBalancingObject(5, new Bandwidth(ByteArray.floatToBytes(3)), false)));
153         //
154         // List<CompositeRequestSvecObject> svecList = new ArrayList<CompositeRequestSvecObject>();
155         // svecList.add(new CompositeRequestSvecObject(new PCEPSvecObject(true, false, false, false, false, this.requestIds,
156         // false)));
157         //
158         // specMessage = new PCEPRequestMessage(svecList, requests);
159         // deserMsgs = deserMsg("src/test/resources/PCReq.3.bin");
160         // specMessages.clear();
161         // specMessages.add(specMessage);
162         // // FIXME BUG-89
163         // // assertEquals(deserMsgs, specMessages);
164         //
165         // specMessages.clear();
166         // requests = new ArrayList<CompositeRequestObject>();
167         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
168         // IPv4Address(ipAdress2), new IPv4Address(ipAdress2)), null, null, null, null, null, null, null, null, null));
169         // specMessages.add(new PCEPRequestMessage(requests));
170         //
171         // final byte[] ipAdress3 = { (byte) 0x7F, (byte) 0x00, (byte) 0x30, (byte) 0x01 };
172         // requests = new ArrayList<CompositeRequestObject>();
173         // requests.add(new CompositeRequestObject(new PCEPRequestParameterObject(false, false, false, false, false, false,
174         // false, false, (short) 4, 1, true, false), new PCEPEndPointsObject<IPv4Address>(new IPv4Address(ipAdress3), new
175         // IPv4Address(ipAdress2)), null, null, null, null, null, null, null, null, null));
176         // specMessages.add(new PCEPRequestMessage(requests));
177         //
178         // final byte[] ipAdress4 = { (byte) 0x7F, (byte) 0x30, (byte) 0x00, (byte) 0x01 };
179         // requests = new ArrayList<CompositeRequestObject>();
180         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
181         // IPv4Address(ipAdress2), new IPv4Address(ipAdress4)), null, null, null, null, null, null, null, null, null));
182         // specMessages.add(new PCEPRequestMessage(requests));
183         //
184         // final byte[] ipAdress5 = { (byte) 0x7F, (byte) 0xd0, (byte) 0x00, (byte) 0x01 };
185         // requests = new ArrayList<CompositeRequestObject>();
186         // requests.add(new CompositeRequestObject(new PCEPRequestParameterObject(true, false, false, false, false, false,
187         // false, false, (short) 1, 1, true, false), new PCEPEndPointsObject<IPv4Address>(new IPv4Address(ipAdress5), new
188         // IPv4Address(ipAdress5)), null, null, null, null, null, null, null, null, null));
189         //
190         // specMessages.add(new PCEPRequestMessage(requests));
191         // deserMsgs = deserMsg("src/test/resources/PCReq.4.bin");
192         // assertEquals(deserMsgs.toString(), specMessages.toString());
193         //
194         // specMessages.clear();
195         // svecList = new ArrayList<CompositeRequestSvecObject>();
196         // svecList.add(new CompositeRequestSvecObject(new PCEPSvecObject(true, false, false, false, false, this.requestIds,
197         // false)));
198         // svecList.add(new CompositeRequestSvecObject(new PCEPSvecObject(false, true, true, false, false, this.requestIds,
199         // false), new PCEPObjectiveFunctionObject(PCEPOFCodes.MCC, true, false), new PCEPGlobalConstraintsObject((short)
200         // 0x55, (short) 1, (short) 100, (short) 0x26, true, false), new PCEPExcludeRouteObject(new
201         // ArrayList<ExcludeRouteSubobject>() {
202         // private static final long serialVersionUID = 1L;
203         //
204         // {
205         // this.add(new XROAsNumberSubobject(new AsNumber((long) 0x12), true));
206         // }
207         // }, true, true, false), new ArrayList<PCEPMetricObject>() {
208         // private static final long serialVersionUID = 1L;
209         //
210         // {
211         // this.add(new PCEPMetricObject(true, true, new TEMetric(123456L), true, false));
212         // }
213         // }));
214         //
215         // requests = new ArrayList<CompositeRequestObject>();
216         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
217         // IPv4Address(ipAdress2), new IPv4Address(ipAdress2)), null, null, PCEPValidatorTest.lspa, new
218         // PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(1000)), false, false), new
219         // ArrayList<PCEPMetricObject>() {
220         // private static final long serialVersionUID = 1L;
221         //
222         // {
223         // this.add(new PCEPMetricObject(true, true, new IGPMetric(53L), false, false));
224         // this.add(new PCEPMetricObject(true, true, new IGPMetric(5335L), false, false));
225         // this.add(new PCEPMetricObject(true, true, new IGPMetric(128256), false, false));
226         // }
227         // }, new PCEPReportedRouteObject(this.rroSubobjects, false), new PCEPExistingPathBandwidthObject(new
228         // Bandwidth(ByteArray.floatToBytes(5353)), false, false), new PCEPIncludeRouteObject(this.eroSubobjects, false,
229         // false), new PCEPLoadBalancingObject(5, new Bandwidth(ByteArray.floatToBytes(3)), false)));
230         //
231         // final byte[] ipAdress6 = { (byte) 0x7F, (byte) 0xF0, (byte) 0x00, (byte) 0x01 };
232         // specMessages.add(new PCEPRequestMessage(svecList, requests));
233         //
234         // requests = new ArrayList<CompositeRequestObject>();
235         // requests.add(new CompositeRequestObject(this.requestParameter, new PCEPEndPointsObject<IPv4Address>(new
236         // IPv4Address(ipAdress6), new IPv4Address(ipAdress6)), null, null, PCEPValidatorTest.lspa, new
237         // PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(1000)), false, false), new
238         // ArrayList<PCEPMetricObject>() {
239         // private static final long serialVersionUID = 1L;
240         //
241         // {
242         // this.add(new PCEPMetricObject(true, true, new IGPMetric(53L), false, false));
243         // }
244         // }, new PCEPReportedRouteObject(this.rroSubobjects, false), new PCEPExistingPathBandwidthObject(new
245         // Bandwidth(ByteArray.floatToBytes(5353)), false, false), new PCEPIncludeRouteObject(this.eroSubobjects, false,
246         // false), new PCEPLoadBalancingObject(5, new Bandwidth(ByteArray.floatToBytes(3f)), false)));
247         // deserMsgs = deserMsg("src/test/resources/PCReq.5.bin");
248         // specMessages.add(new PCEPRequestMessage(svecList, requests));
249         // // FIXME
250         // // assertEquals(deserMsgs, specMessages);
251         //
252         // // FIXME: need construct with invalid processed parameter
253         // // assertEquals(deserMsg("src/test/resources/PCReq.6.invalid.bin"),
254         // // asList(
255         // // new PCEPErrorMessage(new CompositeErrorObject(new
256         // // PCEPRequestParameterObject(true, false, false, false, false, false,
257         // // false, false, (short) 3,
258         // // 1L, false, false), new PCEPErrorObject(PCEPErrors.P_FLAG_NOT_SET))),
259         // // new PCEPRequestMessage(asList(new
260         // // CompositeRequestObject(this.requestParameter, new
261         // // PCEPEndPointsObject<IPv4Address>(IPv4Address
262         // // .getNetworkAddressFactory().getNetworkAddressForBytes(new byte[] {
263         // // 127, 0, 0, 1 }), IPv4Address.getNetworkAddressFactory()
264         // // .getNetworkAddressForBytes(new byte[] { 127, 0, 0, 1 })), null, null,
265         // // null, null, null, null, null, null, new PCEPLoadBalancingObject(
266         // // 3, new Bandwidth(1024.75), false))))));
267         //
268         // }
269         //
270         // @Test
271         // public void testRequestMessageValidationFromRawMsg() throws PCEPDeserializerException {
272         // List<PCEPObject> objs = new ArrayList<PCEPObject>();
273         // List<Message> msgs;
274         // PCEPRequestParameterObject tmpRP;
275         //
276         // // test unrecognized object in svec list
277         // objs.add(this.svecObj);
278         // objs.add(new UnknownObject(true, false, PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
279         // objs.add(new PCEPSvecObject(true, true, true, false, false, PCEPValidatorTest.this.requestIds, true));
280         //
281         // msgs = PCEPMessageValidator.getValidator(PCEPMessageType.REQUEST).validate(objs);
282         //
283         // assertEquals(msgs.get(0).toString(), new PCEPErrorMessage(new ArrayList<PCEPErrorObject>() {
284         // private static final long serialVersionUID = 1L;
285         //
286         // {
287         // this.add(new PCEPErrorObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
288         // }
289         // }).toString());
290         //
291         // // test with request p flag not set and ignoracion of more than one
292         // // end-points objects
293         // objs = new ArrayList<PCEPObject>();
294         // objs.add(this.svecObj);
295         // objs.add(this.svecObj);
296         // tmpRP = new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 3, 1,
297         // false, false);
298         // objs.add(tmpRP);
299         // objs.add(this.endPoints);
300         //
301         // objs.add(this.requestParameter);
302         // objs.add(this.endPoints);
303         // objs.add(this.endPoints);
304         // // FIXME:mv use object constructor with set processed flag
305         // // objs.add(this.classTypeProvider);
306         // // objs.add(this.requestParameter);
307         // // objs.add(this.endPointsProvider);
308         // // objs.add(new PCEPClassTypeObjectProvider((short) 7, false));
309         //
310         // msgs = PCEPMessageValidator.getValidator(PCEPMessageType.REQUEST).validate(objs);
311         // // FIXME:mv use object constructor with set processed flag
312         // // assertEquals(msgs.get(0), new PCEPErrorMessage(new
313         // // CompositeErrorObject(tmpRP, new
314         // // PCEPErrorObject(PCEPErrors.P_FLAG_NOT_SET))));
315         // // assertEquals(
316         // // msgs.get(1),
317         // // new PCEPRequestMessage(asList(new
318         // // CompositeRequestSvecObject(this.svecObj), new
319         // // CompositeRequestSvecObject(this.svecObj)), Util
320         // // .asList(new CompositeRequestObject(this.requestParameter,
321         // // this.endPoints, this.classType, null, null, null, null, null, null,
322         // // null,
323         // // null))));
324         // // assertEquals(msgs.get(2), new PCEPErrorMessage(new
325         // // CompositeErrorObject(tmpRP, new
326         // // PCEPErrorObject(PCEPErrors.P_FLAG_NOT_SET))));
327         // }
328         //
329         // @Test
330         // public void testReplyMessageValidatorFromBin() throws IOException, PCEPDeserializerException,
331         // PCEPDocumentedException,
332         // DeserializerException, DocumentedException {
333         //
334         // List<PCEPReplyMessage> specMessages = new ArrayList<PCEPReplyMessage>();
335         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
336         // false, false, false, false, false, false, false, (short) 5, 0xDEADBEEFL, true, true)))));
337         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
338         // true, true, false, false, false, false, false, (short) 7, 0x12345678L, false, false)))));
339         // assertEquals(deserMsg("src/test/resources/PCEPReplyMessage1.bin").toString(), specMessages.toString());
340         //
341         // specMessages = new ArrayList<PCEPReplyMessage>();
342         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
343         // false, false, false, false, false, false, false, (short) 3, 1, false, false)))));
344         // assertEquals(deserMsg("src/test/resources/PCRep.1.bin").toString(), specMessages.toString());
345         //
346         // specMessages = new ArrayList<PCEPReplyMessage>();
347         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
348         // false, false, false, false, false, false, false, (short) 3, 1, false, false)))));
349         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(false,
350         // false, false, false, false, false, false, false, (short) 5, 2, false, false), new PCEPNoPathObject((short) 0,
351         // false, false), null, null, null, null, null, null))));
352         // assertEquals(deserMsg("src/test/resources/PCRep.2.bin").toString(), specMessages.toString());
353         //
354         // specMessages = new ArrayList<PCEPReplyMessage>();
355         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
356         // false, false, false, false, false, false, false, (short) 3, 1, false, false), new PCEPNoPathObject((short) 1,
357         // true, false), new PCEPLspObject(1, true, true, false, true), PCEPValidatorTest.lspa, new
358         // PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(500)), false, false), new
359         // ArrayList<PCEPMetricObject>() {
360         // private static final long serialVersionUID = 1L;
361         //
362         // {
363         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234), false, false));
364         // }
365         // }, new PCEPIncludeRouteObject(this.eroSubobjects, false, false), new ArrayList<CompositePathObject>() {
366         // private static final long serialVersionUID = 1L;
367         //
368         // {
369         // this.add(new CompositePathObject(new PCEPExplicitRouteObject(PCEPValidatorTest.this.eroSubobjects, false), lspa,
370         // new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(500)), false, false), new
371         // ArrayList<PCEPMetricObject>() {
372         // private static final long serialVersionUID = 1L;
373         //
374         // {
375         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234L), false, false));
376         // }
377         // }, new PCEPIncludeRouteObject(PCEPValidatorTest.this.eroSubobjects, false, false)));
378         // }
379         // }))));
380         // // FIXME BUG-89
381         // // assertEquals(deserMsg("src/test/resources/PCRep.3.bin"), specMessages);
382         //
383         // specMessages = new ArrayList<PCEPReplyMessage>();
384         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
385         // false, false, false, false, false, false, false, (short) 7, 1, false, false)))));
386         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
387         // false, false, false, false, false, false, false, (short) 1, 2, false, false)))));
388         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
389         // false, false, false, false, false, false, false, (short) 2, 4, false, false)))));
390         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(false,
391         // false, false, false, false, false, false, false, (short) 3, 4, false, false)))));
392         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(false,
393         // false, false, false, false, false, false, false, (short) 6, 5, false, false)))));
394         // assertEquals(deserMsg("src/test/resources/PCRep.4.bin").toString(), specMessages.toString());
395         //
396         // specMessages = new ArrayList<PCEPReplyMessage>();
397         // final List<Long> requestIDs = new ArrayList<Long>();
398         // requestIDs.add(0x25069045L);
399         //
400         // final List<PCEPMetricObject> metrics = new ArrayList<PCEPMetricObject>();
401         // metrics.add(new PCEPMetricObject(true, true, new IGPMetric(234L), true, false));
402         //
403         // final List<CompositeReplySvecObject> svecList = new ArrayList<CompositeReplySvecObject>();
404         // svecList.add(new CompositeReplySvecObject(new PCEPSvecObject(true, true, true, false, false, requestIDs, true),
405         // new PCEPObjectiveFunctionObject(PCEPOFCodes.MCC, true, false), metrics));
406         //
407         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
408         // false, false, false, false, false, false, false, (short) 3, 1, false, false), new PCEPNoPathObject((short) 1,
409         // true, false), null, PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new
410         // Bandwidth(ByteArray.floatToBytes(500)), false, false), new ArrayList<PCEPMetricObject>() {
411         // private static final long serialVersionUID = 1L;
412         //
413         // {
414         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234), false, false));
415         // }
416         // }, new PCEPIncludeRouteObject(this.eroSubobjects, false, false), new ArrayList<CompositePathObject>() {
417         // private static final long serialVersionUID = 1L;
418         //
419         // {
420         // this.add(new CompositePathObject(new PCEPExplicitRouteObject(PCEPValidatorTest.this.eroSubobjects, false), lspa,
421         // new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(500)), false, false), new
422         // ArrayList<PCEPMetricObject>() {
423         // private static final long serialVersionUID = 1L;
424         //
425         // {
426         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234L), false, false));
427         // this.add(new PCEPMetricObject(true, true, new IGPMetric(5355L), false, false));
428         // this.add(new PCEPMetricObject(true, true, new IGPMetric(5353L), false, false));
429         // }
430         // }, new PCEPIncludeRouteObject(PCEPValidatorTest.this.eroSubobjects, false, false)));
431         // }
432         // })), svecList));
433         // specMessages.add(new PCEPReplyMessage(asList(new CompositeResponseObject(new PCEPRequestParameterObject(true,
434         // false, false, false, false, false, false, false, (short) 3, 1, false, false), new PCEPNoPathObject((short) 1,
435         // true, false), null, PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new
436         // Bandwidth(ByteArray.floatToBytes(500)), false, false), new ArrayList<PCEPMetricObject>() {
437         // private static final long serialVersionUID = 1L;
438         //
439         // {
440         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234), false, false));
441         // }
442         // }, new PCEPIncludeRouteObject(this.eroSubobjects, false, false), new ArrayList<CompositePathObject>() {
443         // private static final long serialVersionUID = 1L;
444         //
445         // {
446         // this.add(new CompositePathObject(new PCEPExplicitRouteObject(PCEPValidatorTest.this.eroSubobjects, false), lspa,
447         // new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(500)), false, false), new
448         // ArrayList<PCEPMetricObject>() {
449         // private static final long serialVersionUID = 1L;
450         //
451         // {
452         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234L), false, false));
453         // }
454         // }, new PCEPIncludeRouteObject(PCEPValidatorTest.this.eroSubobjects, false, false)));
455         // this.add(new CompositePathObject(new PCEPExplicitRouteObject(PCEPValidatorTest.this.eroSubobjects, false), lspa,
456         // new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(500)), false, false), new
457         // ArrayList<PCEPMetricObject>() {
458         // private static final long serialVersionUID = 1L;
459         //
460         // {
461         // this.add(new PCEPMetricObject(true, true, new IGPMetric(234L), false, false));
462         // }
463         // }, new PCEPIncludeRouteObject(PCEPValidatorTest.this.eroSubobjects, false, false)));
464         // }
465         // })), svecList));
466         // assertEquals(deserMsg("src/test/resources/PCRep.5.bin").toString(), specMessages.toString());
467         // }
468         //
469         // @Test
470         // public void testUpdMessageValidatorFromBin() throws IOException, PCEPDeserializerException,
471         // PCEPDocumentedException,
472         // DeserializerException, DocumentedException {
473         // List<Message> specMessages = Lists.newArrayList();
474         //
475         // List<CompositeUpdateRequestObject> requests = new ArrayList<CompositeUpdateRequestObject>();
476         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true)));
477         //
478         // specMessages.add(new PCEPUpdateRequestMessage(requests));
479         // assertEquals(deserMsg("src/test/resources/PCUpd.1.bin").toString(), specMessages.toString());
480         //
481         // specMessages = Lists.newArrayList();
482         // List<CompositeUpdPathObject> paths = new ArrayList<CompositeUpdPathObject>();
483         // paths.add(new CompositeUpdPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
484         // PCEPValidatorTest.lspa, null, null));
485         // requests = new ArrayList<CompositeUpdateRequestObject>();
486         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true), paths));
487         // specMessages.add(new PCEPUpdateRequestMessage(requests));
488         // assertEquals(deserMsg("src/test/resources/PCUpd.2.bin").toString(), specMessages.toString());
489         //
490         // specMessages = Lists.newArrayList();
491         // paths = new ArrayList<CompositeUpdPathObject>();
492         // paths.add(new CompositeUpdPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
493         // PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
494         // false), new ArrayList<PCEPMetricObject>() {
495         // private static final long serialVersionUID = 1L;
496         //
497         // {
498         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
499         // }
500         // }));
501         // requests = new ArrayList<CompositeUpdateRequestObject>();
502         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true), paths));
503         // specMessages.add(new PCEPUpdateRequestMessage(requests));
504         // assertEquals(deserMsg("src/test/resources/PCUpd.3.bin").toString(), specMessages.toString());
505         //
506         // specMessages = Lists.newArrayList();
507         // requests = new ArrayList<CompositeUpdateRequestObject>();
508         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true)));
509         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true)));
510         // specMessages.add(new PCEPUpdateRequestMessage(requests));
511         // assertEquals(deserMsg("src/test/resources/PCUpd.4.bin").toString(), specMessages.toString());
512         //
513         // specMessages = Lists.newArrayList();
514         // requests = new ArrayList<CompositeUpdateRequestObject>();
515         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true)));
516         // paths = new ArrayList<CompositeUpdPathObject>();
517         // paths.add(new CompositeUpdPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
518         // PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
519         // false), new ArrayList<PCEPMetricObject>() {
520         // private static final long serialVersionUID = 1L;
521         //
522         // {
523         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
524         // }
525         // }));
526         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true), paths));
527         // paths = new ArrayList<CompositeUpdPathObject>();
528         // paths.add(new CompositeUpdPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
529         // PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
530         // false), new ArrayList<PCEPMetricObject>() {
531         // private static final long serialVersionUID = 1L;
532         //
533         // {
534         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
535         // }
536         // }));
537         // paths.add(new CompositeUpdPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
538         // PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
539         // false), new ArrayList<PCEPMetricObject>() {
540         // private static final long serialVersionUID = 1L;
541         //
542         // {
543         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
544         // }
545         // }));
546         // paths.add(new CompositeUpdPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
547         // PCEPValidatorTest.lspa, new PCEPRequestedPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
548         // false), new ArrayList<PCEPMetricObject>() {
549         // private static final long serialVersionUID = 1L;
550         //
551         // {
552         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
553         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
554         // }
555         // }));
556         // requests.add(new CompositeUpdateRequestObject(new PCEPLspObject(1, true, false, true, true), paths));
557         // specMessages.add(new PCEPUpdateRequestMessage(requests));
558         // assertEquals(deserMsg("src/test/resources/PCUpd.5.bin").toString(), specMessages.toString());
559         // }
560         //
561         // @Test
562         // public void testRptMessageValidatorFromBin() throws IOException, PCEPDeserializerException,
563         // PCEPDocumentedException,
564         // DeserializerException, DocumentedException {
565         // List<Message> specMessages = Lists.newArrayList();
566         // List<CompositeStateReportObject> reports = new ArrayList<CompositeStateReportObject>();
567         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true)));
568         // specMessages.add(new PCEPReportMessage(reports));
569         // assertEquals(deserMsg("src/test/resources/PCRpt.1.bin").toString(), specMessages.toString());
570         //
571         // specMessages = Lists.newArrayList();
572         // List<CompositeRptPathObject> paths = new ArrayList<CompositeRptPathObject>();
573         // paths.add(new CompositeRptPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
574         // PCEPValidatorTest.lspa, null, null, null));
575         // reports = new ArrayList<CompositeStateReportObject>();
576         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true), paths));
577         // specMessages.add(new PCEPReportMessage(reports));
578         // assertEquals(deserMsg("src/test/resources/PCRpt.2.bin").toString(), specMessages.toString());
579         //
580         // specMessages = Lists.newArrayList();
581         // paths = new ArrayList<CompositeRptPathObject>();
582         // paths.add(new CompositeRptPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
583         // PCEPValidatorTest.lspa, new PCEPExistingPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
584         // false), new PCEPReportedRouteObject(this.rroSubobjects, false), new ArrayList<PCEPMetricObject>() {
585         // private static final long serialVersionUID = 1L;
586         //
587         // {
588         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
589         // }
590         // }));
591         //
592         // reports = new ArrayList<CompositeStateReportObject>();
593         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true), paths));
594         // specMessages.add(new PCEPReportMessage(reports));
595         //
596         // // FIXME
597         // // assertEquals(deserMsg("src/test/resources/PCRpt.3.bin"), specMessages);
598         //
599         // specMessages = Lists.newArrayList();
600         // reports = new ArrayList<CompositeStateReportObject>();
601         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true)));
602         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true)));
603         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true)));
604         // specMessages.add(new PCEPReportMessage(reports));
605         // assertEquals(deserMsg("src/test/resources/PCRpt.4.bin").toString(), specMessages.toString());
606         //
607         // specMessages = Lists.newArrayList();
608         // reports = new ArrayList<CompositeStateReportObject>();
609         // paths = new ArrayList<CompositeRptPathObject>();
610         // paths.add(new CompositeRptPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
611         // PCEPValidatorTest.lspa, new PCEPExistingPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
612         // false), new PCEPReportedRouteObject(this.rroSubobjects, false), new ArrayList<PCEPMetricObject>() {
613         // private static final long serialVersionUID = 1L;
614         //
615         // {
616         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
617         // }
618         // }));
619         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true), paths));
620         // paths = new ArrayList<CompositeRptPathObject>();
621         // paths.add(new CompositeRptPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
622         // PCEPValidatorTest.lspa, new PCEPExistingPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
623         // false), new PCEPReportedRouteObject(this.rroSubobjects, false), new ArrayList<PCEPMetricObject>() {
624         // private static final long serialVersionUID = 1L;
625         //
626         // {
627         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
628         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
629         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
630         // }
631         // }));
632         // paths.add(new CompositeRptPathObject(new PCEPExplicitRouteObject(this.eroSubobjects, false),
633         // PCEPValidatorTest.lspa, new PCEPExistingPathBandwidthObject(new Bandwidth(ByteArray.floatToBytes(5353)), false,
634         // false), new PCEPReportedRouteObject(this.rroSubobjects, false), new ArrayList<PCEPMetricObject>() {
635         // private static final long serialVersionUID = 1L;
636         //
637         // {
638         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
639         // }
640         // }));
641         // reports.add(new CompositeStateReportObject(new PCEPLspObject(1, true, false, true, true), paths));
642         // specMessages.add(new PCEPReportMessage(reports));
643         // // FIXME
644         // // assertEquals(deserMsg("src/test/resources/PCRpt.5.bin").toString(), specMessages.toString());
645         // }
646         //
647         // @Test
648         // public void testPCCreateMessage() throws DeserializerException, DocumentedException, PCEPDeserializerException {
649         // final List<CompositeInstantiationObject> insts = new ArrayList<CompositeInstantiationObject>();
650         // final List<ExplicitRouteSubobject> subs = new ArrayList<ExplicitRouteSubobject>();
651         // subs.add(new EROAsNumberSubobject(new AsNumber((long) 10), false));
652         // final List<PCEPTlv> tlvs = new ArrayList<PCEPTlv>();
653         // final LSPSymbolicNameTlv tlv = new LSPSymbolicNameTlv(new LSPSymbolicName(new byte[] { 5, 4 }));
654         // tlvs.add(tlv);
655         // insts.add(new CompositeInstantiationObject(new
656         // PCEPEndPointsObject<IPv4Address>(IPv4.FAMILY.addressForString("127.0.0.2"),
657         // IPv4.FAMILY.addressForString("127.0.0.1")), PCEPValidatorTest.lspa, new PCEPExplicitRouteObject(subs, true),
658         // null, new ArrayList<PCEPMetricObject>() {
659         // private static final long serialVersionUID = 1L;
660         //
661         // {
662         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
663         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
664         // this.add(new PCEPMetricObject(true, false, new IGPMetric(4L), false, false));
665         // }
666         // }));
667         // final PCCreateMessage msg = new PCCreateMessage(insts);
668         //
669         // final byte[] bytes = msgFactory.put(msg);
670         //
671         // // FIXME: need construct with invalid processed parameter
672         // final RawMessage rawMessage = (RawMessage) msgFactory.parse(bytes).get(0);
673         //
674         // assertEquals(PCEPMessageValidator.getValidator(rawMessage.getMsgType()).validate(rawMessage.getAllObjects()).toString(),
675         // asList((Message) msg).toString());
676         // }
677         //
678         // @Test
679         // public void testNotificationValidatorFromBin() throws IOException, PCEPDeserializerException,
680         // PCEPDocumentedException,
681         // DeserializerException, DocumentedException {
682         // List<CompositeNotifyObject> notifications = new ArrayList<CompositeNotifyObject>();
683         // List<PCEPNotificationObject> notificationsList = new ArrayList<PCEPNotificationObject>();
684         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
685         // notifications.add(new CompositeNotifyObject(notificationsList));
686         // PCEPNotificationMessage specMessage = new PCEPNotificationMessage(notifications);
687         // assertEquals(deserMsg("src/test/resources/PCNtf.1.bin").toString(), asList((Message) specMessage).toString());
688         //
689         // notifications = new ArrayList<CompositeNotifyObject>();
690         // notificationsList = new ArrayList<PCEPNotificationObject>();
691         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
692         // List<PCEPRequestParameterObject> requestsList = new ArrayList<PCEPRequestParameterObject>();
693         // requestsList.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 3,
694         // 1, false, false));
695         // notifications.add(new CompositeNotifyObject(requestsList, notificationsList));
696         // specMessage = new PCEPNotificationMessage(notifications);
697         // assertEquals(deserMsg("src/test/resources/PCNtf.2.bin").toString(), asList((Message) specMessage).toString());
698         //
699         // notifications = new ArrayList<CompositeNotifyObject>();
700         // notificationsList = new ArrayList<PCEPNotificationObject>();
701         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
702         // requestsList = new ArrayList<PCEPRequestParameterObject>();
703         // requestsList.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 1,
704         // 10, false, false));
705         // notifications.add(new CompositeNotifyObject(requestsList, notificationsList));
706         // specMessage = new PCEPNotificationMessage(notifications);
707         // assertEquals(deserMsg("src/test/resources/PCNtf.3.bin").toString(), asList((Message) specMessage).toString());
708         //
709         // notifications = new ArrayList<CompositeNotifyObject>();
710         // notificationsList = new ArrayList<PCEPNotificationObject>();
711         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
712         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 2));
713         // notificationsList.add(new PCEPNotificationObject((short) 2, (short) 1));
714         // notificationsList.add(new PCEPNotificationObject((short) 2, (short) 2));
715         // notifications.add(new CompositeNotifyObject(notificationsList));
716         // specMessage = new PCEPNotificationMessage(notifications);
717         // assertEquals(deserMsg("src/test/resources/PCNtf.4.bin").toString(), asList((Message) specMessage).toString());
718         //
719         // notifications = new ArrayList<CompositeNotifyObject>();
720         // notificationsList = new ArrayList<PCEPNotificationObject>();
721         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
722         // requestsList = new ArrayList<PCEPRequestParameterObject>();
723         // requestsList.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 1,
724         // 10, false, false));
725         // notifications.add(new CompositeNotifyObject(requestsList, notificationsList));
726         // notificationsList = new ArrayList<PCEPNotificationObject>();
727         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
728         // notificationsList.add(new PCEPNotificationObject((short) 1, (short) 1));
729         // requestsList = new ArrayList<PCEPRequestParameterObject>();
730         // requestsList.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 1,
731         // 10, false, false));
732         // requestsList.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 1,
733         // 10, false, false));
734         // notifications.add(new CompositeNotifyObject(requestsList, notificationsList));
735         // specMessage = new PCEPNotificationMessage(notifications);
736         // assertEquals(deserMsg("src/test/resources/PCNtf.5.bin").toString(), asList((Message) specMessage).toString());
737         // }
738         //
739         // @Test
740         // public void testErrorMessageValidatoinFromBin() throws IOException, PCEPDeserializerException,
741         // PCEPDocumentedException,
742         // DeserializerException, DocumentedException {
743         // List<PCEPErrorObject> errorsList = new ArrayList<PCEPErrorObject>();
744         // errorsList.add(new PCEPErrorObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
745         //
746         // PCEPErrorMessage specMessage = new PCEPErrorMessage(errorsList);
747         // assertEquals(deserMsg("src/test/resources/PCErr.1.bin").toString(), asList((Message) specMessage).toString());
748         //
749         // List<PCEPRequestParameterObject> requests = new ArrayList<PCEPRequestParameterObject>();
750         // requests.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 3, 1,
751         // false, false));
752         //
753         // List<CompositeErrorObject> errors = new ArrayList<CompositeErrorObject>();
754         // errors.add(new CompositeErrorObject(requests, errorsList));
755         //
756         // specMessage = new PCEPErrorMessage(errors);
757         // assertEquals(deserMsg("src/test/resources/PCErr.2.bin").toString(), asList((Message) specMessage).toString());
758         //
759         // specMessage = new PCEPErrorMessage(new PCEPOpenObject(0, 0, 0), errorsList, null);
760         // assertEquals(deserMsg("src/test/resources/PCErr.3.bin").toString(), asList((Message) specMessage).toString());
761         //
762         // requests = new ArrayList<PCEPRequestParameterObject>();
763         // requests.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 1, 53,
764         // false, false));
765         //
766         // errors = new ArrayList<CompositeErrorObject>();
767         // errors.add(new CompositeErrorObject(requests, errorsList));
768         //
769         // specMessage = new PCEPErrorMessage(errors);
770         // assertEquals(deserMsg("src/test/resources/PCErr.3b.bin").toString(), asList((Message) specMessage).toString());
771         //
772         // errorsList = new ArrayList<PCEPErrorObject>();
773         // errorsList.add(new PCEPErrorObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
774         // errorsList.add(new PCEPErrorObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
775         // errorsList.add(new PCEPErrorObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
776         //
777         // specMessage = new PCEPErrorMessage(null, errorsList, null);
778         // assertEquals(deserMsg("src/test/resources/PCErr.4.bin").toString(), asList((Message) specMessage).toString());
779         //
780         // requests = new ArrayList<PCEPRequestParameterObject>();
781         // requests.add(new PCEPRequestParameterObject(true, false, false, false, false, false, false, false, (short) 1, 53,
782         // false, false));
783         //
784         // errorsList = new ArrayList<PCEPErrorObject>();
785         // errorsList.add(new PCEPErrorObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
786         //
787         // errors = new ArrayList<CompositeErrorObject>();
788         // errors.add(new CompositeErrorObject(requests, errorsList));
789         // errors.add(new CompositeErrorObject(requests, errorsList));
790         //
791         // specMessage = new PCEPErrorMessage(errors);
792         // assertEquals(deserMsg("src/test/resources/PCErr.5.bin").toString(), asList((Message) specMessage).toString());
793         // }
794 }