public void testFlowMod() throws Exception {
// tweak the test packet in since we need a bufferId
this.packetIn.setBufferId(50);
// build expected flow mods
OFMessage fm1 = ((OFFlowMod) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.FLOW_MOD))
.setActions(Arrays.asList(new OFAction[] {
new OFActionOutput().setPort((short) 2).setMaxLength((short) -1)}))
.setBufferId(OFPacketOut.BUFFER_ID_NONE)
.setCommand(OFFlowMod.OFPFC_ADD)
.setIdleTimeout((short) 5)
.setMatch(new OFMatch()
.loadFromPacket(testPacketSerialized, (short) 1)
.setWildcards(OFMatch.OFPFW_NW_PROTO | OFMatch.OFPFW_TP_SRC | OFMatch.OFPFW_TP_DST
| OFMatch.OFPFW_NW_TOS))
.setOutPort(OFPort.OFPP_NONE.getValue())
.setCookie(1L << 52)
.setPriority((short) 100)
.setFlags((short)(1 << 0))
.setLengthU(OFFlowMod.MINIMUM_LENGTH+OFActionOutput.MINIMUM_LENGTH);
OFMessage fm2 = ((OFFlowMod) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.FLOW_MOD))
.setActions(Arrays.asList(new OFAction[] {
new OFActionOutput().setPort((short) 1).setMaxLength((short) -1)}))
.setBufferId(-1)
.setCommand(OFFlowMod.OFPFC_ADD)
.setIdleTimeout((short) 5)