DongRyeol Cha | e0c98db | 2018-07-12 16:17:21 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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 | |
| 17 | package org.onlab.packet; |
| 18 | |
| 19 | import org.junit.Test; |
| 20 | |
| 21 | import static org.junit.Assert.assertEquals; |
| 22 | |
| 23 | /** |
| 24 | * Unit tests for the ONOSLLDP class. |
| 25 | */ |
| 26 | public class ONOSLLDPTest { |
| 27 | |
| 28 | private static final String DEVICE_ID = "of:c0a80a6e00000001"; |
| 29 | private static final ChassisId CHASSIS_ID = new ChassisId(67890); |
| 30 | private static final Integer PORT_NUMBER = 2; |
| 31 | private static final Integer PORT_NUMBER_2 = 98761234; |
| 32 | private static final String PORT_DESC = "Ethernet1"; |
| 33 | |
| 34 | private ONOSLLDP onoslldp = ONOSLLDP.onosLLDP(DEVICE_ID, CHASSIS_ID, PORT_NUMBER, PORT_DESC); |
| 35 | |
| 36 | /** |
| 37 | * Tests port number and getters. |
| 38 | */ |
| 39 | @Test |
| 40 | public void testPortNumber() throws Exception { |
| 41 | assertEquals("the value from constructor with getPort value is miss matched", |
| 42 | PORT_NUMBER, onoslldp.getPort()); |
| 43 | |
| 44 | onoslldp.setPortId(PORT_NUMBER_2); |
| 45 | assertEquals("the value from setPortId with getPort value is miss matched", |
| 46 | PORT_NUMBER_2, onoslldp.getPort()); |
| 47 | } |
| 48 | } |