2 * Copyright 2014-2015 Open Networking Laboratory
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test;
21 import org.onosproject.pcepio.exceptions.PcepParseException;
23 import static org.hamcrest.MatcherAssert.assertThat;
24 import static org.hamcrest.Matchers.instanceOf;
25 import static org.hamcrest.core.Is.is;
27 public class PcepInitiateMsgExtTest {
30 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
31 * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv),
32 * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST objects in PcInitiate message.
35 public void initiateMessageTest1() throws PcepParseException {
37 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
38 * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST.
40 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA4,
41 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
42 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
43 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03,
44 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
45 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
46 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
47 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
48 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
49 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
50 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
51 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
52 0x07, 0x10, 0x00, 0x14, //ERO object
53 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
54 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
55 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
57 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
58 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, //Metric object
59 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
61 byte[] testInitiateCreationMsg = {0};
62 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
63 buffer.writeBytes(initiateCreationMsg);
65 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
66 PcepMessage message = null;
68 message = reader.readFrom(buffer);
70 assertThat(message, instanceOf(PcepInitiateMsg.class));
71 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
75 testInitiateCreationMsg = buf.array();
77 int iReadLen = buf.writerIndex();
78 testInitiateCreationMsg = new byte[iReadLen];
79 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
81 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
85 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
86 * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv,
87 * StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT
88 * objects in PcInitiate message.
91 public void initiateMessageTest2() throws PcepParseException {
93 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
94 * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
96 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA8,
97 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
98 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
99 0x20, 0x10, 0x00, 0x48, 0x00, 0x00, 0x10, 0x03, //LSP object
100 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
101 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
102 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
103 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
104 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
106 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
107 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
108 0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
109 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
110 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
111 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
112 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
113 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
114 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
115 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
117 byte[] testInitiateCreationMsg = {0};
118 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
119 buffer.writeBytes(initiateCreationMsg);
121 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
122 PcepMessage message = null;
124 message = reader.readFrom(buffer);
126 assertThat(message, instanceOf(PcepInitiateMsg.class));
127 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
129 message.writeTo(buf);
131 testInitiateCreationMsg = buf.array();
133 int iReadLen = buf.writerIndex();
134 testInitiateCreationMsg = new byte[iReadLen];
135 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
137 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
141 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
142 * StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS,
143 * ERO, LSPA, BANDWIDTH objects in PcInitiate message.
146 public void initiateMessageTest3() throws PcepParseException {
148 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
149 * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH.
151 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
152 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
153 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
154 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
155 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
156 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
157 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
158 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
159 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
161 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
162 // 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
163 //0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
164 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
165 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
166 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
167 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
169 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};
171 byte[] testInitiateCreationMsg = {0};
172 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
173 buffer.writeBytes(initiateCreationMsg);
175 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
176 PcepMessage message = null;
178 message = reader.readFrom(buffer);
180 assertThat(message, instanceOf(PcepInitiateMsg.class));
181 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
183 message.writeTo(buf);
185 testInitiateCreationMsg = buf.array();
187 int iReadLen = buf.writerIndex();
188 testInitiateCreationMsg = new byte[iReadLen];
189 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
191 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
195 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
196 * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv),
197 * END-POINTS, ERO, LSPA objects in PcInitiate message.
200 public void initiateMessageTest4() throws PcepParseException {
202 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
203 * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA.
205 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
206 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
207 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
208 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
209 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
210 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
211 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
212 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
213 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
214 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
215 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
216 // 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
217 // 0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
218 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
219 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
220 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
221 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
222 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
224 byte[] testInitiateCreationMsg = {0};
225 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
226 buffer.writeBytes(initiateCreationMsg);
228 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
229 PcepMessage message = null;
231 message = reader.readFrom(buffer);
233 assertThat(message, instanceOf(PcepInitiateMsg.class));
234 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
236 message.writeTo(buf);
238 testInitiateCreationMsg = buf.array();
240 int iReadLen = buf.writerIndex();
241 testInitiateCreationMsg = new byte[iReadLen];
242 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
244 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
248 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
249 * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA
250 * objects in PcInitiate message.
253 public void initiateMessageTest5() throws PcepParseException {
255 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
256 * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA.
258 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
259 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
260 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
261 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
262 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
263 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
264 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
265 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
266 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
268 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
269 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
270 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
271 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
272 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
273 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
275 byte[] testInitiateCreationMsg = {0};
276 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
277 buffer.writeBytes(initiateCreationMsg);
279 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
280 PcepMessage message = null;
282 message = reader.readFrom(buffer);
284 assertThat(message, instanceOf(PcepInitiateMsg.class));
285 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
287 message.writeTo(buf);
289 testInitiateCreationMsg = buf.array();
291 int iReadLen = buf.writerIndex();
292 testInitiateCreationMsg = new byte[iReadLen];
293 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
295 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
299 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
300 * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA,
301 * BANDWIDTH OBJECT objects in PcInitiate message.
304 public void initiateMessageTest6() throws PcepParseException {
306 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
307 * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
309 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
310 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
311 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
312 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
313 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
314 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
315 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
316 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
317 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
318 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
319 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
320 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
321 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
322 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
323 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
324 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
325 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};
327 byte[] testInitiateCreationMsg = {0};
328 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
329 buffer.writeBytes(initiateCreationMsg);
331 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
332 PcepMessage message = null;
334 message = reader.readFrom(buffer);
336 assertThat(message, instanceOf(PcepInitiateMsg.class));
337 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
339 message.writeTo(buf);
341 testInitiateCreationMsg = buf.array();
343 int iReadLen = buf.writerIndex();
344 testInitiateCreationMsg = new byte[iReadLen];
345 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
347 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
351 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
352 * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO,
353 * LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
356 public void initiateMessageTest7() throws PcepParseException {
358 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
359 * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
361 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x98,
362 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
363 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
364 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
365 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
366 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
367 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
368 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
369 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
370 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
371 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
372 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
373 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
374 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
375 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
376 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
377 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
378 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
380 byte[] testInitiateCreationMsg = {0};
381 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
382 buffer.writeBytes(initiateCreationMsg);
384 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
385 PcepMessage message = null;
387 message = reader.readFrom(buffer);
389 assertThat(message, instanceOf(PcepInitiateMsg.class));
390 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
392 message.writeTo(buf);
394 testInitiateCreationMsg = buf.array();
396 int iReadLen = buf.writerIndex();
397 testInitiateCreationMsg = new byte[iReadLen];
398 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
400 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
404 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
405 * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT
406 * objects in PcInitiate message.
409 public void initiateMessageTest8() throws PcepParseException {
411 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
412 * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
414 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x90,
415 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
416 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
417 0x20, 0x10, 0x00, 0x30, 0x00, 0x00, 0x10, 0x03, //LSP object
418 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
419 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
420 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
421 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
422 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
423 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
424 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
425 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
426 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
427 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
428 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
429 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
430 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
432 byte[] testInitiateCreationMsg = {0};
433 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
434 buffer.writeBytes(initiateCreationMsg);
436 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
437 PcepMessage message = null;
439 message = reader.readFrom(buffer);
441 assertThat(message, instanceOf(PcepInitiateMsg.class));
442 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
444 message.writeTo(buf);
446 testInitiateCreationMsg = buf.array();
448 int iReadLen = buf.writerIndex();
449 testInitiateCreationMsg = new byte[iReadLen];
450 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
452 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
456 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
457 * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT
458 * objects in PcInitiate message.
461 public void initiateMessageTest9() throws PcepParseException {
463 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
464 * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
466 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
467 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
468 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
469 0x20, 0x10, 0x00, 0x30, 0x00, 0x00, 0x10, 0x03, //LSP object
470 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
471 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
472 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
473 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
474 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
475 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
476 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
477 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
478 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
479 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
480 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
481 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
483 byte[] testInitiateCreationMsg = {0};
484 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
485 buffer.writeBytes(initiateCreationMsg);
487 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
488 PcepMessage message = null;
490 message = reader.readFrom(buffer);
492 assertThat(message, instanceOf(PcepInitiateMsg.class));
493 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
495 message.writeTo(buf);
497 testInitiateCreationMsg = buf.array();
499 int iReadLen = buf.writerIndex();
500 testInitiateCreationMsg = new byte[iReadLen];
501 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
503 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
507 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
508 * SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
511 public void initiateMessageTest10() throws PcepParseException {
513 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
514 * END-POINTS, ERO, LSPA OBJECT.
516 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
517 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
518 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
519 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
520 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
521 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
522 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
523 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
524 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
525 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
526 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
527 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
528 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
530 byte[] testInitiateCreationMsg = {0};
531 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
532 buffer.writeBytes(initiateCreationMsg);
534 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
535 PcepMessage message = null;
537 message = reader.readFrom(buffer);
539 assertThat(message, instanceOf(PcepInitiateMsg.class));
540 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
542 message.writeTo(buf);
544 testInitiateCreationMsg = buf.array();
546 int iReadLen = buf.writerIndex();
547 testInitiateCreationMsg = new byte[iReadLen];
548 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
550 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
554 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
555 * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA OBJECT
556 * objects in PcInitiate message.
559 public void initiateMessageTest11() throws PcepParseException {
561 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
562 * END-POINTS, ERO, LSPA OBJECT.
564 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7C,
565 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
566 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
567 0x20, 0x10, 0x00, 0x30, 0x00, 0x00, 0x10, 0x03,
568 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
569 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
570 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
571 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
572 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
573 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
574 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
575 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
576 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
577 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
578 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
580 byte[] testInitiateCreationMsg = {0};
581 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
582 buffer.writeBytes(initiateCreationMsg);
584 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
585 PcepMessage message = null;
587 message = reader.readFrom(buffer);
589 assertThat(message, instanceOf(PcepInitiateMsg.class));
590 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
592 message.writeTo(buf);
594 int iReadLen = buf.writerIndex();
595 testInitiateCreationMsg = new byte[iReadLen];
596 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
598 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
602 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
603 * SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT
604 * objects in PcInitiate message.
607 public void initiateMessageTest12() throws PcepParseException {
609 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
610 * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
612 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x78,
613 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
614 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
615 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
616 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
617 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
618 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
619 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
620 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
621 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
622 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
623 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
624 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
625 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
627 byte[] testInitiateCreationMsg = {0};
628 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
629 buffer.writeBytes(initiateCreationMsg);
631 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
632 PcepMessage message = null;
634 message = reader.readFrom(buffer);
636 assertThat(message, instanceOf(PcepInitiateMsg.class));
637 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
639 message.writeTo(buf);
641 testInitiateCreationMsg = buf.array();
643 int iReadLen = buf.writerIndex();
644 testInitiateCreationMsg = new byte[iReadLen];
645 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
647 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
651 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
652 * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT
653 * objects in PcInitiate message.
656 public void initiateMessageTest13() throws PcepParseException {
658 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
659 * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
661 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
662 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
663 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
664 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
665 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
666 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
667 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
668 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
669 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
670 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
671 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
672 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
673 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
674 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
675 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
677 byte[] testInitiateCreationMsg = {0};
678 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
679 buffer.writeBytes(initiateCreationMsg);
681 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
682 PcepMessage message = null;
684 message = reader.readFrom(buffer);
686 assertThat(message, instanceOf(PcepInitiateMsg.class));
687 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
689 message.writeTo(buf);
691 testInitiateCreationMsg = buf.array();
693 int iReadLen = buf.writerIndex();
694 testInitiateCreationMsg = new byte[iReadLen];
695 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
697 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
701 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
702 * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT objects in PcInitiate message.
705 public void initiateMessageTest14() throws PcepParseException {
707 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
708 * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
710 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7c,
711 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
712 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
713 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
714 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
715 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
716 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
717 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
718 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
719 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
720 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
721 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
722 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
723 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
725 byte[] testInitiateCreationMsg = {0};
726 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
727 buffer.writeBytes(initiateCreationMsg);
729 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
730 PcepMessage message = null;
732 message = reader.readFrom(buffer);
734 assertThat(message, instanceOf(PcepInitiateMsg.class));
735 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
737 message.writeTo(buf);
739 testInitiateCreationMsg = buf.array();
741 int iReadLen = buf.writerIndex();
742 testInitiateCreationMsg = new byte[iReadLen];
743 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
745 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
749 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
750 * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
753 public void initiateMessageTest15() throws PcepParseException {
755 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
756 * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
758 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
759 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
760 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
761 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
762 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
763 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
764 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
765 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
766 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
767 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
768 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
769 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
770 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
772 byte[] testInitiateCreationMsg = {0};
773 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
774 buffer.writeBytes(initiateCreationMsg);
776 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
777 PcepMessage message = null;
779 message = reader.readFrom(buffer);
781 assertThat(message, instanceOf(PcepInitiateMsg.class));
782 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
784 message.writeTo(buf);
786 testInitiateCreationMsg = buf.array();
788 int iReadLen = buf.writerIndex();
789 testInitiateCreationMsg = new byte[iReadLen];
790 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
792 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
796 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
797 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
800 public void initiateMessageTest16() throws PcepParseException {
802 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
803 * END-POINTS, ERO, LSPA OBJECT.
805 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
806 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
807 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
808 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
809 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
810 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
811 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
812 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
813 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
814 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
815 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
816 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
818 byte[] testInitiateCreationMsg = {0};
819 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
820 buffer.writeBytes(initiateCreationMsg);
822 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
823 PcepMessage message = null;
825 message = reader.readFrom(buffer);
827 assertThat(message, instanceOf(PcepInitiateMsg.class));
828 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
830 message.writeTo(buf);
832 testInitiateCreationMsg = buf.array();
834 int iReadLen = buf.writerIndex();
835 testInitiateCreationMsg = new byte[iReadLen];
836 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
838 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
842 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT
843 * objects in PcInitiate message.
846 public void initiateMessageTest17() throws PcepParseException {
848 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
850 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
851 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
852 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
853 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
854 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
855 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
856 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
857 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
858 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
859 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
860 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
862 byte[] testInitiateCreationMsg = {0};
863 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
864 buffer.writeBytes(initiateCreationMsg);
866 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
867 PcepMessage message = null;
869 message = reader.readFrom(buffer);
871 assertThat(message, instanceOf(PcepInitiateMsg.class));
872 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
874 message.writeTo(buf);
876 testInitiateCreationMsg = buf.array();
878 int iReadLen = buf.writerIndex();
879 testInitiateCreationMsg = new byte[iReadLen];
880 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
882 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
886 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
887 * BANDWIDTH OBJECT objects in PcInitiate message.
890 public void initiateMessageTest18() throws PcepParseException {
892 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
894 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
895 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
896 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03,
897 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
898 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
899 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
900 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
901 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
902 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
903 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
904 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
905 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
907 byte[] testInitiateCreationMsg = {0};
908 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
909 buffer.writeBytes(initiateCreationMsg);
911 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
912 PcepMessage message = null;
915 message = reader.readFrom(buffer);
917 assertThat(message, instanceOf(PcepInitiateMsg.class));
918 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
920 message.writeTo(buf);
922 testInitiateCreationMsg = buf.array();
924 int iReadLen = buf.writerIndex();
925 testInitiateCreationMsg = new byte[iReadLen];
926 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
928 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
932 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
933 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
936 public void initiateMessageTest19() throws PcepParseException {
938 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
940 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
941 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
942 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
943 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
944 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
945 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
946 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
947 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
948 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
949 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
950 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
951 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
952 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
954 byte[] testInitiateCreationMsg = {0};
955 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
956 buffer.writeBytes(initiateCreationMsg);
958 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
959 PcepMessage message = null;
961 message = reader.readFrom(buffer);
963 assertThat(message, instanceOf(PcepInitiateMsg.class));
964 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
966 message.writeTo(buf);
968 testInitiateCreationMsg = buf.array();
970 int iReadLen = buf.writerIndex();
971 testInitiateCreationMsg = new byte[iReadLen];
972 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
974 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
978 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
979 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
982 public void initiateMessageTest20() throws PcepParseException {
984 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
986 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
987 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
988 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
989 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
990 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
991 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
992 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
993 0x07, 0x10, 0x00, 0x04, //ERO object
994 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
995 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
996 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
997 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
999 byte[] testInitiateCreationMsg = {0};
1000 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1001 buffer.writeBytes(initiateCreationMsg);
1003 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1004 PcepMessage message = null;
1006 message = reader.readFrom(buffer);
1008 assertThat(message, instanceOf(PcepInitiateMsg.class));
1009 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1011 message.writeTo(buf);
1013 testInitiateCreationMsg = buf.array();
1015 int iReadLen = buf.writerIndex();
1016 testInitiateCreationMsg = new byte[iReadLen];
1017 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1019 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1023 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
1024 * BANDWIDTH OBJECT objects in PcInitiate message.
1027 public void initiateMessageTest21() throws PcepParseException {
1029 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
1031 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1032 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1033 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
1034 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
1035 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
1036 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
1037 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1038 0x07, 0x10, 0x00, 0x04,
1039 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1040 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1041 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
1043 byte[] testInitiateCreationMsg = {0};
1044 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1045 buffer.writeBytes(initiateCreationMsg);
1047 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1048 PcepMessage message = null;
1050 message = reader.readFrom(buffer);
1052 assertThat(message, instanceOf(PcepInitiateMsg.class));
1053 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1055 message.writeTo(buf);
1057 testInitiateCreationMsg = buf.array();
1059 int iReadLen = buf.writerIndex();
1060 testInitiateCreationMsg = new byte[iReadLen];
1061 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1063 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1067 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO,
1068 * LSPA OBJECT objects in PcInitiate message.
1071 public void initiateMessageTest22() throws PcepParseException {
1073 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
1075 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
1076 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1077 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
1078 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
1079 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
1080 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
1081 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1082 0x07, 0x10, 0x00, 0x04, //ERO object
1083 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1084 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1086 byte[] testInitiateCreationMsg = {0};
1087 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1088 buffer.writeBytes(initiateCreationMsg);
1090 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1091 PcepMessage message = null;
1093 message = reader.readFrom(buffer);
1095 assertThat(message, instanceOf(PcepInitiateMsg.class));
1096 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1098 message.writeTo(buf);
1100 testInitiateCreationMsg = buf.array();
1102 int iReadLen = buf.writerIndex();
1103 testInitiateCreationMsg = new byte[iReadLen];
1104 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1106 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1110 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
1111 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
1114 public void initiateMessageTest23() throws PcepParseException {
1116 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
1118 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1119 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1120 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1121 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
1122 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
1123 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
1124 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
1125 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1126 0x07, 0x10, 0x00, 0x04, //ERO object
1127 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1128 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1130 byte[] testInitiateCreationMsg = {0};
1131 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1132 buffer.writeBytes(initiateCreationMsg);
1134 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1135 PcepMessage message = null;
1137 message = reader.readFrom(buffer);
1139 assertThat(message, instanceOf(PcepInitiateMsg.class));
1140 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1142 message.writeTo(buf);
1144 testInitiateCreationMsg = buf.array();
1146 int iReadLen = buf.writerIndex();
1147 testInitiateCreationMsg = new byte[iReadLen];
1148 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1150 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1154 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
1155 * END-POINTS, ERO, LSPA BANDWIDTH OBJECT objects in PcInitiate message.
1158 public void initiateMessageTest25() throws PcepParseException {
1160 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA BANDWIDTH OBJECT.
1162 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
1163 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1164 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1165 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
1166 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
1167 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
1168 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
1169 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1170 0x07, 0x10, 0x00, 0x04, //ERO object
1171 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1172 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1173 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
1175 byte[] testInitiateCreationMsg = {0};
1176 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1177 buffer.writeBytes(initiateCreationMsg);
1179 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1180 PcepMessage message = null;
1182 message = reader.readFrom(buffer);
1184 assertThat(message, instanceOf(PcepInitiateMsg.class));
1185 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1187 message.writeTo(buf);
1189 testInitiateCreationMsg = buf.array();
1191 int iReadLen = buf.writerIndex();
1192 testInitiateCreationMsg = new byte[iReadLen];
1193 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1195 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1199 * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
1200 * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
1203 public void initiateMessageTest26() throws PcepParseException {
1205 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
1206 * ERO, LSPA, BANDWIDTH, METRIC OBJECT.
1208 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x6C,
1209 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1210 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1211 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
1212 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
1213 (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
1214 (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
1215 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1216 0x07, 0x10, 0x00, 0x04, //ERO object
1217 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1218 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1219 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
1220 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01}; //Metric object
1222 byte[] testInitiateCreationMsg = {0};
1223 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1224 buffer.writeBytes(initiateCreationMsg);
1226 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1227 PcepMessage message = null;
1229 message = reader.readFrom(buffer);
1231 assertThat(message, instanceOf(PcepInitiateMsg.class));
1232 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1234 message.writeTo(buf);
1236 testInitiateCreationMsg = buf.array();
1238 int iReadLen = buf.writerIndex();
1239 testInitiateCreationMsg = new byte[iReadLen];
1240 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1242 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1246 * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA,
1247 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
1250 public void initiateMessageTest27() throws PcepParseException {
1252 /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
1254 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
1255 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1256 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1257 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
1258 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1259 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1260 0x07, 0x10, 0x00, 0x04, //ERO object
1261 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1262 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1263 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
1264 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01}; //Metric object
1266 byte[] testInitiateCreationMsg = {0};
1267 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1268 buffer.writeBytes(initiateCreationMsg);
1270 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1271 PcepMessage message = null;
1273 message = reader.readFrom(buffer);
1275 assertThat(message, instanceOf(PcepInitiateMsg.class));
1276 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1278 message.writeTo(buf);
1280 testInitiateCreationMsg = buf.array();
1282 int iReadLen = buf.writerIndex();
1283 testInitiateCreationMsg = new byte[iReadLen];
1284 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1286 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1290 * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO,
1291 * LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
1294 public void initiateMessageTest28() throws PcepParseException {
1296 /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
1298 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
1299 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1300 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1301 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
1302 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1303 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1304 0x07, 0x10, 0x00, 0x04, //ERO object
1305 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1306 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1307 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
1309 byte[] testInitiateCreationMsg = {0};
1310 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1311 buffer.writeBytes(initiateCreationMsg);
1313 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1314 PcepMessage message = null;
1316 message = reader.readFrom(buffer);
1318 assertThat(message, instanceOf(PcepInitiateMsg.class));
1319 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1321 message.writeTo(buf);
1323 testInitiateCreationMsg = buf.array();
1325 int iReadLen = buf.writerIndex();
1326 testInitiateCreationMsg = new byte[iReadLen];
1327 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1329 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1333 * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
1334 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
1337 public void initiateMessageTest29() throws PcepParseException {
1339 /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
1341 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x4C,
1342 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1343 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1344 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
1345 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1346 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1347 0x07, 0x10, 0x00, 0x04, //ERO object
1348 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1351 byte[] testInitiateCreationMsg = {0};
1352 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1353 buffer.writeBytes(initiateCreationMsg);
1355 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1356 PcepMessage message = null;
1358 message = reader.readFrom(buffer);
1360 assertThat(message, instanceOf(PcepInitiateMsg.class));
1361 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1363 message.writeTo(buf);
1365 testInitiateCreationMsg = buf.array();
1367 int iReadLen = buf.writerIndex();
1368 testInitiateCreationMsg = new byte[iReadLen];
1369 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1371 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1375 * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
1376 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
1379 public void initiateMessageTest30() throws PcepParseException {
1381 /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
1383 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5C,
1384 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1385 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1386 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
1387 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1388 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1389 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
1390 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
1391 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1392 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1394 byte[] testInitiateCreationMsg = {0};
1395 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1396 buffer.writeBytes(initiateCreationMsg);
1398 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1399 PcepMessage message = null;
1401 message = reader.readFrom(buffer);
1403 assertThat(message, instanceOf(PcepInitiateMsg.class));
1404 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1406 message.writeTo(buf);
1408 testInitiateCreationMsg = buf.array();
1410 int iReadLen = buf.writerIndex();
1411 testInitiateCreationMsg = new byte[iReadLen];
1412 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1414 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1418 * This test case checks for SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT
1419 * objects in PcInitiate message.
1422 public void initiateMessageTest31() throws PcepParseException {
1424 /* SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
1426 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
1427 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1428 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
1429 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1430 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1431 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
1432 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
1433 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1434 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1436 byte[] testInitiateCreationMsg = {0};
1437 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1438 buffer.writeBytes(initiateCreationMsg);
1440 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1441 PcepMessage message = null;
1443 message = reader.readFrom(buffer);
1445 assertThat(message, instanceOf(PcepInitiateMsg.class));
1446 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1448 message.writeTo(buf);
1450 testInitiateCreationMsg = buf.array();
1452 int iReadLen = buf.writerIndex();
1453 testInitiateCreationMsg = new byte[iReadLen];
1454 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1456 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1460 * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1461 * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
1464 public void initiateMessageTest32() throws PcepParseException {
1466 /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1467 * ERO, LSPA, BANDWIDTH, METRIC OBJECT.
1469 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
1470 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1471 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1472 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
1473 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
1474 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
1475 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1476 0x07, 0x10, 0x00, 0x04, //ERO object
1477 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1478 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1479 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
1480 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01}; //Metric object
1482 byte[] testInitiateCreationMsg = {0};
1483 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1484 buffer.writeBytes(initiateCreationMsg);
1486 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1487 PcepMessage message = null;
1489 message = reader.readFrom(buffer);
1491 assertThat(message, instanceOf(PcepInitiateMsg.class));
1492 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1494 message.writeTo(buf);
1496 testInitiateCreationMsg = buf.array();
1498 int iReadLen = buf.writerIndex();
1499 testInitiateCreationMsg = new byte[iReadLen];
1500 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1502 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1506 * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1507 * ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
1510 public void initiateMessageTest33() throws PcepParseException {
1512 /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1513 * ERO, LSPA, BANDWIDTH OBJECT.
1515 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1516 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1517 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1518 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
1519 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
1520 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
1521 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1522 0x07, 0x10, 0x00, 0x04, //ERO object
1523 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1524 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
1525 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
1527 byte[] testInitiateCreationMsg = {0};
1528 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1529 buffer.writeBytes(initiateCreationMsg);
1531 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1532 PcepMessage message = null;
1534 message = reader.readFrom(buffer);
1536 assertThat(message, instanceOf(PcepInitiateMsg.class));
1537 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1539 message.writeTo(buf);
1541 testInitiateCreationMsg = buf.array();
1543 int iReadLen = buf.writerIndex();
1544 testInitiateCreationMsg = new byte[iReadLen];
1545 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1547 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1551 * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1552 * ERO, LSPA OBJECT objects in PcInitiate message.
1555 public void initiateMessageTest34() throws PcepParseException {
1557 /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1560 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
1561 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1562 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1563 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
1564 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
1565 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
1566 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1567 0x07, 0x10, 0x00, 0x04, //ERO object
1568 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1569 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1571 byte[] testInitiateCreationMsg = {0};
1572 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1573 buffer.writeBytes(initiateCreationMsg);
1575 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1576 PcepMessage message = null;
1578 message = reader.readFrom(buffer);
1580 assertThat(message, instanceOf(PcepInitiateMsg.class));
1581 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1583 message.writeTo(buf);
1585 testInitiateCreationMsg = buf.array();
1587 int iReadLen = buf.writerIndex();
1588 testInitiateCreationMsg = new byte[iReadLen];
1589 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1591 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1595 * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1596 * ERO, LSPA OBJECT objects in PcInitiate message.
1599 public void initiateMessageTest35() throws PcepParseException {
1601 /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1604 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
1605 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1606 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
1607 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
1608 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
1609 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
1610 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1611 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
1612 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
1613 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1614 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1616 byte[] testInitiateCreationMsg = {0};
1617 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1618 buffer.writeBytes(initiateCreationMsg);
1620 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1621 PcepMessage message = null;
1623 message = reader.readFrom(buffer);
1625 assertThat(message, instanceOf(PcepInitiateMsg.class));
1626 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1628 message.writeTo(buf);
1630 testInitiateCreationMsg = buf.array();
1632 int iReadLen = buf.writerIndex();
1633 testInitiateCreationMsg = new byte[iReadLen];
1634 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1636 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
1640 * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1641 * ERO, LSPA OBJECT objects in PcInitiate message.
1644 public void initiateMessageTest36() throws PcepParseException {
1646 /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1649 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1650 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1651 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
1652 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
1653 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
1654 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
1655 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
1656 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
1657 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
1658 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
1660 byte[] testInitiateCreationMsg = {0};
1661 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1662 buffer.writeBytes(initiateCreationMsg);
1664 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1665 PcepMessage message = null;
1667 message = reader.readFrom(buffer);
1669 assertThat(message, instanceOf(PcepInitiateMsg.class));
1670 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1672 message.writeTo(buf);
1674 testInitiateCreationMsg = buf.array();
1676 int iReadLen = buf.writerIndex();
1677 testInitiateCreationMsg = new byte[iReadLen];
1678 buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
1680 assertThat(testInitiateCreationMsg, is(initiateCreationMsg));