blob: 6f84a5a0e330995e4db045e3a68bf635940d4d26 [file] [log] [blame]
Charles Chan64c2dfd2018-07-24 11:58:08 -07001/*
2 * Copyright 2018-present Open Networking Foundation
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 *
16 */
17
18package org.onlab.packet.lacp;
19
20import com.google.common.io.Resources;
21import org.junit.Before;
22import org.junit.Test;
23
24import static org.junit.Assert.assertArrayEquals;
25
26public class LacpTerminatorTlvTest {
27 private static final String PACKET_DUMP = "terminatorinfo.bin";
28
29 private byte[] data;
30
31 static final LacpTerminatorTlv TERMINATOR_TLV = new LacpTerminatorTlv();
32
33 @Before
34 public void setUp() throws Exception {
35 data = Resources.toByteArray(LacpTerminatorTlvTest.class.getResource(PACKET_DUMP));
36 }
37
38 @Test
39 public void deserializer() throws Exception {
40 LacpTerminatorTlv lacpTerminatorTlv = LacpTerminatorTlv.deserializer().deserialize(data, 0, data.length);
41 }
42
43 @Test
44 public void serialize() {
45 assertArrayEquals(data, TERMINATOR_TLV.serialize());
46 }
47}