2 * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.impl.protocol.deserialization.action;
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertTrue;
14 import io.netty.buffer.ByteBuf;
15 import io.netty.buffer.UnpooledByteBufAllocator;
16 import org.junit.Test;
17 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
21 public class PopVlanActionDeserializerTest extends AbstractActionDeserializerTest {
24 public void testDeserialize() {
25 final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
27 in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
29 final Action action = deserializeAction(in);
30 assertTrue(action instanceof PopVlanActionCase);
31 assertEquals(0, in.readableBytes());
35 protected short getType() {
36 return ActionConstants.POP_VLAN_CODE;
40 protected short getLength() {
41 return ActionConstants.GENERAL_ACTION_LENGTH;