use of org.opendaylight.netconf.api.NetconfSessionPreferences in project netconf by opendaylight.
the class Netconf539Test method setUp.
@Before
public void setUp() throws Exception {
channel = new EmbeddedChannel();
channel.pipeline().addLast(AbstractChannelInitializer.NETCONF_MESSAGE_ENCODER, new ChannelInboundHandlerAdapter());
channel.pipeline().addLast(AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, new NetconfXMLToHelloMessageDecoder());
channel.pipeline().addLast(NETCONF_MESSAGE_FRAME_ENCODER, FramingMechanismHandlerFactory.createHandler(FramingMechanism.EOM));
channel.pipeline().addLast(NETCONF_MESSAGE_AGGREGATOR, new NetconfEOMAggregator());
final NetconfHelloMessage serverHello = NetconfHelloMessage.createClientHello(Collections.singleton(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1), Optional.empty());
negotiator = new TestSessionNegotiator(new NetconfSessionPreferences(serverHello), promise, channel, new HashedWheelTimer(), listener, 100L);
}
use of org.opendaylight.netconf.api.NetconfSessionPreferences in project netconf by opendaylight.
the class AbstractNetconfSessionNegotiatorTest method setUp.
@Before
public void setUp() {
channel = new EmbeddedChannel();
xmlToHello = new NetconfXMLToHelloMessageDecoder();
channel.pipeline().addLast(AbstractChannelInitializer.NETCONF_MESSAGE_ENCODER, new ChannelInboundHandlerAdapter());
channel.pipeline().addLast(AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, xmlToHello);
channel.pipeline().addLast(NETCONF_MESSAGE_FRAME_ENCODER, FramingMechanismHandlerFactory.createHandler(FramingMechanism.EOM));
channel.pipeline().addLast(NETCONF_MESSAGE_AGGREGATOR, new NetconfEOMAggregator());
hello = NetconfHelloMessage.createClientHello(Set.of(), Optional.empty());
helloBase11 = NetconfHelloMessage.createClientHello(Set.of(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1), Optional.empty());
prefs = new NetconfSessionPreferences(helloBase11);
doReturn(promise).when(promise).setFailure(any());
negotiator = new TestSessionNegotiator(prefs, promise, channel, timer, listener, 100L);
}
Aggregations