blob: 08507f571d97d9295ab06e44fc01fdc5e6404373 [file] [log] [blame]
chidambar babu344dc812016-05-02 19:13:10 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
chidambar babu344dc812016-05-02 19:13:10 +05303 *
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 */
16package org.onosproject.isis.controller.impl;
17
18import org.easymock.EasyMock;
19import org.junit.After;
20import org.junit.Before;
21import org.junit.Test;
22import org.onosproject.isis.controller.IsisInterface;
23import org.onosproject.isis.controller.IsisProcess;
24
25import java.util.List;
26
27import static org.hamcrest.CoreMatchers.is;
28import static org.hamcrest.CoreMatchers.nullValue;
29import static org.junit.Assert.assertThat;
30
31/**
32 * Unit test class for DefaultIsisProcess.
33 */
34public class DefaultIsisProcessTest {
35
36 private final String processId = "1";
37 private IsisProcess isisProcess;
38 private String result;
sunish vk4b5ce002016-05-09 20:18:35 +053039 private IsisProcess defaultIsisProcess;
chidambar babu344dc812016-05-02 19:13:10 +053040 private IsisInterface isisInterface;
41 private List<IsisInterface> isisInterfaceList;
42 private List<IsisInterface> result1;
43
44 @Before
45 public void setUp() throws Exception {
46 isisProcess = new DefaultIsisProcess();
47 isisInterface = EasyMock.createNiceMock(DefaultIsisInterface.class);
sunish vk4b5ce002016-05-09 20:18:35 +053048 defaultIsisProcess = new DefaultIsisProcess();
chidambar babu344dc812016-05-02 19:13:10 +053049 }
50
51 @After
52 public void tearDown() throws Exception {
53 isisProcess = null;
54 }
55
56 /**
57 * Tests processId() setter method.
58 */
59 @Test
60 public void testProcessId() throws Exception {
61 isisProcess.setProcessId(processId);
62 result = isisProcess.processId();
63 assertThat(result, is(processId));
64 }
65
66 /**
67 * Tests processId() getter method.
68 */
69 @Test
70 public void testSetProcessId() throws Exception {
71 isisProcess.setProcessId(processId);
72 result = isisProcess.processId();
73 assertThat(result, is(processId));
74 }
75
76 /**
77 * Tests isisInterfaceList() setter method.
78 */
79 @Test
80 public void testIsisInterfaceList() throws Exception {
81 isisProcess.setIsisInterfaceList(isisInterfaceList);
82 result1 = isisProcess.isisInterfaceList();
83 assertThat(result1, is(nullValue()));
84 }
85
86 /**
87 * Tests isisInterfaceList() getter method.
88 */
89 @Test
90 public void testSetIsisInterfaceList() throws Exception {
91 isisProcess.setIsisInterfaceList(isisInterfaceList);
92 result1 = isisProcess.isisInterfaceList();
93 assertThat(result1, is(nullValue()));
94 }
sunish vk4b5ce002016-05-09 20:18:35 +053095}