blob: 2570e66b8bc309e648d07950930f749c7bc2283f [file] [log] [blame]
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +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.types;
17
18import com.google.common.testing.EqualsTester;
19import org.junit.Test;
20
21import java.util.LinkedList;
22import java.util.List;
23
24/**
25 * Test of the LocalNodeDescriptorsTlv.
26 */
27public class LocalNodeDescriptorsTlvTest {
28
29 private final AutonomousSystemSubTlv baAutoSysTlvRawValue1 = new AutonomousSystemSubTlv(1);
30 private final BgpLsIdentifierSubTlv baBgplsIdRawValue1 = new BgpLsIdentifierSubTlv(1);
31
32 private final AutonomousSystemSubTlv baAutoSysTlvRawValue2 = new AutonomousSystemSubTlv(2);
33 private final BgpLsIdentifierSubTlv baBgplsIdRawValue2 = new BgpLsIdentifierSubTlv(2);
34
35 private final List<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
36 private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
37 private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
38
39 private final List<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
40 private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
41 private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
42
43 private final LocalNodeDescriptorsTlv tlv1 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
44 private final LocalNodeDescriptorsTlv sameAstlv1 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
45 private final LocalNodeDescriptorsTlv tlv2 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
46
47 @Test
48 public void basics() {
49 new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
50 }
51}