Search in sources :

Example 21 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetDestinationIpTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getLayer3Match());
    assertTrue(actionCase.getSetField().getLayer3Match() instanceof Ipv4Match);
    Ipv4Match ipv4Match = (Ipv4Match) actionCase.getSetField().getLayer3Match();
    assertEquals(new Ipv4Prefix(IP_ADDRESS + "/" + IP_MASK), ipv4Match.getIpv4Destination());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase) Ipv4Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match) Ipv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)

Example 22 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetFieldEthernetDestinationTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getEthernetMatch());
    assertNotNull(actionCase.getSetField().getEthernetMatch().getEthernetDestination());
    assertEquals(MAC_ADDRESS, actionCase.getSetField().getEthernetMatch().getEthernetDestination().getAddress().getValue());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase)

Example 23 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetFieldEthernetSourceTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getEthernetMatch());
    assertNotNull(actionCase.getSetField().getEthernetMatch().getEthernetSource());
    assertEquals(MAC_ADDRESS, actionCase.getSetField().getEthernetMatch().getEthernetSource().getAddress().getValue());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase)

Example 24 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetIcmpTypeTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getIcmpv4Match());
    Icmpv4Match icmpv4Match = actionCase.getSetField().getIcmpv4Match();
    assertEquals(TYPE, icmpv4Match.getIcmpv4Type().shortValue());
}
Also used : Icmpv4Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4Match) SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase)

Example 25 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetIcmpv6TypeTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getIcmpv6Match());
    Icmpv6Match icmpv6Match = actionCase.getSetField().getIcmpv6Match();
    assertEquals(TYPE, icmpv6Match.getIcmpv6Type().shortValue());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase) Icmpv6Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6Match)

Aggregations

SetFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase)16 ArrayList (java.util.ArrayList)6 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)6 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder)5 SetFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder)5 SetFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase)5 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action)5 Test (org.junit.Test)4 OutputActionCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase)4 PushVlanActionCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase)4 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)4 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)4 ByteBuf (io.netty.buffer.ByteBuf)3 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)3 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder)3 List (java.util.List)2 ExecutionException (java.util.concurrent.ExecutionException)2 Ipv6Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix)2 SetDlDstActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder)2 SetDlSrcActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder)2