blob: cc2c5fb939740b9077e1b4837d18ade708117e6e [file] [log] [blame]
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +05303 *
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 case for Remote TE Node Descriptors tlv.
26 */
27public class RemoteNodeDescriptorsTlvTest {
28
29 private final AutonomousSystemSubTlv autonomousSystemTlv1 = new AutonomousSystemSubTlv(10);
30 private final BgpLsIdentifierSubTlv bGPLSidentifierTlv1 = new BgpLsIdentifierSubTlv(20);
31
32 private final AutonomousSystemSubTlv autonomousSystemTlv2 = new AutonomousSystemSubTlv(20);
33 private final BgpLsIdentifierSubTlv bGPLSidentifierTlv2 = new BgpLsIdentifierSubTlv(30);
34
35 private final List<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
36 private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
37 private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
38
39 private final List<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
40 private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
41 private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
42
43 private final RemoteNodeDescriptorsTlv tlv1 = RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
44 private final RemoteNodeDescriptorsTlv sameAsTlv1 =
45 RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
46 private final RemoteNodeDescriptorsTlv tlv2 = RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
47
48 @Test
49 public void basics() {
50 new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
51 }
52
53}