import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
/**
* Unit tests for OF10FlowModInputMessageFactory.
BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
MatchV10Builder matchBuilder = new MatchV10Builder();
matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
- matchBuilder.setNwSrcMask((short) 0);
- matchBuilder.setNwDstMask((short) 0);
- matchBuilder.setInPort(58);
+ matchBuilder.setNwSrcMask(Uint8.ZERO);
+ matchBuilder.setNwDstMask(Uint8.ZERO);
+ matchBuilder.setInPort(Uint16.valueOf(58));
matchBuilder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
matchBuilder.setDlDst(new MacAddress("ff:ff:ff:ff:ff:ff"));
- matchBuilder.setDlVlan(18);
- matchBuilder.setDlVlanPcp((short) 5);
- matchBuilder.setDlType(42);
- matchBuilder.setNwTos((short) 4);
- matchBuilder.setNwProto((short) 7);
+ matchBuilder.setDlVlan(Uint16.valueOf(18));
+ matchBuilder.setDlVlanPcp(Uint8.valueOf(5));
+ matchBuilder.setDlType(Uint16.valueOf(42));
+ matchBuilder.setNwTos(Uint8.valueOf(4));
+ matchBuilder.setNwProto(Uint8.valueOf(7));
matchBuilder.setNwSrc(new Ipv4Address("8.8.8.8"));
matchBuilder.setNwDst(new Ipv4Address("16.16.16.16"));
- matchBuilder.setTpSrc(6653);
- matchBuilder.setTpDst(6633);
+ matchBuilder.setTpSrc(Uint16.valueOf(6653));
+ matchBuilder.setTpDst(Uint16.valueOf(6633));
builder.setMatchV10(matchBuilder.build());
- byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
- builder.setCookie(new BigInteger(1, cookie));
+ final byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
+ builder.setCookie(Uint64.valueOf(new BigInteger(1, cookie)));
builder.setCommand(FlowModCommand.forValue(0));
- builder.setIdleTimeout(12);
- builder.setHardTimeout(16);
- builder.setPriority(1);
- builder.setBufferId(2L);
- builder.setOutPort(new PortNumber(4422L));
+ builder.setIdleTimeout(Uint16.valueOf(12));
+ builder.setHardTimeout(Uint16.valueOf(16));
+ builder.setPriority(Uint16.ONE);
+ builder.setBufferId(Uint32.TWO);
+ builder.setOutPort(new PortNumber(Uint32.valueOf(4422)));
builder.setFlagsV10(new FlowModFlagsV10(true, false, true));
final List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder = new ActionBuilder();
SetTpSrcCaseBuilder tpSrcCaseBuilder = new SetTpSrcCaseBuilder();
SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
- tpSrcBuilder.setPort(new PortNumber(42L));
+ tpSrcBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
actionBuilder.setActionChoice(tpSrcCaseBuilder.build());
actions.add(actionBuilder.build());