- private CompositeNode createTestFlow() {
- FlowBuilder flow = new FlowBuilder();
- flow.setKey(FLOW_KEY);
- Short tableId = 0;
- flow.setTableId(tableId);
- MatchBuilder match = new MatchBuilder();
- match.setIpMatch(new IpMatchBuilder().setIpProto(IpVersion.Ipv4).build());
- Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
- // ipv4Match.setIpv4Destination(new Ipv4Prefix(cliInput.get(4)));
- Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
- ipv4Match.setIpv4Destination(prefix);
- Ipv4Match i4m = ipv4Match.build();
- match.setLayer3Match(i4m);
- flow.setMatch(match.build());
-
-
-
- // Create a drop action
- /*
- * Note: We are mishandling drop actions DropAction dropAction = new
- * DropActionBuilder().build(); ActionBuilder ab = new ActionBuilder();
- * ab.setAction(dropAction);
- */
-
- DecNwTtl decNwTtl = new DecNwTtlBuilder().build();
- ActionBuilder ab = new ActionBuilder();
- ActionKey actionKey = new ActionKey(0);
- ab.setKey(actionKey );
- ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
-
- // Add our drop action to a list
- List<Action> actionList = new ArrayList<Action>();
- actionList.add(ab.build());
-
- // Create an Apply Action
- ApplyActionsBuilder aab = new ApplyActionsBuilder();
- aab.setAction(actionList);
-
- // Wrap our Apply Action in an Instruction
- InstructionBuilder ib = new InstructionBuilder();
- ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
- // Put our Instruction in a list of Instructions
- InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
- instructions.add(ib.build());
- isb.setInstruction(instructions);
-
- // Add our instructions to the flow
- flow.setInstructions(isb.build());
-
- flow.setPriority(2);
- flow.setFlowName("Foo Name");
- CompositeNode domFlow = mappingService.toDataDom(flow.build());
- return domFlow;
+ private CompositeNode createTestList1() {
+ List1Builder l1b = new List1Builder();
+ List11Builder l11b = new List11Builder();
+ List12Builder l12b = new List12Builder();
+ l11b.setKey(LIST11_KEY);
+ l11b.setAttrStr("foo:foo:foo");
+ l12b.setKey(new List12Key(321));
+ l12b.setAttrStr("foo:foo:bar");
+ l1b.setKey(LIST1_KEY);
+ l1b.setList11(ImmutableList.of(l11b.build()));
+ l1b.setList12(ImmutableList.of(l12b.build()));
+ CompositeNode domList1 = mappingService.toDataDom(l1b.build());
+ return domList1;