Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Add test for generated code checking list of dependencies."
[controller.git]
/
opendaylight
/
netconf
/
netconf-impl
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
netconf
/
impl
/
NetconfDispatcherImplTest.java
diff --git
a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
index 233fffda024a30deedcd2bd9ad5a9a343ea327c7..0ecc1cb38324ede5b3443706a071a68a3d21a9dc 100644
(file)
--- a/
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
+++ b/
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
@@
-8,26
+8,30
@@
package org.opendaylight.controller.netconf.impl;
package org.opendaylight.controller.netconf.impl;
-import java.lang.management.ManagementFactory;
-import java.net.InetSocketAddress;
-
-import javax.net.ssl.SSLContext;
-
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.util.HashedWheelTimer;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
import org.junit.Test;
import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
-import com.google.common.base.Optional;
-
-import io.netty.channel.ChannelFuture;
-import io.netty.util.HashedWheelTimer;
+import java.lang.management.ManagementFactory;
+import java.net.InetSocketAddress;
public class NetconfDispatcherImplTest {
public class NetconfDispatcherImplTest {
- @Test
- public void test() throws Exception {
+ private EventLoopGroup nettyGroup;
+ private NetconfServerDispatcher dispatch;
+ private DefaultCommitNotificationProducer commitNot;
+
+ @Before
+ public void setUp() throws Exception {
+ nettyGroup = new NioEventLoopGroup();
-
DefaultCommitNotificationProducer
commitNot = new DefaultCommitNotificationProducer(
+ commitNot = new DefaultCommitNotificationProducer(
ManagementFactory.getPlatformMBeanServer());
NetconfOperationServiceFactoryListener factoriesListener = new NetconfOperationServiceFactoryListenerImpl();
ManagementFactory.getPlatformMBeanServer());
NetconfOperationServiceFactoryListener factoriesListener = new NetconfOperationServiceFactoryListenerImpl();
@@
-36,14
+40,23
@@
public class NetconfDispatcherImplTest {
new HashedWheelTimer(), factoriesListener, idProvider);
NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory(
new HashedWheelTimer(), factoriesListener, idProvider);
NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory(
- factoriesListener, commitNot, idProvider);
- NetconfServerDispatcher dispatch = new NetconfServerDispatcher(Optional.<SSLContext> absent(),
- serverNegotiatorFactory, listenerFactory);
+ factoriesListener, commitNot, idProvider, null);
+ NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer(serverNegotiatorFactory, listenerFactory);
- InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8333);
- ChannelFuture s = dispatch.createServer(addr);
+ dispatch = new NetconfServerDispatcher(
+ serverChannelInitializer, nettyGroup, nettyGroup);
+ }
+ @After
+ public void tearDown() throws Exception {
commitNot.close();
commitNot.close();
- dispatch.close();
+ nettyGroup.shutdownGracefully();
+ }
+
+ @Test
+ public void test() throws Exception {
+ InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8333);
+ ChannelFuture s = dispatch.createServer(addr);
+ s.get();
}
}
}
}