use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoad in project openflowplugin by opendaylight.
the class RegLoadConvertorTest method setUp.
@Before
public void setUp() throws Exception {
final NxRegLoad nxRegLoad = Mockito.mock(NxRegLoad.class);
final Dst dst = Mockito.mock(Dst.class);
when(dst.getStart()).thenReturn(1);
when(dst.getEnd()).thenReturn(2);
when(nxRegLoad.getDst()).thenReturn(dst);
when(nxRegLoad.getValue()).thenReturn(BigInteger.valueOf(3L));
when(nxRegLoad.getDst().getDstChoice()).thenReturn(Mockito.mock(DstNxTunIdCase.class));
when(actionsCase.getNxRegLoad()).thenReturn(nxRegLoad);
final ActionRegLoad actionRegLoad = Mockito.mock(ActionRegLoad.class);
final NxActionRegLoad nxActionRegLoad = Mockito.mock(NxActionRegLoad.class);
when(nxActionRegLoad.getDst()).thenReturn(NiciraMatchCodecs.ICMP_TYPE_CODEC.getHeaderWithoutHasMask().toLong());
when(nxActionRegLoad.getOfsNbits()).thenReturn(4);
when(nxActionRegLoad.getValue()).thenReturn(BigInteger.ONE);
when(actionRegLoad.getNxActionRegLoad()).thenReturn(nxActionRegLoad);
when(action.getActionChoice()).thenReturn(actionRegLoad);
regLoadConvertor = new RegLoadConvertor();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoad in project openflowplugin by opendaylight.
the class RegLoadConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionRegLoad actionRegLoad = ((ActionRegLoad) input.getActionChoice()).getNxActionRegLoad();
DstBuilder dstBuilder = new DstBuilder();
dstBuilder.setDstChoice(RegMoveConvertor.resolveDstValue(actionRegLoad.getDst()));
dstBuilder.setStart(resolveStart(actionRegLoad.getOfsNbits()));
dstBuilder.setEnd(resolveEnd(actionRegLoad.getOfsNbits()));
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
nxRegLoadBuilder.setDst(dstBuilder.build());
nxRegLoadBuilder.setValue(actionRegLoad.getValue());
return resolveAction(nxRegLoadBuilder.build(), path);
}
Aggregations