1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
\r
2 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
\r
4 import io.netty.buffer.ByteBuf;
\r
6 import java.math.BigInteger;
\r
8 import org.junit.Assert;
\r
9 import org.junit.Test;
\r
10 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
\r
11 import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
\r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
\r
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
\r
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregate;
\r
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyDesc;
\r
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyFlow;
\r
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyGroup;
\r
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyPortStats;
\r
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyQueue;
\r
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyTable;
\r
23 * @author timotej.kubas
\r
24 * @author michal.polkorab
\r
26 public class MultipartReplyMessageFactoryTest {
\r
29 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
33 ByteBuf bb = BufferHelper.buildBuffer("00 07 00 01 00 00 00 00 01 02 03 04");
\r
34 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
36 BufferHelper.checkHeaderV13(builtByFactory);
\r
38 Assert.assertEquals("Wrong type", 0x07, builtByFactory.getType().getIntValue());
\r
39 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
40 //Assert.assertArrayEquals("Wrong body", new byte[]{0x01, 0x02, 0x03, 0x04}, builtByFactory.getBody());
\r
44 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
47 public void testMultipartReplyDescBody(){
\r
48 final int DESC_STR_LEN = 256;
\r
49 final int SERIAL_NUM_LEN = 32;
\r
50 ByteBuf bb = BufferHelper.buildBuffer("00 00 00 01 00 00 00 00");
\r
52 String mfrDesc = "Manufacturer description";
\r
53 byte[] mfrDescBytes = new byte[256];
\r
54 mfrDescBytes = mfrDesc.getBytes();
\r
55 bb.writeBytes(mfrDescBytes);
\r
56 ByteBufUtils.padBuffer((DESC_STR_LEN - mfrDescBytes.length), bb);
\r
58 String hwDesc = "Hardware description";
\r
59 byte[] hwDescBytes = new byte[256];
\r
60 hwDescBytes = hwDesc.getBytes();
\r
61 bb.writeBytes(hwDescBytes);
\r
62 ByteBufUtils.padBuffer((DESC_STR_LEN - hwDescBytes.length), bb);
\r
64 String swDesc = "Software description";
\r
65 byte[] swDescBytes = new byte[256];
\r
66 swDescBytes = swDesc.getBytes();
\r
67 bb.writeBytes(swDescBytes);
\r
68 ByteBufUtils.padBuffer((DESC_STR_LEN - swDescBytes.length), bb);
\r
70 String serialNum = "SN0123456789";
\r
71 byte[] serialNumBytes = new byte[32];
\r
72 serialNumBytes = serialNum.getBytes();
\r
73 bb.writeBytes(serialNumBytes);
\r
74 ByteBufUtils.padBuffer((SERIAL_NUM_LEN - serialNumBytes.length), bb);
\r
76 String dpDesc = "switch3 in room 3120";
\r
77 byte[] dpDescBytes = new byte[256];
\r
78 dpDescBytes = dpDesc.getBytes();
\r
79 bb.writeBytes(dpDescBytes);
\r
80 ByteBufUtils.padBuffer((DESC_STR_LEN - dpDescBytes.length), bb);
\r
82 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
84 BufferHelper.checkHeaderV13(builtByFactory);
\r
85 Assert.assertEquals("Wrong type", 0x00, builtByFactory.getType().getIntValue());
\r
86 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
87 MultipartReplyDesc message = (MultipartReplyDesc) builtByFactory.getMultipartReplyBody();
\r
88 Assert.assertEquals("Wrong mfrDesc", "Manufacturer description", message.getMfrDesc());
\r
89 Assert.assertEquals("Wrong hwDesc", "Hardware description", message.getHwDesc());
\r
90 Assert.assertEquals("Wrong swDesc", "Software description", message.getSwDesc());
\r
91 Assert.assertEquals("Wrong serialNum", "SN0123456789", message.getSerialNum());
\r
92 Assert.assertEquals("Wrong dpDesc", "switch3 in room 3120", message.getDpDesc());
\r
96 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
99 public void testMultipartReplyFlowBody(){
\r
100 ByteBuf bb = BufferHelper.buildBuffer("00 01 00 01 00 00 00 00 "+
\r
103 "00 00 00 09 "+//durationSec
\r
104 "00 00 00 07 "+//durationNsec
\r
105 "00 0C "+//priority
\r
106 "00 0E "+//idleTimeout
\r
107 "00 0F "+//hardTimeout
\r
109 "00 00 00 00 "+//pad_02
\r
110 "00 01 01 01 01 01 01 01 "+//cookie
\r
111 "00 01 01 01 01 01 01 01 "+//packetCount
\r
112 "00 01 01 01 01 01 01 01"//byteCount
\r
115 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
117 BufferHelper.checkHeaderV13(builtByFactory);
\r
118 Assert.assertEquals("Wrong type", 0x01, builtByFactory.getType().getIntValue());
\r
119 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
120 MultipartReplyFlow message = (MultipartReplyFlow) builtByFactory.getMultipartReplyBody();
\r
121 Assert.assertEquals("Wrong tableId", 8, message.getFlowStats().get(0).getTableId().intValue());
\r
122 Assert.assertEquals("Wrong durationSec", 9, message.getFlowStats().get(0).getDurationSec().intValue());
\r
123 Assert.assertEquals("Wrong durationNsec", 7, message.getFlowStats().get(0).getDurationNsec().intValue());
\r
124 Assert.assertEquals("Wrong priority", 12, message.getFlowStats().get(0).getPriority().intValue());
\r
125 Assert.assertEquals("Wrong idleTimeOut", 14, message.getFlowStats().get(0).getIdleTimeout().intValue());
\r
126 Assert.assertEquals("Wrong hardTimeOut", 15, message.getFlowStats().get(0).getHardTimeout().intValue());
\r
127 Assert.assertEquals("Wrong flags", new FlowModFlags(true, false, true, false, true),
\r
128 message.getFlowStats().get(0).getFlags());
\r
129 Assert.assertEquals("Wrong cookie",
\r
130 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
131 message.getFlowStats().get(0).getCookie());
\r
132 Assert.assertEquals("Wrong packetCount",
\r
133 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
134 message.getFlowStats().get(0).getPacketCount());
\r
135 Assert.assertEquals("Wrong byteCount",
\r
136 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
137 message.getFlowStats().get(0).getByteCount());
\r
141 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
144 public void testMultipartReplyAggregateBody(){
\r
145 ByteBuf bb = BufferHelper.buildBuffer("00 02 00 01 00 00 00 00 "+
\r
146 "00 01 01 01 01 01 01 01 "+//packetCount
\r
147 "00 01 01 01 01 01 01 01 "+//byteCount
\r
148 "00 00 00 08 "+//flowCount
\r
152 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
154 BufferHelper.checkHeaderV13(builtByFactory);
\r
155 Assert.assertEquals("Wrong type", 0x02, builtByFactory.getType().getIntValue());
\r
156 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
157 MultipartReplyAggregate message = (MultipartReplyAggregate) builtByFactory.getMultipartReplyBody();
\r
158 Assert.assertEquals("Wrong packetCount",
\r
159 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
160 message.getPacketCount());
\r
161 Assert.assertEquals("Wrong byteCount",
\r
162 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
163 message.getByteCount());
\r
164 Assert.assertEquals("Wrong flowCount",
\r
166 message.getFlowCount().intValue());
\r
170 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
173 public void testMultipartReplyTableBody(){
\r
174 ByteBuf bb = BufferHelper.buildBuffer("00 03 00 01 00 00 00 00 "+
\r
177 "00 00 00 10 "+//activeCount
\r
178 "00 01 01 01 01 01 01 01 "+//lookupCount
\r
179 "00 01 01 01 01 01 01 01"//matchedCount
\r
182 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
184 BufferHelper.checkHeaderV13(builtByFactory);
\r
185 Assert.assertEquals("Wrong type", 0x03, builtByFactory.getType().getIntValue());
\r
186 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
188 MultipartReplyTable message = (MultipartReplyTable) builtByFactory.getMultipartReplyBody();
\r
189 Assert.assertEquals("Wrong tableId", 8, message.getTableStats().get(0).getTableId().intValue());
\r
190 Assert.assertEquals("Wrong activeCount", 16, message.getTableStats().get(0).getActiveCount().longValue());
\r
191 Assert.assertEquals("Wrong lookupCount",
\r
192 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
193 message.getTableStats().get(0).getLookupCount());
\r
194 Assert.assertEquals("Wrong matchedCount",
\r
195 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
196 message.getTableStats().get(0).getMatchedCount());
\r
200 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
203 public void testMultipartReplyPortStatsBody(){
\r
204 ByteBuf bb = BufferHelper.buildBuffer("00 04 00 01 00 00 00 00 "+
\r
205 "00 00 00 FF "+//portNo
\r
206 "00 00 00 00 "+//pad
\r
207 "00 01 01 01 01 01 01 01 "+//rxPackets
\r
208 "00 02 02 02 02 02 02 02 "+//txPackets
\r
209 "00 02 03 02 03 02 03 02 "+//rxBytes
\r
210 "00 02 03 02 03 02 03 02 "+//txBytes
\r
211 "00 02 03 02 03 02 03 02 "+//rxDropped
\r
212 "00 02 03 02 03 02 03 02 "+//txDropped
\r
213 "00 02 03 02 03 02 03 02 "+//rxErrors
\r
214 "00 02 03 02 03 02 03 02 "+//txErrors
\r
215 "00 02 03 02 03 02 03 02 "+//rxFrameErr
\r
216 "00 02 03 02 03 02 03 02 "+//rxOverErr
\r
217 "00 02 03 02 03 02 03 02 "+//rxCrcErr
\r
218 "00 02 03 02 03 02 03 02 "+//collisions
\r
219 "00 00 00 02 "+//durationSec
\r
220 "00 00 00 04"//durationNsec
\r
223 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
225 BufferHelper.checkHeaderV13(builtByFactory);
\r
226 Assert.assertEquals("Wrong type", 0x04, builtByFactory.getType().getIntValue());
\r
227 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
229 MultipartReplyPortStats message = (MultipartReplyPortStats) builtByFactory.getMultipartReplyBody();
\r
231 Assert.assertEquals("Wrong portNo", 255, message.getPortStats().get(0).getPortNo().intValue());
\r
232 Assert.assertEquals("Wrong rxPackets",
\r
233 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
234 message.getPortStats().get(0).getRxPackets());
\r
235 Assert.assertEquals("Wrong txPackets",
\r
236 new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}),
\r
237 message.getPortStats().get(0).getTxPackets());
\r
238 Assert.assertEquals("Wrong rxBytes",
\r
239 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
240 message.getPortStats().get(0).getRxBytes());
\r
241 Assert.assertEquals("Wrong txBytes",
\r
242 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
243 message.getPortStats().get(0).getTxBytes());
\r
244 Assert.assertEquals("Wrong rxDropped",
\r
245 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
246 message.getPortStats().get(0).getRxDropped());
\r
247 Assert.assertEquals("Wrong txDropped",
\r
248 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
249 message.getPortStats().get(0).getTxDropped());
\r
250 Assert.assertEquals("Wrong rxErrors",
\r
251 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
252 message.getPortStats().get(0).getRxErrors());
\r
253 Assert.assertEquals("Wrong txErrors",
\r
254 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
255 message.getPortStats().get(0).getTxErrors());
\r
256 Assert.assertEquals("Wrong rxFrameErr",
\r
257 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
258 message.getPortStats().get(0).getRxFrameErr());
\r
259 Assert.assertEquals("Wrong rxOverErr",
\r
260 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
261 message.getPortStats().get(0).getRxOverErr());
\r
262 Assert.assertEquals("Wrong rxCrcErr",
\r
263 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
264 message.getPortStats().get(0).getRxCrcErr());
\r
265 Assert.assertEquals("Wrong collisions",
\r
266 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
267 message.getPortStats().get(0).getCollisions());
\r
268 Assert.assertEquals("Wrong durationSec", 2, message.getPortStats().get(0).getDurationSec().intValue());
\r
269 Assert.assertEquals("Wrong durationNsec", 4, message.getPortStats().get(0).getDurationNsec().intValue());
\r
273 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
276 public void testMultipartReplyQueueBody(){
\r
277 ByteBuf bb = BufferHelper.buildBuffer("00 05 00 01 00 00 00 00 "+
\r
278 "00 00 00 FF "+//portNo
\r
279 "00 00 00 10 "+//queueId
\r
280 "00 02 03 02 03 02 03 02 "+//txBytes
\r
281 "00 02 02 02 02 02 02 02 "+//txPackets
\r
282 "00 02 03 02 03 02 03 02 "+//txErrors
\r
283 "00 00 00 02 "+//durationSec
\r
284 "00 00 00 04"//durationNsec
\r
287 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
289 BufferHelper.checkHeaderV13(builtByFactory);
\r
290 Assert.assertEquals("Wrong type", 0x05, builtByFactory.getType().getIntValue());
\r
291 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
293 MultipartReplyQueue message = (MultipartReplyQueue) builtByFactory.getMultipartReplyBody();
\r
295 Assert.assertEquals("Wrong portNo", 255, message.getQueueStats().get(0).getPortNo().intValue());
\r
296 Assert.assertEquals("Wrong queueId", 16, message.getQueueStats().get(0).getQueueId().intValue());
\r
297 Assert.assertEquals("Wrong txBytes",
\r
298 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
299 message.getQueueStats().get(0).getTxBytes());
\r
300 Assert.assertEquals("Wrong txPackets",
\r
301 new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}),
\r
302 message.getQueueStats().get(0).getTxPackets());
\r
303 Assert.assertEquals("Wrong txErrors",
\r
304 new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}),
\r
305 message.getQueueStats().get(0).getTxErrors());
\r
306 Assert.assertEquals("Wrong durationSec", 2, message.getQueueStats().get(0).getDurationSec().intValue());
\r
307 Assert.assertEquals("Wrong durationNsec", 4, message.getQueueStats().get(0).getDurationNsec().intValue());
\r
311 * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO
\r
314 public void testMultipartReplyGroupBody(){
\r
315 ByteBuf bb = BufferHelper.buildBuffer("00 06 00 01 00 00 00 00 "+
\r
318 "00 00 00 10 "+//groupId
\r
319 "00 00 00 12 "+//refCount
\r
320 "00 00 00 00 "+//pad2
\r
321 "00 01 01 01 01 01 01 01 "+//packetCount
\r
322 "00 01 01 01 01 01 01 01 "+//byteCount
\r
323 "00 00 00 08 "+//durationSec
\r
324 "00 00 00 09 "+//durationNsec
\r
325 "00 01 01 01 01 01 01 01 "+//packetCountBucket
\r
326 "00 01 01 01 01 01 01 01 "+//byteCountBucket
\r
327 "00 02 02 02 02 02 02 02 "+//packetCountBucket_2
\r
328 "00 02 02 02 02 02 02 02 "+//byteCountBucket_2
\r
329 "00 48 "+//length_2
\r
331 "00 00 00 10 "+//groupId_2
\r
332 "00 00 00 12 "+//refCount_2
\r
333 "00 00 00 00 "+//pad2.2
\r
334 "00 01 01 01 01 01 01 01 "+//packetCount_2
\r
335 "00 01 01 01 01 01 01 01 "+//byteCount_2
\r
336 "00 00 00 08 "+//durationSec_2
\r
337 "00 00 00 09 "+//durationNsec_2
\r
338 "00 01 01 01 01 01 01 01 "+//packetCountBucket_1.2
\r
339 "00 01 01 01 01 01 01 01 "+//byteCountBucket_1.2
\r
340 "00 02 02 02 02 02 02 02 "+//packetCountBucket_2.2
\r
341 "00 02 02 02 02 02 02 02"//byteCountBucket_2.2
\r
344 MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
\r
346 BufferHelper.checkHeaderV13(builtByFactory);
\r
347 Assert.assertEquals("Wrong type", 0x06, builtByFactory.getType().getIntValue());
\r
348 Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE());
\r
350 MultipartReplyGroup message = (MultipartReplyGroup) builtByFactory.getMultipartReplyBody();
\r
352 Assert.assertEquals("Wrong groupId", 16, message.getGroupStats().get(0).getGroupId().intValue());
\r
353 Assert.assertEquals("Wrong refCount", 18, message.getGroupStats().get(0).getRefCount().intValue());
\r
354 Assert.assertEquals("Wrong packetCount",
\r
355 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
356 message.getGroupStats().get(0).getPacketCount());
\r
357 Assert.assertEquals("Wrong byteCount",
\r
358 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
359 message.getGroupStats().get(0).getByteCount());
\r
360 Assert.assertEquals("Wrong durationSec", 8, message.getGroupStats().get(0).getDurationSec().intValue());
\r
361 Assert.assertEquals("Wrong durationNsec", 9, message.getGroupStats().get(0).getDurationNsec().intValue());
\r
362 Assert.assertEquals("Wrong packetCountBucket",
\r
363 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
364 message.getGroupStats().get(0).getBucketStats().get(0).getPacketCount());
\r
365 Assert.assertEquals("Wrong byteCountBucket",
\r
366 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
367 message.getGroupStats().get(0).getBucketStats().get(0).getByteCount());
\r
368 Assert.assertEquals("Wrong packetCountBucket_2",
\r
369 new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}),
\r
370 message.getGroupStats().get(0).getBucketStats().get(1).getPacketCount());
\r
371 Assert.assertEquals("Wrong byteCountBucket_2",
\r
372 new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}),
\r
373 message.getGroupStats().get(0).getBucketStats().get(1).getByteCount());
\r
375 Assert.assertEquals("Wrong groupId_2", 16, message.getGroupStats().get(1).getGroupId().intValue());
\r
376 Assert.assertEquals("Wrong refCount_2", 18, message.getGroupStats().get(1).getRefCount().intValue());
\r
377 Assert.assertEquals("Wrong packetCount_2",
\r
378 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
379 message.getGroupStats().get(1).getPacketCount());
\r
380 Assert.assertEquals("Wrong byteCount_2",
\r
381 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
382 message.getGroupStats().get(1).getByteCount());
\r
383 Assert.assertEquals("Wrong durationSec_2", 8, message.getGroupStats().get(1).getDurationSec().intValue());
\r
384 Assert.assertEquals("Wrong durationNsec_2", 9, message.getGroupStats().get(1).getDurationNsec().intValue());
\r
385 Assert.assertEquals("Wrong packetCountBucket_1.2",
\r
386 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
387 message.getGroupStats().get(1).getBucketStats().get(0).getPacketCount());
\r
388 Assert.assertEquals("Wrong byteCountBucket_1.2",
\r
389 new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}),
\r
390 message.getGroupStats().get(1).getBucketStats().get(0).getByteCount());
\r
391 Assert.assertEquals("Wrong packetCountBucket_2.2",
\r
392 new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}),
\r
393 message.getGroupStats().get(1).getBucketStats().get(1).getPacketCount());
\r
394 Assert.assertEquals("Wrong byteCountBucket_2.2",
\r
395 new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}),
\r
396 message.getGroupStats().get(1).getBucketStats().get(1).getByteCount());
\r