Search in sources :

Example 61 with ActionInfo

use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.

the class ActionInfoBuilderTest method groupActionWithSingleIntegerInStringValue.

@Test
public void groupActionWithSingleIntegerInStringValue() {
    ActionInfo actionInfo = new ActionGroup(123);
    assertEquals("(new ActionGroupBuilder => [" + System.lineSeparator() + "    groupId = 123L" + System.lineSeparator() + "]).build()", generator.getExpression(actionInfo));
}
Also used : ActionGroup(org.opendaylight.genius.mdsalutil.actions.ActionGroup) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) Test(org.junit.Test)

Example 62 with ActionInfo

use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.

the class ActionInfoBuilderTest method groupActionWithSingleIntegerInStringValueWithActionKey.

@Test
public void groupActionWithSingleIntegerInStringValueWithActionKey() {
    ActionInfo actionInfo = new ActionGroup(69, 123);
    assertEquals("(new ActionGroupBuilder => [" + System.lineSeparator() + "    groupId = 123L" + System.lineSeparator() + "]).build()", generator.getExpression(actionInfo));
}
Also used : ActionGroup(org.opendaylight.genius.mdsalutil.actions.ActionGroup) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) Test(org.junit.Test)

Example 63 with ActionInfo

use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.

the class ActionInfoBuilderTest method set_field_tunnel_idActionWithBigActionValuesWithActionKey.

@Test
public void set_field_tunnel_idActionWithBigActionValuesWithActionKey() {
    ActionInfo actionInfo = new ActionSetFieldTunnelId(69, BigInteger.valueOf(123));
    assertEquals("new ActionSetFieldTunnelId(69, 123bi)", generator.getExpression(actionInfo));
}
Also used : ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) ActionSetFieldTunnelId(org.opendaylight.genius.mdsalutil.actions.ActionSetFieldTunnelId) Test(org.junit.Test)

Example 64 with ActionInfo

use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.

the class ActionInfoImmutableTest method actionInfoActionKeyDoesNotMagicallyChangeOnFlowEntityGetFlowBuilder.

@Test
public void actionInfoActionKeyDoesNotMagicallyChangeOnFlowEntityGetFlowBuilder() {
    FlowEntityBuilder flowEntityBuilder = new FlowEntityBuilder().setDpnId(BigInteger.valueOf(123L)).setTableId((short) 1).setPriority(2).setFlowName("TEST-NAME").setFlowId("TEST-ID").setCookie(BigInteger.valueOf(110100480L));
    ActionInfo actionInfo = new ActionNxConntrack(27, 1, 0, 0, (short) 255);
    List<ActionInfo> actionInfos = new ArrayList<>();
    actionInfos.add(actionInfo);
    flowEntityBuilder.addInstructionInfoList(new InstructionApplyActions(actionInfos));
    FlowEntity flowEntity = flowEntityBuilder.build();
    assertEquals(27, ((InstructionApplyActions) flowEntity.getInstructionInfoList().get(0)).getActionInfos().get(0).getActionKey());
    flowEntity.getFlowBuilder();
    assertEquals(27, ((InstructionApplyActions) flowEntity.getInstructionInfoList().get(0)).getActionInfos().get(0).getActionKey());
    flowEntity.getFlowBuilder();
    assertEquals(27, ((InstructionApplyActions) flowEntity.getInstructionInfoList().get(0)).getActionInfos().get(0).getActionKey());
}
Also used : FlowEntityBuilder(org.opendaylight.genius.mdsalutil.FlowEntityBuilder) ArrayList(java.util.ArrayList) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) ActionNxConntrack(org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity) Test(org.junit.Test)

Example 65 with ActionInfo

use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.

the class ActionSetDestinationIpTest method generateAction.

@Test
public void generateAction() {
    ActionInfo actionInfo = new ActionSetDestinationIp(IP_ADDRESS);
    assertEquals("new ActionSetDestinationIp(0, new Ipv4Prefix(\"" + IP_ADDRESS + "/" + IP_MASK + "\"))", generator.getExpression(actionInfo));
}
Also used : ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) Test(org.junit.Test)

Aggregations

ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)133 ArrayList (java.util.ArrayList)97 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)74 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)73 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)52 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)39 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)33 Test (org.junit.Test)32 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)32 BigInteger (java.math.BigInteger)26 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)20 MatchInfoBase (org.opendaylight.genius.mdsalutil.MatchInfoBase)17 ActionGroup (org.opendaylight.genius.mdsalutil.actions.ActionGroup)16 InstructionGotoTable (org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable)15 BucketInfo (org.opendaylight.genius.mdsalutil.BucketInfo)14 ActionNxConntrack (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack)12 ActionPuntToController (org.opendaylight.genius.mdsalutil.actions.ActionPuntToController)12 ActionSetFieldTunnelId (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldTunnelId)12 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)11 ActionDrop (org.opendaylight.genius.mdsalutil.actions.ActionDrop)9