Clean all unused and redundant imports in controller.
[controller.git] / opendaylight / netconf / netconf-impl / src / test / java / org / opendaylight / controller / netconf / impl / NetconfDispatcherImplTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. 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
9 package org.opendaylight.controller.netconf.impl;
10
11 import java.lang.management.ManagementFactory;
12 import java.net.InetSocketAddress;
13
14 import javax.net.ssl.SSLContext;
15
16 import org.junit.Test;
17 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
18 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
19
20 import com.google.common.base.Optional;
21
22 import io.netty.channel.ChannelFuture;
23 import io.netty.util.HashedWheelTimer;
24
25 public class NetconfDispatcherImplTest {
26
27     @Test
28     public void test() throws Exception {
29
30         DefaultCommitNotificationProducer commitNot = new DefaultCommitNotificationProducer(
31                 ManagementFactory.getPlatformMBeanServer());
32         NetconfOperationServiceFactoryListener factoriesListener = new NetconfOperationServiceFactoryListenerImpl();
33
34         SessionIdProvider idProvider = new SessionIdProvider();
35         NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
36                 new HashedWheelTimer(), factoriesListener, idProvider);
37
38         NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory(
39                 factoriesListener, commitNot, idProvider);
40         NetconfServerDispatcher dispatch = new NetconfServerDispatcher(Optional.<SSLContext> absent(),
41                 serverNegotiatorFactory, listenerFactory);
42
43         InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8333);
44         ChannelFuture s = dispatch.createServer(addr);
45
46         commitNot.close();
47         dispatch.close();
48     }
49 }