blob: 25c7b642128a847bfb8e70eca5be2c8f9c99899b [file] [log] [blame]
Mahesh Poojary S5afd06c2015-08-21 14:51:04 +05301/*
2 * Copyright 2014 Open Networking Laboratory
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 */
16package org.onosproject.pcepio;
17
18import com.google.common.testing.EqualsTester;
19
20import org.junit.Test;
21import org.onosproject.pcepio.types.LinkNameTlv;
22
23/**
24 * Test of the LinkNameTlv.
25 */
26public class LinkNameTlvTest {
27 private final byte[] rawValue1 = new byte[] {0x01, 0x00};
28 private final byte[] rawValue2 = new byte[] {0x02, 0x00};
29
30 private final LinkNameTlv tlv1 = new LinkNameTlv(rawValue1, (short) rawValue1.length);
31 private final LinkNameTlv sameAsTlv1 = LinkNameTlv.of(tlv1.getValue(), tlv1.getLength());
32 private final LinkNameTlv tlv2 = new LinkNameTlv(rawValue2, (short) 0);
33 private final LinkNameTlv sameAsTlv2 = new LinkNameTlv(rawValue2, (short) rawValue2.length);
34
35 @Test
36 public void basics() {
37 new EqualsTester()
38 .addEqualityGroup(tlv1, sameAsTlv1)
39 .addEqualityGroup(tlv2, sameAsTlv2)
40 .testEquals();
41 }
42}