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 io.netty.buffer.ByteBuf;
12 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
13 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
14 import org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MessageCodeExperimenterKey;
15 import org.opendaylight.openflowplugin.impl.protocol.deserialization.AbstractDeserializerTest;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
18 public abstract class AbstractActionDeserializerTest extends AbstractDeserializerTest {
20 private OFDeserializer<Action> deserializer;
23 protected void init() {
24 deserializer = getRegistry().getDeserializer(
25 new MessageCodeExperimenterKey(EncodeConstants.OF13_VERSION_ID, getType(), Action.class, null));
28 protected void writeHeader(ByteBuf message) {
29 message.writeShort(getType());
30 message.writeShort(getLength());
33 protected Action deserializeAction(ByteBuf message) {
34 return deserializer.deserialize(message);
37 protected abstract short getType();
39 protected abstract short getLength();