blob: 80b54f1ed0ec3414777cbae5158777a933f6715d [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
2// Copyright (c) 2011, 2012 Open Networking Foundation
3// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
4// This library was generated by the LoxiGen Compiler.
5// See the file LICENSE.txt which should have been included in the source distribution
6
7// Automatically generated by LOXI from template unit_test.java
8// Do not modify
9
10package org.projectfloodlight.openflow.protocol.ver13;
11
12import org.projectfloodlight.openflow.protocol.*;
13import org.projectfloodlight.openflow.protocol.action.*;
14import org.projectfloodlight.openflow.protocol.actionid.*;
15import org.projectfloodlight.openflow.protocol.bsntlv.*;
16import org.projectfloodlight.openflow.protocol.errormsg.*;
17import org.projectfloodlight.openflow.protocol.meterband.*;
18import org.projectfloodlight.openflow.protocol.instruction.*;
19import org.projectfloodlight.openflow.protocol.instructionid.*;
20import org.projectfloodlight.openflow.protocol.match.*;
21import org.projectfloodlight.openflow.protocol.oxm.*;
22import org.projectfloodlight.openflow.protocol.queueprop.*;
23import org.projectfloodlight.openflow.types.*;
24import org.projectfloodlight.openflow.util.*;
25import org.projectfloodlight.openflow.exceptions.*;
26import static org.junit.Assert.*;
27import java.util.Set;
28import org.junit.Test;
29import org.junit.Before;
30import org.jboss.netty.buffer.ChannelBuffer;
31import org.jboss.netty.buffer.ChannelBuffers;
32import org.hamcrest.CoreMatchers;
33
34
35
36public class OFBsnGentableSetBucketsSizeVer13Test {
37 OFFactory factory;
38
39 final static byte[] BSN_GENTABLE_SET_BUCKETS_SIZE_SERIALIZED =
40 new byte[] { 0x4, 0x4, 0x0, 0x18, 0x12, 0x34, 0x56, 0x78, 0x0, 0x5c, 0x16, (byte) 0xc7, 0x0, 0x0, 0x0, 0x32, 0x0, 0x14, 0x0, 0x0, 0x0, 0x11, 0x22, 0x33 };
41
42 @Before
43 public void setup() {
44 factory = OFFactoryVer13.INSTANCE;
45 }
46
47 // FIXME: No java stanza in test_data for this class. Add for more comprehensive unit testing
48
49 @Test
50 public void testReadWrite() throws Exception {
51 ChannelBuffer input = ChannelBuffers.copiedBuffer(BSN_GENTABLE_SET_BUCKETS_SIZE_SERIALIZED);
52
53 // FIXME should invoke the overall reader once implemented
54 OFBsnGentableSetBucketsSize bsnGentableSetBucketsSize = OFBsnGentableSetBucketsSizeVer13.READER.readFrom(input);
55 assertEquals(BSN_GENTABLE_SET_BUCKETS_SIZE_SERIALIZED.length, input.readerIndex());
56
57 // write message again
58 ChannelBuffer bb = ChannelBuffers.dynamicBuffer();
59 bsnGentableSetBucketsSize.writeTo(bb);
60 byte[] written = new byte[bb.readableBytes()];
61 bb.readBytes(written);
62
63 assertThat(written, CoreMatchers.equalTo(BSN_GENTABLE_SET_BUCKETS_SIZE_SERIALIZED));
64 }
65
66}