blob: b4678a84445d7d8abfb5c96e36cd6e5dc42f0932 [file] [log] [blame]
Dhruv Dhodyb5850122016-02-17 17:51:19 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Dhruv Dhodyb5850122016-02-17 17:51:19 +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.ospf.controller.impl;
17
18import org.jboss.netty.channel.ChannelPipeline;
19import org.junit.After;
20import org.junit.Before;
21import org.junit.Test;
22import org.onosproject.ospf.controller.area.OspfAreaImpl;
23import org.onosproject.ospf.controller.area.OspfInterfaceImpl;
24
25import static org.hamcrest.CoreMatchers.*;
26import static org.hamcrest.MatcherAssert.assertThat;
27
28/**
29 * Unit test class for OspfPipelineFactory.
30 */
31public class OspfPipelineFactoryTest {
32
33 private OspfPipelineFactory ospfPipelineFactory;
34 private ChannelPipeline channelPipeline;
35
36 @Before
37 public void setUp() throws Exception {
38 ospfPipelineFactory = new OspfPipelineFactory(new Controller(), new OspfAreaImpl(), new OspfInterfaceImpl());
39
40 }
41
42 @After
43 public void tearDown() throws Exception {
44 ospfPipelineFactory = null;
45 channelPipeline = null;
46 }
47
48 /**
49 * Tests getPipeline() method.
50 */
51 @Test
52 public void testGetPipeline() throws Exception {
53 channelPipeline = ospfPipelineFactory.getPipeline();
54 assertThat(channelPipeline, is(notNullValue()));
55 }
56
57 /**
58 * Tests releaseExternalResources() method.
59 */
60 @Test
61 public void testReleaseExternalResources() throws Exception {
62 ospfPipelineFactory.releaseExternalResources();
63 assertThat(channelPipeline, is(nullValue()));
64 }
65}