use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder in project openflowplugin by opendaylight.
the class TypeKeyMakerFactoryTest method testActionKeyMaker.
/**
* Tests {@link TypeKeyMakerFactory#createActionKeyMaker(short)}.
*/
@Test
public void testActionKeyMaker() {
TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID);
Assert.assertNotNull("Null keyMaker", keyMaker);
ActionBuilder builder = new ActionBuilder();
builder.setActionChoice(new OutputActionCaseBuilder().build());
Action action = builder.build();
MessageTypeKey<?> key = keyMaker.make(action);
Assert.assertNotNull("Null key", key);
Assert.assertEquals("Wrong key", new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, OutputActionCase.class, null), key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder in project openflowplugin by opendaylight.
the class OutputActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final int length = 10;
final String port = OutputPortValues.LOCAL.toString();
final Action action = new OutputActionCaseBuilder().setOutputAction(new OutputActionBuilder().setOutputNodeConnector(new Uri("openflow:1:" + port)).setMaxLength(length).build()).build();
assertAction(action, out -> {
assertEquals(out.readUnsignedInt(), BinContent.intToUnsignedLong(PortNumberValues.LOCAL.getIntValue()));
assertEquals(out.readUnsignedShort(), length);
out.skipBytes(ActionConstants.OUTPUT_PADDING);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createAllOutputAction.
private List<Action> createAllOutputAction() {
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
Uri value = new Uri(OutputPortValues.ALL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createNormalOutputAction.
private List<Action> createNormalOutputAction() {
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
Uri value = new Uri(OutputPortValues.NORMAL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createLocalOutputAction.
private List<Action> createLocalOutputAction() {
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
Uri value = new Uri(OutputPortValues.LOCAL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
Aggregations