2 * Copyright (c) 2013 Cisco Systems, Inc. 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
9 package org.opendaylight.controller.netconf.impl;
11 import java.lang.management.ManagementFactory;
12 import java.net.InetSocketAddress;
14 import javax.net.ssl.SSLContext;
16 import org.junit.Test;
17 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
18 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
20 import com.google.common.base.Optional;
22 import io.netty.channel.ChannelFuture;
23 import io.netty.util.HashedWheelTimer;
25 public class NetconfDispatcherImplTest {
28 public void test() throws Exception {
30 DefaultCommitNotificationProducer commitNot = new DefaultCommitNotificationProducer(
31 ManagementFactory.getPlatformMBeanServer());
32 NetconfOperationServiceFactoryListener factoriesListener = new NetconfOperationServiceFactoryListenerImpl();
34 SessionIdProvider idProvider = new SessionIdProvider();
35 NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
36 new HashedWheelTimer(), factoriesListener, idProvider);
38 NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory(
39 factoriesListener, commitNot, idProvider);
40 NetconfServerDispatcher dispatch = new NetconfServerDispatcher(Optional.<SSLContext> absent(),
41 serverNegotiatorFactory, listenerFactory);
43 InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8333);
44 ChannelFuture s = dispatch.createServer(addr);