Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 3 | * |
| 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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. |
| 15 | */ |
Sho SHIMIZU | 3559c31 | 2015-11-04 14:59:31 -0800 | [diff] [blame] | 16 | package org.onosproject.pcepio.protocol; |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 17 | |
| 18 | import org.jboss.netty.buffer.ChannelBuffer; |
| 19 | import org.jboss.netty.buffer.ChannelBuffers; |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 20 | import org.junit.Test; |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 21 | import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException; |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 22 | import org.onosproject.pcepio.exceptions.PcepParseException; |
Sho SHIMIZU | 3559c31 | 2015-11-04 14:59:31 -0800 | [diff] [blame] | 23 | |
| 24 | import static org.hamcrest.MatcherAssert.assertThat; |
| 25 | import static org.hamcrest.Matchers.instanceOf; |
| 26 | import static org.hamcrest.core.Is.is; |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 27 | |
| 28 | public class PcepUpdateMsgTest { |
| 29 | /** |
| 30 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), ERO in PcUpd message. |
| 31 | */ |
| 32 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 33 | public void pcepUpdateMsgTest1() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 34 | |
| 35 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x30, |
| 36 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 37 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 38 | 0x00, 0x12, 0x00, 0x10, (byte) 0xb6, 0x02, 0x4e, 0x1f, //StatefulIPv4LspIdentidiersTlv |
| 39 | 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 40 | 0x07, 0x10, 0x00, 0x04 }; //ERO object |
| 41 | |
| 42 | byte[] testupdateMsg = {0}; |
| 43 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 44 | buffer.writeBytes(updateMsg); |
| 45 | |
| 46 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 47 | PcepMessage message = null; |
| 48 | |
| 49 | message = reader.readFrom(buffer); |
| 50 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 51 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 52 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 53 | message.writeTo(buf); |
| 54 | testupdateMsg = buf.array(); |
| 55 | |
| 56 | int readLen = buf.writerIndex() - 0; |
| 57 | testupdateMsg = new byte[readLen]; |
| 58 | buf.readBytes(testupdateMsg, 0, readLen); |
| 59 | |
| 60 | assertThat(testupdateMsg, is(updateMsg)); |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * This test case checks for SRP(SymbolicPathNameTlv), LSP (StatefulIPv4LspIdentidiersTlv, |
| 65 | * SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO, LSPA, Metric-list in PcUpd message. |
| 66 | */ |
| 67 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 68 | public void pcepUpdateMsgTest2() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 69 | |
| 70 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x94, |
| 71 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 72 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 73 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object // lsp object |
| 74 | 0x00, 0x12, 0x00, 0x10, (byte) 0xb6, 0x02, 0x4e, 0x1f, //StatefulIPv4LspIdentidiersTlv |
| 75 | 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 76 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 77 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 78 | 0x07, 0x10, 0x00, 0x24, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 79 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 80 | 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01, |
| 81 | 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01, 0x01, 0x01, 0x04, 0x00, |
| 82 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 84 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, |
| 85 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 86 | |
| 87 | byte[] testupdateMsg = {0}; |
| 88 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 89 | buffer.writeBytes(updateMsg); |
| 90 | |
| 91 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 92 | PcepMessage message = null; |
| 93 | |
| 94 | message = reader.readFrom(buffer); |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 95 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 96 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 97 | message.writeTo(buf); |
| 98 | testupdateMsg = buf.array(); |
| 99 | |
| 100 | int readLen = buf.writerIndex() - 0; |
| 101 | testupdateMsg = new byte[readLen]; |
| 102 | buf.readBytes(testupdateMsg, 0, readLen); |
| 103 | |
| 104 | assertThat(testupdateMsg, is(updateMsg)); |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), |
| 109 | * ERO objects in PcUpd message. |
| 110 | */ |
| 111 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 112 | public void pcepUpdateMsgTest3() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 113 | |
| 114 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x38, |
| 115 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 116 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 117 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 118 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 119 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 120 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 121 | 0x07, 0x10, 0x00, 0x04 }; //ERO object |
| 122 | |
| 123 | byte[] testupdateMsg = {0}; |
| 124 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 125 | buffer.writeBytes(updateMsg); |
| 126 | |
| 127 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 128 | PcepMessage message = null; |
| 129 | |
| 130 | message = reader.readFrom(buffer); |
| 131 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 132 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 133 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 134 | message.writeTo(buf); |
| 135 | testupdateMsg = buf.array(); |
| 136 | |
| 137 | int readLen = buf.writerIndex() - 0; |
| 138 | testupdateMsg = new byte[readLen]; |
| 139 | buf.readBytes(testupdateMsg, 0, readLen); |
| 140 | |
| 141 | assertThat(testupdateMsg, is(updateMsg)); |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, |
| 146 | * SymbolicPathNameTlv), ERO objects in PcUpd message. |
| 147 | */ |
| 148 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 149 | public void pcepUpdateMsgTest4() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 150 | |
| 151 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40, |
| 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, 0x24, 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, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 159 | 0x07, 0x10, 0x00, 0x04 }; //ERO object |
| 160 | |
| 161 | byte[] testupdateMsg = {0}; |
| 162 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 163 | buffer.writeBytes(updateMsg); |
| 164 | |
| 165 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 166 | PcepMessage message = null; |
| 167 | |
| 168 | message = reader.readFrom(buffer); |
| 169 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 170 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 171 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 172 | message.writeTo(buf); |
| 173 | testupdateMsg = buf.array(); |
| 174 | |
| 175 | int readLen = buf.writerIndex() - 0; |
| 176 | testupdateMsg = new byte[readLen]; |
| 177 | buf.readBytes(testupdateMsg, 0, readLen); |
| 178 | |
| 179 | assertThat(testupdateMsg, is(updateMsg)); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, |
| 184 | * SymbolicPathNameTlv), ERO objects in PcUpd message. |
| 185 | */ |
| 186 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 187 | public void pcepUpdateMsgTest5() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 188 | |
| 189 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40, |
| 190 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 191 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 192 | 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 193 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 194 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 195 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 196 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 197 | 0x07, 0x10, 0x00, 0x04 }; //ERO object |
| 198 | |
| 199 | byte[] testupdateMsg = {0}; |
| 200 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 201 | buffer.writeBytes(updateMsg); |
| 202 | |
| 203 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 204 | PcepMessage message = null; |
| 205 | |
| 206 | message = reader.readFrom(buffer); |
| 207 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 208 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 209 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 210 | message.writeTo(buf); |
| 211 | testupdateMsg = buf.array(); |
| 212 | |
| 213 | int readLen = buf.writerIndex() - 0; |
| 214 | testupdateMsg = new byte[readLen]; |
| 215 | buf.readBytes(testupdateMsg, 0, readLen); |
| 216 | |
| 217 | assertThat(testupdateMsg, is(updateMsg)); |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 222 | * StatefulLspErrorCodeTlv), ERO objects in PcUpd message. |
| 223 | */ |
| 224 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 225 | public void pcepUpdateMsgTest6() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 226 | |
| 227 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, |
| 228 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 229 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 230 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 231 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 232 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 233 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 234 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 235 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 236 | 0x07, 0x10, 0x00, 0x04 }; |
| 237 | |
| 238 | byte[] testupdateMsg = {0}; |
| 239 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 240 | buffer.writeBytes(updateMsg); |
| 241 | |
| 242 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 243 | PcepMessage message = null; |
| 244 | |
| 245 | message = reader.readFrom(buffer); |
| 246 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 247 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 248 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 249 | message.writeTo(buf); |
| 250 | testupdateMsg = buf.array(); |
| 251 | |
| 252 | int readLen = buf.writerIndex() - 0; |
| 253 | testupdateMsg = new byte[readLen]; |
| 254 | buf.readBytes(testupdateMsg, 0, readLen); |
| 255 | |
| 256 | assertThat(testupdateMsg, is(updateMsg)); |
| 257 | |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 262 | * StatefulLspErrorCodeTlv), ERO objects in PcUpd message. |
| 263 | */ |
| 264 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 265 | public void pcepUpdateMsgTest7() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 266 | |
| 267 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, |
| 268 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 269 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 270 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 271 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 272 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 273 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 274 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 275 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 276 | 0x07, 0x10, 0x00, 0x04}; //ERO object |
| 277 | |
| 278 | byte[] testupdateMsg = {0}; |
| 279 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 280 | buffer.writeBytes(updateMsg); |
| 281 | |
| 282 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 283 | PcepMessage message = null; |
| 284 | |
| 285 | message = reader.readFrom(buffer); |
| 286 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 287 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 288 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 289 | message.writeTo(buf); |
| 290 | testupdateMsg = buf.array(); |
| 291 | |
| 292 | int readLen = buf.writerIndex() - 0; |
| 293 | testupdateMsg = new byte[readLen]; |
| 294 | buf.readBytes(testupdateMsg, 0, readLen); |
| 295 | assertThat(testupdateMsg, is(updateMsg)); |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 300 | * StatefulLspErrorCodeTlv), ERO (IPv4SubObject) objects in PcUpd message. |
| 301 | */ |
| 302 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 303 | public void pcepUpdateMsgTest8() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 304 | |
| 305 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50, |
| 306 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 307 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 308 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 309 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 310 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 311 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 312 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 313 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 314 | 0x07, 0x10, 0x00, 0x0c, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 315 | 0x01, 0x01, 0x04, 0x00 }; |
| 316 | |
| 317 | byte[] testupdateMsg = {0}; |
| 318 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 319 | buffer.writeBytes(updateMsg); |
| 320 | |
| 321 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 322 | PcepMessage message = null; |
| 323 | |
| 324 | message = reader.readFrom(buffer); |
| 325 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 326 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 327 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 328 | message.writeTo(buf); |
| 329 | testupdateMsg = buf.array(); |
| 330 | |
| 331 | int readLen = buf.writerIndex() - 0; |
| 332 | testupdateMsg = new byte[readLen]; |
| 333 | buf.readBytes(testupdateMsg, 0, readLen); |
| 334 | |
| 335 | assertThat(testupdateMsg, is(updateMsg)); |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 340 | * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject) objects in PcUpd message. |
| 341 | */ |
| 342 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 343 | public void pcepUpdateMsgTest9() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 344 | |
| 345 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, |
| 346 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 347 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 348 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 349 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 350 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 351 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 352 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 353 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 354 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 355 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 356 | 0x01, 0x01, 0x04, 0x00 }; |
| 357 | |
| 358 | byte[] testupdateMsg = {0}; |
| 359 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 360 | buffer.writeBytes(updateMsg); |
| 361 | |
| 362 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 363 | PcepMessage message = null; |
| 364 | |
| 365 | message = reader.readFrom(buffer); |
| 366 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 367 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 368 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 369 | message.writeTo(buf); |
| 370 | testupdateMsg = buf.array(); |
| 371 | |
| 372 | int readLen = buf.writerIndex() - 0; |
| 373 | testupdateMsg = new byte[readLen]; |
| 374 | buf.readBytes(testupdateMsg, 0, readLen); |
| 375 | |
| 376 | assertThat(testupdateMsg, is(updateMsg)); |
| 377 | } |
| 378 | |
| 379 | /** |
| 380 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 381 | * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), LSPA objects in PcUpd message. |
| 382 | */ |
| 383 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 384 | public void pcepUpdateMsgTest10() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 385 | |
| 386 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x6c, |
| 387 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 388 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 389 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 390 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 391 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 392 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 393 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 394 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 395 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 396 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 397 | 0x01, 0x01, 0x04, 0x00, |
| 398 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 399 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00 }; |
| 400 | |
| 401 | byte[] testupdateMsg = {0}; |
| 402 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 403 | buffer.writeBytes(updateMsg); |
| 404 | |
| 405 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 406 | PcepMessage message = null; |
| 407 | |
| 408 | message = reader.readFrom(buffer); |
| 409 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 410 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 411 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 412 | message.writeTo(buf); |
| 413 | testupdateMsg = buf.array(); |
| 414 | |
| 415 | int readLen = buf.writerIndex() - 0; |
| 416 | testupdateMsg = new byte[readLen]; |
| 417 | buf.readBytes(testupdateMsg, 0, readLen); |
| 418 | |
| 419 | assertThat(testupdateMsg, is(updateMsg)); |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 424 | * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, Metric objects in PcUpd message. |
| 425 | */ |
| 426 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 427 | public void pcepUpdateMsgTest11() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 428 | |
| 429 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78, |
| 430 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 431 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 432 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 433 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 434 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 435 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 436 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 437 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 438 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 439 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 440 | 0x01, 0x01, 0x04, 0x00, |
| 441 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 442 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 443 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 444 | |
| 445 | byte[] testupdateMsg = {0}; |
| 446 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 447 | buffer.writeBytes(updateMsg); |
| 448 | |
| 449 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 450 | PcepMessage message = null; |
| 451 | |
| 452 | message = reader.readFrom(buffer); |
| 453 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 454 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 455 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 456 | message.writeTo(buf); |
| 457 | testupdateMsg = buf.array(); |
| 458 | |
| 459 | int readLen = buf.writerIndex() - 0; |
| 460 | testupdateMsg = new byte[readLen]; |
| 461 | buf.readBytes(testupdateMsg, 0, readLen); |
| 462 | |
| 463 | assertThat(testupdateMsg, is(updateMsg)); |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 468 | * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. |
| 469 | */ |
| 470 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 471 | public void pcepUpdateMsgTest12() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 472 | |
| 473 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, |
| 474 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 475 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 476 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 477 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 478 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 479 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 480 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 481 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 482 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 483 | 0x01, 0x01, 0x04, 0x00, |
| 484 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 485 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 486 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 487 | |
| 488 | byte[] testupdateMsg = {0}; |
| 489 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 490 | buffer.writeBytes(updateMsg); |
| 491 | |
| 492 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 493 | PcepMessage message = null; |
| 494 | |
| 495 | message = reader.readFrom(buffer); |
| 496 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 497 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 498 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 499 | message.writeTo(buf); |
| 500 | testupdateMsg = buf.array(); |
| 501 | |
| 502 | int readLen = buf.writerIndex() - 0; |
| 503 | testupdateMsg = new byte[readLen]; |
| 504 | buf.readBytes(testupdateMsg, 0, readLen); |
| 505 | |
| 506 | assertThat(testupdateMsg, is(updateMsg)); |
| 507 | } |
| 508 | |
| 509 | /** |
| 510 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 511 | * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. |
| 512 | */ |
| 513 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 514 | public void pcepUpdateMsgTest13() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 515 | |
| 516 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, |
| 517 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 518 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 519 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 520 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 521 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 522 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 523 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 524 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 525 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 526 | 0x01, 0x01, 0x04, 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, |
| 529 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 530 | |
| 531 | byte[] testupdateMsg = {0}; |
| 532 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 533 | buffer.writeBytes(updateMsg); |
| 534 | |
| 535 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 536 | PcepMessage message = null; |
| 537 | |
| 538 | message = reader.readFrom(buffer); |
| 539 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 540 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 541 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 542 | message.writeTo(buf); |
| 543 | testupdateMsg = buf.array(); |
| 544 | |
| 545 | int readLen = buf.writerIndex() - 0; |
| 546 | testupdateMsg = new byte[readLen]; |
| 547 | buf.readBytes(testupdateMsg, 0, readLen); |
| 548 | |
| 549 | assertThat(testupdateMsg, is(updateMsg)); |
| 550 | } |
| 551 | |
| 552 | /** |
| 553 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv), |
| 554 | * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric Object objects in PcUpd message. |
| 555 | */ |
| 556 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 557 | public void pcepUpdateMsgTest14() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 558 | |
| 559 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, |
| 560 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 561 | 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 562 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 563 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 564 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 565 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 566 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 567 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 568 | 0x01, 0x01, 0x04, 0x00, |
| 569 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 570 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 571 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 572 | |
| 573 | byte[] testupdateMsg = {0}; |
| 574 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 575 | buffer.writeBytes(updateMsg); |
| 576 | |
| 577 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 578 | PcepMessage message = null; |
| 579 | |
| 580 | message = reader.readFrom(buffer); |
| 581 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 582 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 583 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 584 | message.writeTo(buf); |
| 585 | testupdateMsg = buf.array(); |
| 586 | |
| 587 | int readLen = buf.writerIndex() - 0; |
| 588 | testupdateMsg = new byte[readLen]; |
| 589 | buf.readBytes(testupdateMsg, 0, readLen); |
| 590 | |
| 591 | assertThat(testupdateMsg, is(updateMsg)); |
| 592 | } |
| 593 | |
| 594 | /** |
| 595 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv), |
| 596 | * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. |
| 597 | */ |
| 598 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 599 | public void pcepUpdateMsgTest15() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 600 | |
| 601 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, |
| 602 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 603 | 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 604 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 605 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 606 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 607 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 608 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 609 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 610 | 0x01, 0x01, 0x04, 0x00, |
| 611 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 612 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 613 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 614 | |
| 615 | byte[] testupdateMsg = {0}; |
| 616 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 617 | buffer.writeBytes(updateMsg); |
| 618 | |
| 619 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 620 | PcepMessage message = null; |
| 621 | |
| 622 | message = reader.readFrom(buffer); |
| 623 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 624 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 625 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 626 | message.writeTo(buf); |
| 627 | testupdateMsg = buf.array(); |
| 628 | |
| 629 | int readLen = buf.writerIndex() - 0; |
| 630 | testupdateMsg = new byte[readLen]; |
| 631 | buf.readBytes(testupdateMsg, 0, readLen); |
| 632 | |
| 633 | assertThat(testupdateMsg, is(updateMsg)); |
| 634 | } |
| 635 | |
| 636 | /** |
| 637 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 638 | * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. |
| 639 | */ |
| 640 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 641 | public void pcepUpdateMsgTest16() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 642 | |
| 643 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60, |
| 644 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 645 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 646 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 647 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 648 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 649 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 650 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 651 | 0x01, 0x01, 0x04, 0x00, |
| 652 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 653 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 654 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 655 | |
| 656 | byte[] testupdateMsg = {0}; |
| 657 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 658 | buffer.writeBytes(updateMsg); |
| 659 | |
| 660 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 661 | PcepMessage message = null; |
| 662 | |
| 663 | message = reader.readFrom(buffer); |
| 664 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 665 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 666 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 667 | message.writeTo(buf); |
| 668 | testupdateMsg = buf.array(); |
| 669 | |
| 670 | int readLen = buf.writerIndex() - 0; |
| 671 | testupdateMsg = new byte[readLen]; |
| 672 | buf.readBytes(testupdateMsg, 0, readLen); |
| 673 | |
| 674 | assertThat(testupdateMsg, is(updateMsg)); |
| 675 | } |
| 676 | |
| 677 | /** |
| 678 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 679 | * ERO (IPv4SubObject, IPv4SubObject),LSPA objects in PcUpd message. |
| 680 | */ |
| 681 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 682 | public void pcepUpdateMsgTest17() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 683 | |
| 684 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, |
| 685 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 686 | 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x05, //LSP object |
| 687 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 688 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 689 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 690 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 691 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 692 | 0x01, 0x01, 0x04, 0x00, |
| 693 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 694 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00 }; |
| 695 | |
| 696 | byte[] testupdateMsg = {0}; |
| 697 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 698 | buffer.writeBytes(updateMsg); |
| 699 | |
| 700 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 701 | PcepMessage message = null; |
| 702 | |
| 703 | message = reader.readFrom(buffer); |
| 704 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 705 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 706 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 707 | message.writeTo(buf); |
| 708 | testupdateMsg = buf.array(); |
| 709 | |
| 710 | int readLen = buf.writerIndex() - 0; |
| 711 | testupdateMsg = new byte[readLen]; |
| 712 | buf.readBytes(testupdateMsg, 0, readLen); |
| 713 | |
| 714 | assertThat(testupdateMsg, is(updateMsg)); |
| 715 | } |
| 716 | |
| 717 | /** |
| 718 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 719 | * ERO (IPv4SubObject, IPv4SubObject),Metric objects in PcUpd message. |
| 720 | */ |
| 721 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 722 | public void pcepUpdateMsgTest18() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 723 | |
| 724 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c, |
| 725 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 726 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 727 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 728 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 729 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 730 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 731 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 732 | 0x01, 0x01, 0x04, 0x00, |
| 733 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 734 | |
| 735 | byte[] testupdateMsg = {0}; |
| 736 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 737 | buffer.writeBytes(updateMsg); |
| 738 | |
| 739 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 740 | PcepMessage message = null; |
| 741 | |
| 742 | message = reader.readFrom(buffer); |
| 743 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 744 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 745 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 746 | message.writeTo(buf); |
| 747 | testupdateMsg = buf.array(); |
| 748 | |
| 749 | int readLen = buf.writerIndex() - 0; |
| 750 | testupdateMsg = new byte[readLen]; |
| 751 | buf.readBytes(testupdateMsg, 0, readLen); |
| 752 | |
| 753 | assertThat(testupdateMsg, is(updateMsg)); |
| 754 | } |
| 755 | |
| 756 | /** |
| 757 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 758 | * ERO (IPv4SubObject, IPv4SubObject),Metric-list objects in PcUpd message. |
| 759 | */ |
| 760 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 761 | public void pcepUpdateMsgTest19() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 762 | |
| 763 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, |
| 764 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 765 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 766 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 767 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 768 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 769 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 770 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 771 | 0x01, 0x01, 0x04, 0x00, |
| 772 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object |
| 773 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01 }; //Metric object |
| 774 | |
| 775 | byte[] testupdateMsg = {0}; |
| 776 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 777 | buffer.writeBytes(updateMsg); |
| 778 | |
| 779 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 780 | PcepMessage message = null; |
| 781 | |
| 782 | message = reader.readFrom(buffer); |
| 783 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 784 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 785 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 786 | message.writeTo(buf); |
| 787 | testupdateMsg = buf.array(); |
| 788 | |
| 789 | int readLen = buf.writerIndex() - 0; |
| 790 | testupdateMsg = new byte[readLen]; |
| 791 | buf.readBytes(testupdateMsg, 0, readLen); |
| 792 | |
| 793 | assertThat(testupdateMsg, is(updateMsg)); |
| 794 | } |
| 795 | |
| 796 | /** |
| 797 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 798 | * StatefulLspErrorCodeTlv),ERO (IPv4SubObject, IPv4SubObject),LSPA, Bandwidth, Metric objects in PcUpd message. |
| 799 | */ |
| 800 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 801 | public void pcepUpdateMsgTest20() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 802 | |
| 803 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80, |
| 804 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 805 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 806 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 807 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 808 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 809 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 810 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 811 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 812 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 813 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 814 | 0x01, 0x01, 0x04, 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, |
| 817 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 818 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 819 | |
| 820 | byte[] testupdateMsg = {0}; |
| 821 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 822 | buffer.writeBytes(updateMsg); |
| 823 | |
| 824 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 825 | PcepMessage message = null; |
| 826 | |
| 827 | message = reader.readFrom(buffer); |
| 828 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 829 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 830 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 831 | message.writeTo(buf); |
| 832 | testupdateMsg = buf.array(); |
| 833 | |
| 834 | int readLen = buf.writerIndex() - 0; |
| 835 | testupdateMsg = new byte[readLen]; |
| 836 | buf.readBytes(testupdateMsg, 0, readLen); |
| 837 | |
| 838 | assertThat(testupdateMsg, is(updateMsg)); |
| 839 | } |
| 840 | |
| 841 | /** |
| 842 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 843 | * ERO (IPv4SubObject, IPv4SubObject), Bandwidth objects in PcUpd message. |
| 844 | */ |
| 845 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 846 | public void pcepUpdateMsgTest21() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 847 | |
| 848 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, |
| 849 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 850 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 851 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 852 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 853 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 854 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 855 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 856 | 0x01, 0x01, 0x04, 0x00, |
| 857 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object |
| 858 | |
| 859 | byte[] testupdateMsg = {0}; |
| 860 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 861 | buffer.writeBytes(updateMsg); |
| 862 | |
| 863 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 864 | PcepMessage message = null; |
| 865 | |
| 866 | message = reader.readFrom(buffer); |
| 867 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 868 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 869 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 870 | message.writeTo(buf); |
| 871 | testupdateMsg = buf.array(); |
| 872 | |
| 873 | int readLen = buf.writerIndex() - 0; |
| 874 | testupdateMsg = new byte[readLen]; |
| 875 | buf.readBytes(testupdateMsg, 0, readLen); |
| 876 | |
| 877 | assertThat(testupdateMsg, is(updateMsg)); |
| 878 | } |
| 879 | |
| 880 | /** |
| 881 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 882 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth objects in PcUpd message. |
| 883 | */ |
| 884 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 885 | public void pcepUpdateMsgTest22() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 886 | |
| 887 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5C, |
| 888 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 889 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 890 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 891 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 892 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 893 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 894 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 895 | 0x01, 0x01, 0x04, 0x00, |
| 896 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 897 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 898 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object |
| 899 | |
| 900 | byte[] testupdateMsg = {0}; |
| 901 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 902 | buffer.writeBytes(updateMsg); |
| 903 | |
| 904 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 905 | PcepMessage message = null; |
| 906 | |
| 907 | message = reader.readFrom(buffer); |
| 908 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 909 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 910 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 911 | message.writeTo(buf); |
| 912 | testupdateMsg = buf.array(); |
| 913 | |
| 914 | int readLen = buf.writerIndex() - 0; |
| 915 | testupdateMsg = new byte[readLen]; |
| 916 | buf.readBytes(testupdateMsg, 0, readLen); |
| 917 | |
| 918 | assertThat(testupdateMsg, is(updateMsg)); |
| 919 | } |
| 920 | |
| 921 | /** |
| 922 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 923 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 924 | */ |
| 925 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 926 | public void pcepUpdateMsgTest23() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 927 | |
| 928 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, |
| 929 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 930 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 931 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 932 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 933 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 934 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 935 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 936 | 0x01, 0x01, 0x04, 0x00, |
| 937 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 938 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 939 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 940 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 941 | |
| 942 | byte[] testupdateMsg = {0}; |
| 943 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 944 | buffer.writeBytes(updateMsg); |
| 945 | |
| 946 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 947 | PcepMessage message = null; |
| 948 | |
| 949 | message = reader.readFrom(buffer); |
| 950 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 951 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 952 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 953 | message.writeTo(buf); |
| 954 | testupdateMsg = buf.array(); |
| 955 | |
| 956 | int readLen = buf.writerIndex() - 0; |
| 957 | testupdateMsg = new byte[readLen]; |
| 958 | buf.readBytes(testupdateMsg, 0, readLen); |
| 959 | |
| 960 | assertThat(testupdateMsg, is(updateMsg)); |
| 961 | } |
| 962 | |
| 963 | /** |
| 964 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv) |
| 965 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 966 | */ |
| 967 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 968 | public void pcepUpdateMsgTest24() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 969 | |
| 970 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, |
| 971 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 972 | 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 973 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 974 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 975 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 976 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 977 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 978 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 979 | 0x01, 0x01, 0x04, 0x00, |
| 980 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 981 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 982 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 983 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 984 | |
| 985 | byte[] testupdateMsg = {0}; |
| 986 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 987 | buffer.writeBytes(updateMsg); |
| 988 | |
| 989 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 990 | PcepMessage message = null; |
| 991 | |
| 992 | message = reader.readFrom(buffer); |
| 993 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 994 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 995 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 996 | message.writeTo(buf); |
| 997 | testupdateMsg = buf.array(); |
| 998 | |
| 999 | int readLen = buf.writerIndex() - 0; |
| 1000 | testupdateMsg = new byte[readLen]; |
| 1001 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1002 | |
| 1003 | assertThat(testupdateMsg, is(updateMsg)); |
| 1004 | } |
| 1005 | |
| 1006 | /** |
| 1007 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv) |
| 1008 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1009 | */ |
| 1010 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1011 | public void pcepUpdateMsgTest25() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1012 | |
| 1013 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, |
| 1014 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1015 | 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1016 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 1017 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 1018 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 1019 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1020 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1021 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1022 | 0x01, 0x01, 0x04, 0x00, |
| 1023 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1024 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1025 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1026 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1027 | |
| 1028 | byte[] testupdateMsg = {0}; |
| 1029 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1030 | buffer.writeBytes(updateMsg); |
| 1031 | |
| 1032 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1033 | PcepMessage message = null; |
| 1034 | |
| 1035 | message = reader.readFrom(buffer); |
| 1036 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1037 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1038 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1039 | message.writeTo(buf); |
| 1040 | testupdateMsg = buf.array(); |
| 1041 | |
| 1042 | int readLen = buf.writerIndex() - 0; |
| 1043 | testupdateMsg = new byte[readLen]; |
| 1044 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1045 | |
| 1046 | assertThat(testupdateMsg, is(updateMsg)); |
| 1047 | } |
| 1048 | |
| 1049 | /** |
| 1050 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 1051 | * StatefulLspErrorCodeTlv) ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, |
| 1052 | * Metric objects in PcUpd message. |
| 1053 | */ |
| 1054 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1055 | public void pcepUpdateMsgTest26() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1056 | |
| 1057 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78, |
| 1058 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1059 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1060 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 1061 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 1062 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 1063 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1064 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 1065 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1066 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1067 | 0x01, 0x01, 0x04, 0x00, |
| 1068 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1069 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1070 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1071 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1072 | |
| 1073 | byte[] testupdateMsg = {0}; |
| 1074 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1075 | buffer.writeBytes(updateMsg); |
| 1076 | |
| 1077 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1078 | PcepMessage message = null; |
| 1079 | |
| 1080 | message = reader.readFrom(buffer); |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1081 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1082 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1083 | message.writeTo(buf); |
| 1084 | testupdateMsg = buf.array(); |
| 1085 | |
| 1086 | int readLen = buf.writerIndex() - 0; |
| 1087 | testupdateMsg = new byte[readLen]; |
| 1088 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1089 | |
| 1090 | assertThat(testupdateMsg, is(updateMsg)); |
| 1091 | } |
| 1092 | |
| 1093 | /** |
| 1094 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, |
| 1095 | * StatefulLspErrorCodeTlv) ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, |
| 1096 | * Metric objects in PcUpd message. |
| 1097 | */ |
| 1098 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1099 | public void pcepUpdateMsgTest27() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1100 | |
| 1101 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78, |
| 1102 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1103 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1104 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 1105 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 1106 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 1107 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1108 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 1109 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1110 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1111 | 0x01, 0x01, 0x04, 0x00, |
| 1112 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1113 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1114 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1115 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1116 | |
| 1117 | byte[] testupdateMsg = {0}; |
| 1118 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1119 | buffer.writeBytes(updateMsg); |
| 1120 | |
| 1121 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1122 | PcepMessage message = null; |
| 1123 | |
| 1124 | message = reader.readFrom(buffer); |
| 1125 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1126 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1127 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1128 | message.writeTo(buf); |
| 1129 | testupdateMsg = buf.array(); |
| 1130 | |
| 1131 | int readLen = buf.writerIndex() - 0; |
| 1132 | testupdateMsg = new byte[readLen]; |
| 1133 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1134 | |
| 1135 | assertThat(testupdateMsg, is(updateMsg)); |
| 1136 | } |
| 1137 | |
| 1138 | /** |
| 1139 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, |
| 1140 | * SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), |
| 1141 | * LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1142 | */ |
| 1143 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1144 | public void pcepUpdateMsgTest28() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1145 | |
| 1146 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80, |
| 1147 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1148 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1149 | 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1150 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 1151 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 1152 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 1153 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1154 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 1155 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1156 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1157 | 0x01, 0x01, 0x04, 0x00, |
| 1158 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1159 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1160 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1161 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1162 | |
| 1163 | byte[] testupdateMsg = {0}; |
| 1164 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1165 | buffer.writeBytes(updateMsg); |
| 1166 | |
| 1167 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1168 | PcepMessage message = null; |
| 1169 | |
| 1170 | message = reader.readFrom(buffer); |
| 1171 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1172 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1173 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1174 | message.writeTo(buf); |
| 1175 | testupdateMsg = buf.array(); |
| 1176 | |
| 1177 | int readLen = buf.writerIndex() - 0; |
| 1178 | testupdateMsg = new byte[readLen]; |
| 1179 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1180 | |
| 1181 | assertThat(testupdateMsg, is(updateMsg)); |
| 1182 | } |
| 1183 | |
| 1184 | /** |
| 1185 | * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), |
| 1186 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1187 | */ |
| 1188 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1189 | public void pcepUpdateMsgTest29() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1190 | |
| 1191 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, |
| 1192 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1193 | 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1194 | 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv |
| 1195 | (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, |
| 1196 | (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, |
| 1197 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1198 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1199 | 0x01, 0x01, 0x04, 0x00, |
| 1200 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1201 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1202 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1203 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1204 | |
| 1205 | byte[] testupdateMsg = {0}; |
| 1206 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1207 | buffer.writeBytes(updateMsg); |
| 1208 | |
| 1209 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1210 | PcepMessage message = null; |
| 1211 | |
| 1212 | message = reader.readFrom(buffer); |
| 1213 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1214 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1215 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1216 | message.writeTo(buf); |
| 1217 | testupdateMsg = buf.array(); |
| 1218 | |
| 1219 | int readLen = buf.writerIndex() - 0; |
| 1220 | testupdateMsg = new byte[readLen]; |
| 1221 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1222 | |
| 1223 | assertThat(testupdateMsg, is(updateMsg)); |
| 1224 | } |
| 1225 | |
| 1226 | /** |
| 1227 | * This test case checks for SRP, LSP, |
| 1228 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1229 | */ |
| 1230 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1231 | public void pcepUpdateMsgTest30() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1232 | |
| 1233 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, |
| 1234 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1235 | 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1236 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1237 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1238 | 0x01, 0x01, 0x04, 0x00, |
| 1239 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1240 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1241 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1242 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object |
| 1243 | |
| 1244 | byte[] testupdateMsg = {0}; |
| 1245 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1246 | buffer.writeBytes(updateMsg); |
| 1247 | |
| 1248 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1249 | PcepMessage message = null; |
| 1250 | |
| 1251 | message = reader.readFrom(buffer); |
| 1252 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1253 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1254 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1255 | message.writeTo(buf); |
| 1256 | testupdateMsg = buf.array(); |
| 1257 | |
| 1258 | int readLen = buf.writerIndex() - 0; |
| 1259 | testupdateMsg = new byte[readLen]; |
| 1260 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1261 | |
| 1262 | assertThat(testupdateMsg, is(updateMsg)); |
| 1263 | } |
| 1264 | |
| 1265 | /** |
| 1266 | * This test case checks for SRP, LSP (StatefulLspErrorCodeTlv), |
| 1267 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1268 | */ |
| 1269 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1270 | public void pcepUpdateMsgTest31() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1271 | |
| 1272 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, |
| 1273 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1274 | 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1275 | 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv |
| 1276 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1277 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1278 | 0x01, 0x01, 0x04, 0x00, |
| 1279 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1280 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1281 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1282 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1283 | |
| 1284 | byte[] testupdateMsg = {0}; |
| 1285 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1286 | buffer.writeBytes(updateMsg); |
| 1287 | |
| 1288 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1289 | PcepMessage message = null; |
| 1290 | |
| 1291 | message = reader.readFrom(buffer); |
| 1292 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1293 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1294 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1295 | message.writeTo(buf); |
| 1296 | testupdateMsg = buf.array(); |
| 1297 | |
| 1298 | int readLen = buf.writerIndex() - 0; |
| 1299 | testupdateMsg = new byte[readLen]; |
| 1300 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1301 | |
| 1302 | assertThat(testupdateMsg, is(updateMsg)); |
| 1303 | } |
| 1304 | |
| 1305 | /** |
| 1306 | * This test case checks for SRP, LSP, |
| 1307 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1308 | */ |
| 1309 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1310 | public void pcepUpdateMsgTest32() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1311 | |
| 1312 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, |
| 1313 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1314 | 0x20, 0x10, 0x00, 0x8, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1315 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1316 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1317 | 0x01, 0x01, 0x04, 0x00, |
| 1318 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1319 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1320 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1321 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1322 | |
| 1323 | byte[] testupdateMsg = {0}; |
| 1324 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1325 | buffer.writeBytes(updateMsg); |
| 1326 | |
| 1327 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1328 | PcepMessage message = null; |
| 1329 | |
| 1330 | message = reader.readFrom(buffer); |
| 1331 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1332 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1333 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1334 | message.writeTo(buf); |
| 1335 | testupdateMsg = buf.array(); |
| 1336 | |
| 1337 | int readLen = buf.writerIndex() - 0; |
| 1338 | testupdateMsg = new byte[readLen]; |
| 1339 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1340 | |
| 1341 | assertThat(testupdateMsg, is(updateMsg)); |
| 1342 | } |
| 1343 | |
| 1344 | /** |
| 1345 | * This test case checks for SRP, LSP (SymbolicPathNameTlv), |
| 1346 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1347 | */ |
| 1348 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1349 | public void pcepUpdateMsgTest33() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1350 | |
| 1351 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, |
| 1352 | 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1353 | 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1354 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1355 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1356 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1357 | 0x01, 0x01, 0x04, 0x00, |
| 1358 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1359 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1360 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1361 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1362 | |
| 1363 | byte[] testupdateMsg = {0}; |
| 1364 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1365 | buffer.writeBytes(updateMsg); |
| 1366 | |
| 1367 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1368 | PcepMessage message = null; |
| 1369 | |
| 1370 | message = reader.readFrom(buffer); |
| 1371 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1372 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1373 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1374 | message.writeTo(buf); |
| 1375 | testupdateMsg = buf.array(); |
| 1376 | |
| 1377 | int readLen = buf.writerIndex() - 0; |
| 1378 | testupdateMsg = new byte[readLen]; |
| 1379 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1380 | |
| 1381 | assertThat(testupdateMsg, is(updateMsg)); |
| 1382 | } |
| 1383 | |
| 1384 | /** |
| 1385 | * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), |
| 1386 | * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. |
| 1387 | */ |
| 1388 | @Test |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 1389 | public void pcepUpdateMsgTest34() throws PcepParseException, PcepOutOfBoundMessageException { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1390 | |
| 1391 | byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64, |
| 1392 | 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object |
| 1393 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1394 | 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object |
| 1395 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv |
| 1396 | 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object |
| 1397 | 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, |
| 1398 | 0x01, 0x01, 0x04, 0x00, |
| 1399 | 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object |
| 1400 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, |
| 1401 | 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object |
| 1402 | 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object |
| 1403 | |
| 1404 | byte[] testupdateMsg = {0}; |
| 1405 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 1406 | buffer.writeBytes(updateMsg); |
| 1407 | |
| 1408 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 1409 | PcepMessage message = null; |
| 1410 | |
| 1411 | message = reader.readFrom(buffer); |
| 1412 | |
Sho SHIMIZU | e090a42 | 2015-09-04 17:35:49 -0700 | [diff] [blame] | 1413 | assertThat(message, instanceOf(PcepUpdateMsg.class)); |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1414 | ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); |
| 1415 | message.writeTo(buf); |
| 1416 | testupdateMsg = buf.array(); |
| 1417 | |
| 1418 | int readLen = buf.writerIndex() - 0; |
| 1419 | testupdateMsg = new byte[readLen]; |
| 1420 | buf.readBytes(testupdateMsg, 0, readLen); |
| 1421 | |
| 1422 | assertThat(testupdateMsg, is(updateMsg)); |
| 1423 | } |
| 1424 | } |