blob: 617dece4369393bc0f178c75969a0c72e44356ff [file] [log] [blame]
chidambar babu344dc812016-05-02 19:13:10 +05301/*
2 * Copyright 2016-present 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 */
16package org.onosproject.isis.controller.impl.lsdb;
17
18import org.junit.After;
19import org.junit.Before;
20import org.junit.Test;
21import org.onosproject.isis.controller.IsisInterface;
22import org.onosproject.isis.controller.impl.DefaultIsisInterface;
23
24import static org.hamcrest.CoreMatchers.is;
25import static org.hamcrest.CoreMatchers.notNullValue;
26import static org.junit.Assert.assertThat;
27
28/**
29 * Unit test case for DefaultLspWrapper.
30 */
31public class DefaultLspWrapperTest {
32
33 private DefaultLspWrapper defaultLspWrapper;
34 private String processing = "processing";
35 private String result;
36 private int result1;
37 private IsisInterface isisInterface;
38 private IsisInterface result2;
39
40 @Before
41 public void setUp() throws Exception {
42 defaultLspWrapper = new DefaultLspWrapper();
43 isisInterface = new DefaultIsisInterface();
44 }
45
46 @After
47 public void tearDown() throws Exception {
48 defaultLspWrapper = null;
49 }
50
51 /**
52 * Tests lspProcessing() getter method.
53 */
54 @Test
55 public void testLspProcessing() throws Exception {
56 defaultLspWrapper.setLspProcessing(processing);
57 result = defaultLspWrapper.lspProcessing();
58 assertThat(result, is(notNullValue()));
59 }
60
61 /**
62 * Tests lspProcessing() setter method.
63 */
64 @Test
65 public void testSetLspProcessing() throws Exception {
66 defaultLspWrapper.setLspProcessing(processing);
67 result = defaultLspWrapper.lspProcessing();
68 assertThat(result, is(notNullValue()));
69 }
70
71 /**
72 * Tests lspAgeReceived() getter method.
73 */
74 @Test
75 public void testLspAgeReceived() throws Exception {
76 defaultLspWrapper.setLspAgeReceived(1);
77 result1 = defaultLspWrapper.lspAgeReceived();
78 assertThat(result1, is(notNullValue()));
79 }
80
81 /**
82 * Tests lspAgeReceived() setter method.
83 */
84 @Test
85 public void testSetLspAgeReceived() throws Exception {
86 defaultLspWrapper.setLspAgeReceived(1);
87 result1 = defaultLspWrapper.lspAgeReceived();
88 assertThat(result1, is(notNullValue()));
89 }
90
91 /**
92 * Tests lspAgeReceived() getter method.
93 */
94 @Test
95 public void testIsisInterface() throws Exception {
96 defaultLspWrapper.setIsisInterface(isisInterface);
97 result2 = defaultLspWrapper.isisInterface();
98 assertThat(result2, is(notNullValue()));
99 }
100
101 /**
102 * Tests lspAgeReceived() getter method.
103 */
104 @Test
105 public void testSetIsisInterface() throws Exception {
106 defaultLspWrapper.setIsisInterface(isisInterface);
107 result2 = defaultLspWrapper.isisInterface();
108 assertThat(result2, is(notNullValue()));
109 }
110
111}