blob: b2494b54b969a407037bcefddade05a91a26f008 [file] [log] [blame]
DongRyeol Chae0c98db2018-07-12 16:17:21 +09001/*
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
17package org.onlab.packet;
18
19import org.junit.Test;
20
21import static org.junit.Assert.assertEquals;
22
23/**
24 * Unit tests for the ONOSLLDP class.
25 */
26public 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";
Samuel Jero31e16f52018-09-21 10:34:28 -040033 private static final String TEST_SECRET = "test";
DongRyeol Chae0c98db2018-07-12 16:17:21 +090034
Samuel Jero31e16f52018-09-21 10:34:28 -040035 private ONOSLLDP onoslldp = ONOSLLDP.onosSecureLLDP(DEVICE_ID, CHASSIS_ID, PORT_NUMBER, PORT_DESC, TEST_SECRET);
DongRyeol Chae0c98db2018-07-12 16:17:21 +090036
37 /**
38 * Tests port number and getters.
39 */
40 @Test
41 public void testPortNumber() throws Exception {
42 assertEquals("the value from constructor with getPort value is miss matched",
43 PORT_NUMBER, onoslldp.getPort());
44
45 onoslldp.setPortId(PORT_NUMBER_2);
46 assertEquals("the value from setPortId with getPort value is miss matched",
47 PORT_NUMBER_2, onoslldp.getPort());
48 }
49}