Search in sources :

Example 11 with PortConfigV10

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10 in project openflowplugin by opendaylight.

the class PortConvertorTest method testtoPortModInputwithAllParameters.

/**
 * test of {@link PortConvertor#convert(Port, VersionConvertorData)} }.
 */
@Test
public void testtoPortModInputwithAllParameters() {
    PortBuilder portBld = new PortBuilder();
    portBld.setAdvertisedFeatures(features);
    portBld.setConfiguration(config);
    portBld.setPortNumber(new PortNumberUni(42L));
    portBld.setHardwareAddress(new MacAddress(DEFAULT_MAC_ADDRESS));
    VersionConvertorData data = new VersionConvertorData(OFConstants.OFP_VERSION_1_3);
    final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
    Optional<PortModInput> portOutOptional = convertorManager.convert(portBld.build(), data);
    final PortModInput portOut = portOutOptional.orElse(PortConvertor.defaultResult(OFConstants.OFP_VERSION_1_3));
    PortConfigV10 portConfV10 = new PortConfigV10(false, false, false, false, true, true, false);
    PortModInputBuilder portModInputBld = new PortModInputBuilder();
    portModInputBld.setConfig(config31);
    portModInputBld.setMask(configMask31);
    portModInputBld.setPortNo(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber(42L));
    portModInputBld.setHwAddress(new MacAddress(DEFAULT_MAC_ADDRESS));
    portModInputBld.setAdvertise(portf31);
    portModInputBld.setConfigV10(portConfV10);
    portModInputBld.setMaskV10(portConfMaskV10);
    portModInputBld.setAdvertiseV10(new PortFeaturesV10(null, null, null, null, null, null, null, true, null, null, null, null));
    portModInputBld.setVersion((short) EncodeConstants.OF13_VERSION_ID);
    Assert.assertEquals(portModInputBld.build(), portOut);
}
Also used : PortConfigV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10) PortFeaturesV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10) PortModInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput) PortNumberUni(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) VersionConvertorData(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData) PortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder) PortModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInputBuilder) Test(org.junit.Test)

Aggregations

PortConfigV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10)11 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)10 Test (org.junit.Test)8 PortFeaturesV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10)8 ByteBuf (io.netty.buffer.ByteBuf)6 PortStateV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortStateV10)6 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)3 PortModInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput)3 PortModInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInputBuilder)3 PhyPort (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPort)3 PortConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfig)2 GetFeaturesOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput)2 PortStatusMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage)2 PortStatusMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder)2 ArrayList (java.util.ArrayList)1 VersionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData)1 PortNumberUni (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni)1 PortBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder)1 ActionTypeV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionTypeV10)1 CapabilitiesV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.CapabilitiesV10)1