Skip to content

Instantly share code, notes, and snippets.

@icarocamelo
Created February 24, 2016 12:57
Show Gist options
  • Save icarocamelo/001dce4d5279e7f02894 to your computer and use it in GitHub Desktop.
Save icarocamelo/001dce4d5279e7f02894 to your computer and use it in GitHub Desktop.
@Test
public void testFlowToJsonString(){
EthernetType ethernetType = new EthernetType(45);
EthernetDestination ethernetDestination = new EthernetDestination("f4:ce:46:bf:32:f3");
EthernetSource ethernetSource = new EthernetSource("d8:d3:85:5b:ad:89");
Match match = MatchBuilder
.setEthernetType(ethernetType)
.setEthernetDestination(ethernetDestination)
.setEthernetSource(ethernetSource)
.build();
List<Instruction> instructions = new ArrayList<Instruction>();
Action action = ActionBuilder
.setOrder(0)
.build();
Instruction instruction = InstructionBuilder
.setOrder(0)
.setAction(action)
.build();
instructions.add(instruction);
Flow f = FlowBuilder
.setStrict(false)
.setInstructions(instructions)
.setTable(1)
.setId(10l)
.setCookieMask(255)
.installHw(false)
.setMatch(match)
.setHardTimeout(10)
.setCookie(4)
.setIdleTimeout(5)
.setFlowName("flowName")
.setPriority(2)
.barrier(false)
.build();
System.out.println(f.toJson());
assertNotNull(f.toJson());
RequestDispatcher.send(f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment