@Test public void testConfigFlowTableEntryForOperation() throws Exception{ Class<FlowUtils> class1 = FlowUtils.class; Method method = class1.getDeclaredMethod("configFlowTableEntryForOperation", new Class[]{UserId.class, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow.class, PhysicalPort.class, PhysicalPath.class, short.class, boolean.class}); method.setAccessible(true); UserId userId = mock(UserId.class); org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow nemoFlow = mock(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow.class); PhysicalPort inPhysicalPort = mock(PhysicalPort.class); PhysicalPath outPhysicalPath = mock(PhysicalPath.class); short operationPriority ; boolean layer3Forwarding; }
private void configFlowTableEntryForOperation(UserId userId, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow nemoFlow, PhysicalNodeId physicalNodeId, short operationPriority, boolean layer3Forwarding) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); Match match = createMatch(userId, nemoFlow, null); Instructions instructions = new InstructionsBuilder().setInstruction(new ArrayList<Instruction>(0)).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(layer3Forwarding ? IP_TABLE_ID : MAC_TABLE_ID); Flow flow = flowBuilder.setPriority(DEFAULT_FLOW_PRIORITY + operationPriority).setMatch(match).setInstructions(instructions).build(); NodeId nodeId = createNodeId(physicalNodeId); InstanceIdentifier<Flow> flowInsId = generateFlowInsId(userId, nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; }
FlowUtils implements AutoCloseable { private void configFlowTableEntryForOperation(UserId userId, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow nemoFlow, PhysicalNodeId physicalNodeId, short operationPriority, boolean layer3Forwarding) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); Match match = createMatch(userId, nemoFlow, null); Instructions instructions = new InstructionsBuilder().setInstruction(new ArrayList<Instruction>(0)).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(layer3Forwarding ? IP_TABLE_ID : MAC_TABLE_ID); Flow flow = flowBuilder.setPriority(DEFAULT_FLOW_PRIORITY + operationPriority).setMatch(match).setInstructions(instructions).build(); NodeId nodeId = createNodeId(physicalNodeId); InstanceIdentifier<Flow> flowInsId = generateFlowInsId(userId, nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } }
FlowUtils implements AutoCloseable { private void configFlowTableEntryForOperation(UserId userId, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow nemoFlow, PhysicalNodeId physicalNodeId, short operationPriority, boolean layer3Forwarding) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); Match match = createMatch(userId, nemoFlow, null); Instructions instructions = new InstructionsBuilder().setInstruction(new ArrayList<Instruction>(0)).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(layer3Forwarding ? IP_TABLE_ID : MAC_TABLE_ID); Flow flow = flowBuilder.setPriority(DEFAULT_FLOW_PRIORITY + operationPriority).setMatch(match).setInstructions(instructions).build(); NodeId nodeId = createNodeId(physicalNodeId); InstanceIdentifier<Flow> flowInsId = generateFlowInsId(userId, nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } FlowUtils(DataBroker dataBroker,
                     PacketProcessingService packetProcessingService,
                     PhyConfigLoader phyConfigLoader); }
FlowUtils implements AutoCloseable { private void configFlowTableEntryForOperation(UserId userId, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow nemoFlow, PhysicalNodeId physicalNodeId, short operationPriority, boolean layer3Forwarding) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); Match match = createMatch(userId, nemoFlow, null); Instructions instructions = new InstructionsBuilder().setInstruction(new ArrayList<Instruction>(0)).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(layer3Forwarding ? IP_TABLE_ID : MAC_TABLE_ID); Flow flow = flowBuilder.setPriority(DEFAULT_FLOW_PRIORITY + operationPriority).setMatch(match).setInstructions(instructions).build(); NodeId nodeId = createNodeId(physicalNodeId); InstanceIdentifier<Flow> flowInsId = generateFlowInsId(userId, nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } FlowUtils(DataBroker dataBroker,
                     PacketProcessingService packetProcessingService,
                     PhyConfigLoader phyConfigLoader); void init(List<PhysicalNode> physicalNodes); void handleArp(PacketReceived packetReceived, NodeConnectorRef ingress); @Override void close(); void assignMPLSLabelForPPath(PhysicalPath physicalPath,
                  List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.links.PhysicalLink> physicalLinksList); }
FlowUtils implements AutoCloseable { private void configFlowTableEntryForOperation(UserId userId, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow nemoFlow, PhysicalNodeId physicalNodeId, short operationPriority, boolean layer3Forwarding) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); Match match = createMatch(userId, nemoFlow, null); Instructions instructions = new InstructionsBuilder().setInstruction(new ArrayList<Instruction>(0)).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(layer3Forwarding ? IP_TABLE_ID : MAC_TABLE_ID); Flow flow = flowBuilder.setPriority(DEFAULT_FLOW_PRIORITY + operationPriority).setMatch(match).setInstructions(instructions).build(); NodeId nodeId = createNodeId(physicalNodeId); InstanceIdentifier<Flow> flowInsId = generateFlowInsId(userId, nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } FlowUtils(DataBroker dataBroker,
                     PacketProcessingService packetProcessingService,
                     PhyConfigLoader phyConfigLoader); void init(List<PhysicalNode> physicalNodes); void handleArp(PacketReceived packetReceived, NodeConnectorRef ingress); @Override void close(); void assignMPLSLabelForPPath(PhysicalPath physicalPath,
                  List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.links.PhysicalLink> physicalLinksList);  }