bharat saraswal | e2e7a00 | 2015-08-21 22:47:30 +0530 | [diff] [blame] | 1 | /*
|
| 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 | */
|
| 16 | package org.onosproject.pcepio;
|
| 17 |
|
| 18 | import org.junit.Test;
|
| 19 | import org.onosproject.pcepio.types.StatefulIPv4LspIdentidiersTlv;
|
| 20 |
|
| 21 | import com.google.common.testing.EqualsTester;
|
| 22 |
|
| 23 | public class StatefulIPv4LspIdentidiersTlvTest {
|
| 24 |
|
| 25 | private final int ipv4IngressAddress = 1;
|
| 26 | private final short lspId = 1;
|
| 27 | private final short tunnelId = 1;
|
| 28 | private final int extendedTunnelId = 1;
|
| 29 | private final int ipv4EgressAddress = 1;
|
| 30 |
|
| 31 | private final StatefulIPv4LspIdentidiersTlv tlv1 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress, lspId,
|
| 32 | tunnelId, extendedTunnelId, ipv4EgressAddress);
|
| 33 |
|
| 34 | private final int ipv4IngressAddress1 = 1;
|
| 35 | private final short lspId1 = 1;
|
| 36 | private final short tunnelId1 = 1;
|
| 37 | private final int extendedTunnelId1 = 1;
|
| 38 | private final int ipv4EgressAddress1 = 1;
|
| 39 |
|
| 40 | private final StatefulIPv4LspIdentidiersTlv tlv2 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress1, lspId1,
|
| 41 | tunnelId1, extendedTunnelId1, ipv4EgressAddress1);
|
| 42 |
|
| 43 | private final int ipv4IngressAddress2 = 2;
|
| 44 | private final short lspId2 = 2;
|
| 45 | private final short tunnelId2 = 2;
|
| 46 | private final int extendedTunnelId2 = 2;
|
| 47 | private final int ipv4EgressAddress2 = 2;
|
| 48 |
|
| 49 | private final StatefulIPv4LspIdentidiersTlv tlv3 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress2, lspId2,
|
| 50 | tunnelId2, extendedTunnelId2, ipv4EgressAddress2);
|
| 51 |
|
| 52 | @Test
|
| 53 | public void basics() {
|
| 54 | new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
|
| 55 |
|
| 56 | }
|
| 57 | }
|