Search in sources :

Example 6 with FlowCapableNodeConnectorBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder in project openflowplugin by opendaylight.

the class PortConvertorTest method testtoPortDescwithAllParameters.

/**
 * test of {@link PortConvertor#toPortDesc(FlowCapablePort , short)}.
 */
@Test
public void testtoPortDescwithAllParameters() {
    State state = new StateBuilder().setBlocked(false).setLinkDown(false).setLive(false).build();
    FlowCapableNodeConnectorBuilder flowCapableNodeConnectorBuilder = new FlowCapableNodeConnectorBuilder();
    flowCapableNodeConnectorBuilder.setAdvertisedFeatures(features);
    flowCapableNodeConnectorBuilder.setConfiguration(config);
    flowCapableNodeConnectorBuilder.setCurrentFeature(features);
    flowCapableNodeConnectorBuilder.setCurrentSpeed(null);
    flowCapableNodeConnectorBuilder.setHardwareAddress(new MacAddress(DEFAULT_MAC_ADDRESS));
    flowCapableNodeConnectorBuilder.setMaximumSpeed(null);
    flowCapableNodeConnectorBuilder.setName("foo");
    flowCapableNodeConnectorBuilder.setPeerFeatures(features);
    flowCapableNodeConnectorBuilder.setPortNumber(new PortNumberUni(42L));
    flowCapableNodeConnectorBuilder.setState(state);
    flowCapableNodeConnectorBuilder.setSupported(features);
    final Ports portsOut = PortConvertor.toPortDesc(flowCapableNodeConnectorBuilder.build(), EncodeConstants.OF13_VERSION_ID);
    PortsBuilder portsB = new PortsBuilder();
    portsB.setAdvertisedFeatures(portf31);
    portsB.setConfig(config31);
    portsB.setCurrentFeatures(portf31);
    portsB.setCurrSpeed(null);
    portsB.setHwAddr(new MacAddress(DEFAULT_MAC_ADDRESS));
    portsB.setMaxSpeed(null);
    portsB.setName("foo");
    portsB.setPeerFeatures(portf31);
    portsB.setPortNo(42L);
    portsB.setState(new PortState(false, false, false));
    portsB.setSupportedFeatures(portf31);
    Assert.assertEquals(portsB.build(), portsOut);
}
Also used : FlowCapableNodeConnectorBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder) PortState(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortState) State(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State) PortState(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortState) PortNumberUni(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni) StateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.StateBuilder) Ports(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.desc._case.multipart.reply.port.desc.Ports) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) PortsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.desc._case.multipart.reply.port.desc.PortsBuilder) Test(org.junit.Test)

Aggregations

FlowCapableNodeConnectorBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder)6 State (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State)3 StateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.StateBuilder)3 FlowCapableNodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector)2 PortConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig)2 PortNumberUni (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni)2 NodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector)2 Test (org.junit.Test)1 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)1 PortState (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState)1 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)1 NodeConnectorBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder)1 NodeConnectorKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey)1 PortState (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortState)1 PortStatusMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage)1 Ports (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.desc._case.multipart.reply.port.desc.Ports)1 PortsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.desc._case.multipart.reply.port.desc.PortsBuilder)1 FlowCapableNodeConnectorStatisticsDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsDataBuilder)1