Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 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 | */ |
Sho SHIMIZU | 3559c31 | 2015-11-04 14:59:31 -0800 | [diff] [blame] | 16 | package org.onosproject.pcepio.types; |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 17 | |
| 18 | import com.google.common.testing.EqualsTester; |
Sho SHIMIZU | 3559c31 | 2015-11-04 14:59:31 -0800 | [diff] [blame] | 19 | import org.junit.Test; |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 20 | |
Avantika-Huawei | 56c1184 | 2016-04-28 00:56:56 +0530 | [diff] [blame^] | 21 | /** |
| 22 | * Tests class StatefulIPv4LspIdentifiersTlv. |
| 23 | */ |
| 24 | public class StatefulIPv4LspIdentifiersTlvTest { |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 25 | |
| 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-Huawei | 56c1184 | 2016-04-28 00:56:56 +0530 | [diff] [blame^] | 32 | private final StatefulIPv4LspIdentifiersTlv tlv1 = StatefulIPv4LspIdentifiersTlv.of(ipv4IngressAddress, lspId, |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 33 | 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-Huawei | 56c1184 | 2016-04-28 00:56:56 +0530 | [diff] [blame^] | 41 | private final StatefulIPv4LspIdentifiersTlv tlv2 = StatefulIPv4LspIdentifiersTlv.of(ipv4IngressAddress1, lspId1, |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 42 | 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-Huawei | 56c1184 | 2016-04-28 00:56:56 +0530 | [diff] [blame^] | 50 | private final StatefulIPv4LspIdentifiersTlv tlv3 = StatefulIPv4LspIdentifiersTlv.of(ipv4IngressAddress2, lspId2, |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 51 | tunnelId2, extendedTunnelId2, ipv4EgressAddress2); |
| 52 | |
Avantika-Huawei | 56c1184 | 2016-04-28 00:56:56 +0530 | [diff] [blame^] | 53 | /** |
| 54 | * Tests equality of objects of class StatefulIPv4LspIdentifiersTlv. |
| 55 | */ |
Sho SHIMIZU | af1dffc | 2015-09-04 15:56:07 -0700 | [diff] [blame] | 56 | @Test |
| 57 | public void basics() { |
| 58 | new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals(); |
| 59 | |
| 60 | } |
| 61 | } |