blob: 46fc453ae964438e6fe782eebd8d597c28bb1e47 [file] [log] [blame]
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -07003 *
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 */
Sho SHIMIZU3559c312015-11-04 14:59:31 -080016package org.onosproject.pcepio.types;
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070017
18import com.google.common.testing.EqualsTester;
Sho SHIMIZU3559c312015-11-04 14:59:31 -080019import org.junit.Test;
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070020
Avantika-Huawei56c11842016-04-28 00:56:56 +053021/**
22 * Tests class StatefulIPv4LspIdentifiersTlv.
23 */
24public class StatefulIPv4LspIdentifiersTlvTest {
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070025
26 private final int ipv4IngressAddress = 1;
27 private final short lspId = 1;
28 private final short tunnelId = 1;
29 private final int extendedTunnelId = 1;
30 private final int ipv4EgressAddress = 1;
31
Avantika-Huawei56c11842016-04-28 00:56:56 +053032 private final StatefulIPv4LspIdentifiersTlv tlv1 = StatefulIPv4LspIdentifiersTlv.of(ipv4IngressAddress, lspId,
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070033 tunnelId, extendedTunnelId, ipv4EgressAddress);
34
35 private final int ipv4IngressAddress1 = 1;
36 private final short lspId1 = 1;
37 private final short tunnelId1 = 1;
38 private final int extendedTunnelId1 = 1;
39 private final int ipv4EgressAddress1 = 1;
40
Avantika-Huawei56c11842016-04-28 00:56:56 +053041 private final StatefulIPv4LspIdentifiersTlv tlv2 = StatefulIPv4LspIdentifiersTlv.of(ipv4IngressAddress1, lspId1,
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070042 tunnelId1, extendedTunnelId1, ipv4EgressAddress1);
43
44 private final int ipv4IngressAddress2 = 2;
45 private final short lspId2 = 2;
46 private final short tunnelId2 = 2;
47 private final int extendedTunnelId2 = 2;
48 private final int ipv4EgressAddress2 = 2;
49
Avantika-Huawei56c11842016-04-28 00:56:56 +053050 private final StatefulIPv4LspIdentifiersTlv tlv3 = StatefulIPv4LspIdentifiersTlv.of(ipv4IngressAddress2, lspId2,
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070051 tunnelId2, extendedTunnelId2, ipv4EgressAddress2);
52
Avantika-Huawei56c11842016-04-28 00:56:56 +053053 /**
54 * Tests equality of objects of class StatefulIPv4LspIdentifiersTlv.
55 */
Sho SHIMIZUaf1dffc2015-09-04 15:56:07 -070056 @Test
57 public void basics() {
58 new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
59
60 }
61}