blob: a4e7fee1948aac8f947992730fe22fed478ba9ef [file] [log] [blame]
Mahesh Poojary S5afd06c2015-08-21 14:51:04 +05301/*
2 * Copyright 2015 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 java.util.LinkedList;
19
20import org.junit.Test;
21import org.onosproject.pcepio.types.IPv4TERouterIdOfLocalNodeTlv;
22import org.onosproject.pcepio.types.NodeFlagBitsTlv;
23import org.onosproject.pcepio.types.PcepValueType;
24import org.onosproject.pcepio.types.TENodeAttributesTlv;
25
26import com.google.common.testing.EqualsTester;
27
28/**
29 * Test case for TE Node Attribute tlv.
30 */
31public class TENodeAttributesTlvTest {
32
33 NodeFlagBitsTlv nodeFlagBitsTlv1 = new NodeFlagBitsTlv((byte) 10);
34 IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv1 = new IPv4TERouterIdOfLocalNodeTlv((int) 0x01010101);;
35 LinkedList<PcepValueType> llNodeAttributesSubTLVs1 = new LinkedList<PcepValueType>();
36 LinkedList<PcepValueType> llNodeAttributesSubTLVs2 = new LinkedList<PcepValueType>();
37 LinkedList<PcepValueType> llNodeAttributesSubTLVs3 = new LinkedList<PcepValueType>();
38
39 boolean b = llNodeAttributesSubTLVs1.add(nodeFlagBitsTlv1);
40
41 boolean c = llNodeAttributesSubTLVs2.add(nodeFlagBitsTlv1);
42 boolean d = llNodeAttributesSubTLVs3.add(iPv4TERouterIdOfLocalNodeTlv1);
43
44 final TENodeAttributesTlv tlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLVs1);
45 final TENodeAttributesTlv tlv2 = TENodeAttributesTlv.of(llNodeAttributesSubTLVs2);
46 final TENodeAttributesTlv tlv3 = TENodeAttributesTlv.of(llNodeAttributesSubTLVs3);
47
48 @Test
49 public void basics() {
50 new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
51 }
52
53}