Remove trailing whitespace
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / core / connection / ConnectionAdapterFactoryImplTest.java
1 /*
2  * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowjava.protocol.impl.core.connection;
9
10 import static org.mockito.Mockito.when;
11 import io.netty.channel.Channel;
12 import io.netty.channel.ChannelPipeline;
13
14 import java.net.InetSocketAddress;
15
16 import org.mockito.Mock;
17 import org.mockito.MockitoAnnotations;
18 import org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionAdapterFactoryImpl;
19 import org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionFacade;
20 import org.junit.Assert;
21 import org.junit.Before;
22 import org.junit.Test;
23 /**
24  *
25  * @author madamjak
26  *
27  */
28 public class ConnectionAdapterFactoryImplTest {
29
30     @Mock ChannelPipeline channnelPipe;
31     @Mock Channel channel;
32     @Mock InetSocketAddress address;
33
34     @Before
35     public void startUp(){
36         MockitoAnnotations.initMocks(this);
37         when(channel.pipeline()).thenReturn(channnelPipe);
38     }
39
40     @Test
41     public void test(){
42         ConnectionAdapterFactoryImpl connAdapterFactory = new ConnectionAdapterFactoryImpl();
43         ConnectionFacade connFacade = connAdapterFactory.createConnectionFacade(channel, address);
44         Assert.assertNotNull("Wrong - ConnectionFacade has not created.", connFacade);
45         Assert.assertEquals("Wrong - diffrence between channel.isOpen() and ConnectionFacade.isAlive()", channel.isOpen(), connFacade.isAlive());
46     }
47 }