* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.action;
import static org.junit.Assert.assertEquals;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionDecap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionDecapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.aug.nx.action.ActionDecap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.aug.nx.action.ActionDecapBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.decap.grouping.NxActionDecapBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
public class DecapCodecTest {
private static final int LENGTH = 16;
private static final int SUBTYPE = 47;
- private static final long PACKET_TYPE = 0xFFFEL;
+ private static final Uint32 PACKET_TYPE = Uint32.valueOf(0xFFFEL);
DecapCodec decapCodec;
ByteBuf buffer;
ActionDecap result = (ActionDecap) action.getActionChoice();
- assertEquals(PACKET_TYPE, result.getNxActionDecap().getPacketType().longValue());
+ assertEquals(PACKET_TYPE, result.getNxActionDecap().getPacketType());
assertFalse(buffer.isReadable());
}
assertEquals(SUBTYPE, buffer.readUnsignedShort());
//Serialize part
assertEquals(0, buffer.readUnsignedShort());
- assertEquals(PACKET_TYPE, buffer.readUnsignedInt());
+ assertEquals(PACKET_TYPE.longValue(), buffer.readUnsignedInt());
assertFalse(buffer.isReadable());
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(final ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
message.writeShort(SUBTYPE);
message.writeZero(2);
- message.writeInt((int) PACKET_TYPE);
+ message.writeInt(PACKET_TYPE.intValue());
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);