2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.openflowjava.protocol.impl.core.connection;
10 import static org.mockito.Mockito.when;
11 import io.netty.channel.Channel;
12 import io.netty.channel.ChannelPipeline;
13 import java.net.InetSocketAddress;
14 import org.junit.Assert;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.mockito.Mock;
18 import org.mockito.MockitoAnnotations;
24 public class ConnectionAdapterFactoryImplTest {
26 @Mock ChannelPipeline channnelPipe;
27 @Mock Channel channel;
28 @Mock InetSocketAddress address;
31 public void startUp(){
32 MockitoAnnotations.initMocks(this);
33 when(channel.pipeline()).thenReturn(channnelPipe);
38 final ConnectionAdapterFactoryImpl connAdapterFactory = new ConnectionAdapterFactoryImpl();
39 final ConnectionFacade connFacade = connAdapterFactory.createConnectionFacade(channel, address, true);
40 Assert.assertNotNull("Wrong - ConnectionFacade has not created.", connFacade);
41 Assert.assertEquals("Wrong - diffrence between channel.isOpen() and ConnectionFacade.isAlive()", channel.isOpen(), connFacade.isAlive());