.setInstruction(Arrays.asList(
new InstructionBuilder()
.setOrder(0)
- .setKey(new InstructionKey(0))
+ .withKey(new InstructionKey(0))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
.setOrder(0)
- .setKey(new ActionKey(0))
+ .withKey(new ActionKey(0))
.setAction(new SetVlanIdActionCaseBuilder()
.setSetVlanIdAction(new SetVlanIdActionBuilder()
.setVlanId(new VlanId(VLAN_ID))
.build(),
new InstructionBuilder()
.setOrder(2)
- .setKey(new InstructionKey(2))
+ .withKey(new InstructionKey(2))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
- .setOrder(0)
- .setKey(new ActionKey(0))
+ .setOrder(1)
+ .withKey(new ActionKey(1))
.setAction(new SetTpDstActionCaseBuilder()
.setSetTpDstAction(new SetTpDstActionBuilder()
.setIpProtocol(IP_PROTOCOL)
.build(),
new InstructionBuilder()
.setOrder(1)
- .setKey(new InstructionKey(1))
+ .withKey(new InstructionKey(1))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
- .setOrder(0)
- .setKey(new ActionKey(0))
+ .setOrder(2)
+ .withKey(new ActionKey(2))
.setAction(new SetTpSrcActionCaseBuilder()
.setSetTpSrcAction(new SetTpSrcActionBuilder()
.setIpProtocol(IP_PROTOCOL)
@Override
protected void init() {
- serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, FlowMessage.class));
+ serializer = getRegistry()
+ .getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, FlowMessage.class));
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
// Set vlan id action
int setVlanIdLength = 16;
- int setVlanStartIndex = out.readerIndex();
+ final int setVlanStartIndex = out.readerIndex();
assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
assertEquals(out.readUnsignedShort(), setVlanIdLength);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
// Set tp src action
int setTpSrcLength = 16;
- int setTpSrcStartIndex = out.readerIndex();
+ final int setTpSrcStartIndex = out.readerIndex();
assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
assertEquals(out.readUnsignedShort(), setTpSrcLength);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
// Set tp dst action
int setTpDstLength = 16;
- int setTpDstStartIndex = out.readerIndex();
+ final int setTpDstStartIndex = out.readerIndex();
assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
assertEquals(out.readUnsignedShort(), setTpDstLength);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
// Set vlan id action
int setVlanIdLength = 16;
- int setVlanStartIndex = out.readerIndex();
+ final int setVlanStartIndex = out.readerIndex();
assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
assertEquals(out.readUnsignedShort(), setVlanIdLength);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
// Set tp src action
int setTpSrcLength = 16;
- int setTpSrcStartIndex = out.readerIndex();
+ final int setTpSrcStartIndex = out.readerIndex();
assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
assertEquals(out.readUnsignedShort(), setTpSrcLength);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
// Set tp dst action
int setTpDstLength = 16;
- int setTpDstStartIndex = out.readerIndex();
+ final int setTpDstStartIndex = out.readerIndex();
assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
assertEquals(out.readUnsignedShort(), setTpDstLength);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);