@Test public void testSendGetFeaturesToSwitch() { GetFeaturesOutput messageReply = new GetFeaturesOutputBuilder() .setVersion((short) EncodeConstants.OF13_VERSION_ID).build(); Future<RpcResult<GetFeaturesOutput>> reply = Futures .immediateFuture(RpcResultBuilder.success(messageReply).build()); Mockito.stub(connectionAdapter.getFeatures(Matchers.any(GetFeaturesInput.class))).toReturn(reply); Mockito.doNothing().when(connectionHandler).collectGetFeaturesOuput(reply, connectionAdapter); connectionHandler.sendGetFeaturesToSwitch((short) EncodeConstants.OF13_VERSION_ID, ShimSwitchConnectionHandlerImpl.DEFAULT_XID, connectionAdapter); Mockito.verify(connectionHandler).collectGetFeaturesOuput(reply, connectionAdapter); }
public void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid, final ConnectionAdapter connectionAdapter) { GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder(); featuresBuilder.setVersion(proposedVersion).setXid(xid); Future<RpcResult<GetFeaturesOutput>> featuresFuture = connectionAdapter.getFeatures(featuresBuilder.build()); collectGetFeaturesOuput(featuresFuture, connectionAdapter); }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid, final ConnectionAdapter connectionAdapter) { GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder(); featuresBuilder.setVersion(proposedVersion).setXid(xid); Future<RpcResult<GetFeaturesOutput>> featuresFuture = connectionAdapter.getFeatures(featuresBuilder.build()); collectGetFeaturesOuput(featuresFuture, connectionAdapter); } }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid, final ConnectionAdapter connectionAdapter) { GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder(); featuresBuilder.setVersion(proposedVersion).setXid(xid); Future<RpcResult<GetFeaturesOutput>> featuresFuture = connectionAdapter.getFeatures(featuresBuilder.build()); collectGetFeaturesOuput(featuresFuture, connectionAdapter); } ShimSwitchConnectionHandlerImpl(ZeroMQBaseConnector connector,
            NotificationPublishService _notificationProviderService); }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid, final ConnectionAdapter connectionAdapter) { GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder(); featuresBuilder.setVersion(proposedVersion).setXid(xid); Future<RpcResult<GetFeaturesOutput>> featuresFuture = connectionAdapter.getFeatures(featuresBuilder.build()); collectGetFeaturesOuput(featuresFuture, connectionAdapter); } ShimSwitchConnectionHandlerImpl(ZeroMQBaseConnector connector,
            NotificationPublishService _notificationProviderService); void setSwitchFeaturesUtil(SwitchFeaturesUtil featureUtil); void init(); ShimRelay createShimRelay(); ConnectionAdaptersRegistry createConnectionAdaptersRegistry(); @Override boolean accept(InetAddress arg0); @Override void onSwitchConnected(ConnectionAdapter connectionAdapter); void handshake(ConnectionAdapter connectionAdapter); @Override void onSwitchHelloMessage(long xid, Short version, ConnectionAdapter connectionAdapter); NodeUpdated nodeAdded(ConnectionAdapter connectionAdapter); static InstanceIdentifier<Node> identifierFromDatapathId(final BigInteger datapathId); static NodeKey nodeKeyFromDatapathId(final BigInteger datapathId); static NodeId nodeIdFromDatapathId(final BigInteger datapathId); byte getMaxOFSupportedProtocol(); List<Byte> getSupportedOFProtocols(); int getNumberOfSwitches(); Pair<Protocol, ProtocolVersions> getSupportedProtocol(); void setSupportedProtocol(byte version); @Override void onOpenFlowCoreMessage(Long datapathId, ByteBuf msg, int moduleId); @Override void onHelloCoreMessage(List<Pair<Protocol, ProtocolVersions>> requestedProtocols, int moduleId); void collectGetFeaturesOuput(Future<RpcResult<GetFeaturesOutput>> switchReply,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesOuputToCore(final Short proposedVersion, final int moduleId,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid,
            final ConnectionAdapter connectionAdapter); @Override void onSwitchDisconnected(ConnectionAdapter connectionAdapter); GetFeaturesOutput getFeaturesFromRegistry(ConnectionAdapter conn); }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid, final ConnectionAdapter connectionAdapter) { GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder(); featuresBuilder.setVersion(proposedVersion).setXid(xid); Future<RpcResult<GetFeaturesOutput>> featuresFuture = connectionAdapter.getFeatures(featuresBuilder.build()); collectGetFeaturesOuput(featuresFuture, connectionAdapter); } ShimSwitchConnectionHandlerImpl(ZeroMQBaseConnector connector,
            NotificationPublishService _notificationProviderService); void setSwitchFeaturesUtil(SwitchFeaturesUtil featureUtil); void init(); ShimRelay createShimRelay(); ConnectionAdaptersRegistry createConnectionAdaptersRegistry(); @Override boolean accept(InetAddress arg0); @Override void onSwitchConnected(ConnectionAdapter connectionAdapter); void handshake(ConnectionAdapter connectionAdapter); @Override void onSwitchHelloMessage(long xid, Short version, ConnectionAdapter connectionAdapter); NodeUpdated nodeAdded(ConnectionAdapter connectionAdapter); static InstanceIdentifier<Node> identifierFromDatapathId(final BigInteger datapathId); static NodeKey nodeKeyFromDatapathId(final BigInteger datapathId); static NodeId nodeIdFromDatapathId(final BigInteger datapathId); byte getMaxOFSupportedProtocol(); List<Byte> getSupportedOFProtocols(); int getNumberOfSwitches(); Pair<Protocol, ProtocolVersions> getSupportedProtocol(); void setSupportedProtocol(byte version); @Override void onOpenFlowCoreMessage(Long datapathId, ByteBuf msg, int moduleId); @Override void onHelloCoreMessage(List<Pair<Protocol, ProtocolVersions>> requestedProtocols, int moduleId); void collectGetFeaturesOuput(Future<RpcResult<GetFeaturesOutput>> switchReply,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesOuputToCore(final Short proposedVersion, final int moduleId,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid,
            final ConnectionAdapter connectionAdapter); @Override void onSwitchDisconnected(ConnectionAdapter connectionAdapter); GetFeaturesOutput getFeaturesFromRegistry(ConnectionAdapter conn); static final Long DEFAULT_XID; }