blob: 328d5b790ce2560b65f277053363697202fe0942 [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.ver10;
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 OFActionBsnSetTunnelDstVer10Test {
37 OFActions factory;
38
39 final static byte[] ACTION_BSN_SET_TUNNEL_DST_SERIALIZED =
40 new byte[] { (byte) 0xff, (byte) 0xff, 0x0, 0x10, 0x0, 0x5c, 0x16, (byte) 0xc7, 0x0, 0x0, 0x0, 0x2, 0x12, 0x34, 0x56, 0x78 };
41
42 @Before
43 public void setup() {
44 factory = OFActionsVer10.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(ACTION_BSN_SET_TUNNEL_DST_SERIALIZED);
52
53 // FIXME should invoke the overall reader once implemented
54 OFActionBsnSetTunnelDst actionBsnSetTunnelDst = OFActionBsnSetTunnelDstVer10.READER.readFrom(input);
55 assertEquals(ACTION_BSN_SET_TUNNEL_DST_SERIALIZED.length, input.readerIndex());
56
57 // write message again
58 ChannelBuffer bb = ChannelBuffers.dynamicBuffer();
59 actionBsnSetTunnelDst.writeTo(bb);
60 byte[] written = new byte[bb.readableBytes()];
61 bb.readBytes(written);
62
63 assertThat(written, CoreMatchers.equalTo(ACTION_BSN_SET_TUNNEL_DST_SERIALIZED));
64 }
65
66}