use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project bgpcep by opendaylight.
the class AbstractPCEPSessionTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
this.receivedMsgs = new ArrayList<>();
doAnswer(invocation -> {
final Object[] args = invocation.getArguments();
AbstractPCEPSessionTest.this.receivedMsgs.add((Notification) args[0]);
return this.channelFuture;
}).when(this.clientListener).writeAndFlush(any(Notification.class));
doReturn(null).when(this.channelFuture).addListener(Mockito.any());
doReturn("TestingChannel").when(this.clientListener).toString();
doReturn(this.pipeline).when(this.clientListener).pipeline();
doReturn(this.pipeline).when(this.pipeline).replace(any(ChannelHandler.class), any(String.class), any(ChannelHandler.class));
doReturn(this.eventLoop).when(this.clientListener).eventLoop();
doNothing().when(this.statsRegistry).bind(any(), any());
doNothing().when(this.statsRegistry).unbind(any());
doReturn(null).when(this.eventLoop).schedule(any(Runnable.class), any(long.class), any(TimeUnit.class));
doReturn(true).when(this.clientListener).isActive();
final InetSocketAddress ra = new InetSocketAddress(this.testAddress, 4189);
doReturn(ra).when(this.clientListener).remoteAddress();
final InetSocketAddress la = new InetSocketAddress(this.testAddress, InetSocketAddressUtil.getRandomPort());
doReturn(la).when(this.clientListener).localAddress();
doReturn(mock(ChannelFuture.class)).when(this.clientListener).close();
doReturn(getDataBroker()).when(this.topologyDependencies).getDataBroker();
doReturn(this.statsRegistry).when(this.topologyDependencies).getStateRegistry();
@SuppressWarnings("unchecked") final T listenerFactory = (T) ((Class) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0]).newInstance();
doReturn(new IpAddress(new Ipv4Address(this.testAddress))).when(this.sessionConfig).getListenAddress();
doReturn(new PortNumber(4189)).when(this.sessionConfig).getListenPort();
doReturn(RPC_TIMEOUT).when(this.sessionConfig).getRpcTimeout();
doReturn(TEST_TOPOLOGY_ID).when(this.topology).getTopologyId();
doReturn(Collections.emptyList()).when(this.topology).getNode();
final PCEPTopologyConfiguration configDep = new PCEPTopologyConfiguration(this.sessionConfig, this.topology);
this.manager = new ServerSessionManager(this.topologyDependencies, listenerFactory, configDep);
startSessionManager();
this.neg = new DefaultPCEPSessionNegotiator(this.promise, this.clientListener, this.manager.getSessionListener(), (short) 1, 5, this.localPrefs);
this.topologyRpcs = new TopologyRPCs(this.manager);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmSctpDstDeserializer method addSctpDstValue.
private static void addSctpDstValue(ByteBuf input, MatchEntryBuilder builder) {
SctpDstCaseBuilder caseBuilder = new SctpDstCaseBuilder();
SctpDstBuilder sctpBuilder = new SctpDstBuilder();
sctpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
caseBuilder.setSctpDst(sctpBuilder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmTcpDstDeserializer method addTcpDstValue.
private static void addTcpDstValue(ByteBuf input, MatchEntryBuilder builder) {
TcpDstCaseBuilder caseBuilder = new TcpDstCaseBuilder();
TcpDstBuilder tcpBuilder = new TcpDstBuilder();
tcpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
caseBuilder.setTcpDst(tcpBuilder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmUdpSrcDeserializer method addUdpSrcValue.
private static void addUdpSrcValue(ByteBuf input, MatchEntryBuilder builder) {
UdpSrcCaseBuilder caseBuilder = new UdpSrcCaseBuilder();
UdpSrcBuilder udpBuilder = new UdpSrcBuilder();
udpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
caseBuilder.setUdpSrc(udpBuilder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmInPortDeserializer method addInPortValue.
private static void addInPortValue(ByteBuf input, MatchEntryBuilder builder) {
InPortCaseBuilder caseBuilder = new InPortCaseBuilder();
InPortBuilder inPortBuilder = new InPortBuilder();
inPortBuilder.setPortNumber(new PortNumber(input.readUnsignedInt()));
caseBuilder.setInPort(inPortBuilder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
Aggregations