Fix checkstyle warnings for impl/protocol test package
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / action / AbstractActionDeserializerTest.java
1 /*
2  * Copyright (c) 2016 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowplugin.impl.protocol.deserialization.action;
10
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;
17
18 public abstract class AbstractActionDeserializerTest extends AbstractDeserializerTest {
19
20     private OFDeserializer<Action> deserializer;
21
22     @Override
23     protected void init() {
24         deserializer = getRegistry().getDeserializer(
25                 new MessageCodeExperimenterKey(EncodeConstants.OF13_VERSION_ID, getType(), Action.class, null));
26     }
27
28     protected void writeHeader(ByteBuf message) {
29         message.writeShort(getType());
30         message.writeShort(getLength());
31     }
32
33     protected Action deserializeAction(ByteBuf message) {
34         return deserializer.deserialize(message);
35     }
36
37     protected abstract short getType();
38
39     protected abstract short getLength();
40
41 }