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.*;
18 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
19 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
21 import com.google.common.base.Optional;
23 import io.netty.channel.ChannelFuture;
24 import io.netty.util.HashedWheelTimer;
26 public class NetconfDispatcherImplTest {
29 public void test() throws Exception {
31 DefaultCommitNotificationProducer commitNot = new DefaultCommitNotificationProducer(
32 ManagementFactory.getPlatformMBeanServer());
33 NetconfOperationServiceFactoryListener factoriesListener = new NetconfOperationServiceFactoryListenerImpl();
35 SessionIdProvider idProvider = new SessionIdProvider();
36 NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
37 new HashedWheelTimer(), factoriesListener, idProvider);
39 NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory(
40 factoriesListener, commitNot, idProvider);
41 NetconfServerDispatcher dispatch = new NetconfServerDispatcher(Optional.<SSLContext> absent(),
42 serverNegotiatorFactory, listenerFactory);
44 InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8333);
45 ChannelFuture s = dispatch.createServer(addr);